diff --git a/spec.html b/spec.html index 3751cc7..7a9452c 100644 --- a/spec.html +++ b/spec.html @@ -302,6 +302,60 @@

Runtime Semantics: Evaluation

+ +

ECMAScript Language: Scripts and Modules

+ + +

Modules

+ + +

Module Semantics

+ + +

Source Text Module Records

+ +

+ ExecuteModule ( + optional _capability_: a PromiseCapability Record, + ): either a normal completion containing ~unused~ or a throw completion +

+
+
for
+
a Source Text Module Record _module_
+
+ + + 1. Let _moduleContext_ be a new ECMAScript code execution context. + 1. Set the Function of _moduleContext_ to *null*. + 1. Set the Realm of _moduleContext_ to _module_.[[Realm]]. + 1. Set the ScriptOrModule of _moduleContext_ to _module_. + 1. Assert: _module_ has been linked and declarations in its module environment have been instantiated. + 1. Set the VariableEnvironment of _moduleContext_ to _module_.[[Environment]]. + 1. Set the LexicalEnvironment of _moduleContext_ to _module_.[[Environment]]. + 1. Suspend the running execution context. + 1. Let _moduleContextMapping_ be a new empty list. + 1. Let _previousContextMapping_ be AsyncContextSwap(_moduleContextMapping_). + 1. If _module_.[[HasTLA]] is *false*, then + 1. Assert: _capability_ is not present. + 1. Push _moduleContext_ onto the execution context stack; _moduleContext_ is now the running execution context. + 1. Let _result_ be Completion(Evaluation of _module_.[[ECMAScriptCode]]). + 1. AsyncContextSwap(_previousContextMapping_). + 1. Suspend _moduleContext_ and remove it from the execution context stack. + 1. Resume the context that is now on the top of the execution context stack as the running execution context. + 1. If _result_ is an abrupt completion, then + 1. Return ? _result_. + 1. Else, + 1. Assert: _capability_ is a PromiseCapability Record. + 1. Perform AsyncBlockStart(_capability_, _module_.[[ECMAScriptCode]], _moduleContext_). + 1. AsyncContextSwap(_previousContextMapping_). + 1. Return ~unused~. + +
+
+
+
+
+

Control Abstraction Objects