You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -3154,6 +3135,43 @@ contributors: Ron Buckton, Ecma International
3154
3135
<p>The |BindingIdentifier| in a |FunctionExpression| can be referenced from inside the |FunctionExpression|'s |FunctionBody| to allow the function to call itself recursively. However, unlike in a |FunctionDeclaration|, the |BindingIdentifier| in a |FunctionExpression| cannot be referenced from and does not affect the scope enclosing the |FunctionExpression|.</p>
1. Return InstantiateOrdinaryFunctionExpression of |FunctionExpression|.
3157
+
</emu-alg>
3158
+
<emu-note>
3159
+
<p>A *"prototype"* property is automatically created for every function defined using a |FunctionDeclaration| or |FunctionExpression|, to allow for the possibility that the function will be used as a constructor.</p>
_generatorBody_: a |FunctionBody| Parse Node or an Abstract Closure with no parameters,
4828
-
): ~unused~
4829
-
</h1>
4830
-
<dl class="header">
4831
-
</dl>
4832
-
<emu-alg>
4833
-
1. Assert: The value of _generator_.[[GeneratorState]] is *undefined*.
4834
-
1. Let _genContext_ be the running execution context.
4835
-
1. Set the Generator component of _genContext_ to _generator_.
4836
-
1. [fence-effects="user-code"] Set the code evaluation state of _genContext_ such that when evaluation is resumed for that execution context the following steps will be performed:
4837
-
1. If _generatorBody_ is a Parse Node, then
4838
-
1. Let _result_ be the result of evaluating _generatorBody_.
4839
-
1. Else,
4840
-
1. Assert: _generatorBody_ is an Abstract Closure with no parameters.
4841
-
1. Let _result_ be _generatorBody_().
4842
-
1. Assert: If we return here, the generator either threw an exception or performed either an implicit or explicit return.
4843
-
1. Remove _genContext_ from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context.
4844
-
1. Set _generator_.[[GeneratorState]] to ~completed~.
4845
-
1. Once a generator enters the ~completed~ state it never leaves it and its associated execution context is never resumed. Any execution state associated with _generator_ can be discarded at this point.
4846
-
1. <ins>Let _env_ be _genContext_'s LexicalEnvironment.</ins>
4847
-
1. <ins>Set _result_ to DisposeResources(_env_.[[DisposeCapability]], _result_).</ins>
4848
-
1. If _result_.[[Type]] is ~normal~, let _resultValue_ be *undefined*.
4849
-
1. Else if _result_.[[Type]] is ~return~, let _resultValue_ be _result_.[[Value]].
_generatorBody_: a |FunctionBody| Parse Node or an Abstract Closure with no parameters,
4873
-
): ~unused~
4874
-
</h1>
4875
-
<dl class="header">
4876
-
</dl>
4877
-
<emu-alg>
4878
-
1. Assert: _generator_.[[AsyncGeneratorState]] is *undefined*.
4879
-
1. Let _genContext_ be the running execution context.
4880
-
1. Set the Generator component of _genContext_ to _generator_.
4881
-
1. [fence-effects="user-code"] Set the code evaluation state of _genContext_ such that when evaluation is resumed for that execution context the following steps will be performed:
4882
-
1. If _generatorBody_ is a Parse Node, then
4883
-
1. Let _result_ be the result of evaluating _generatorBody_.
4884
-
1. Else,
4885
-
1. Assert: _generatorBody_ is an Abstract Closure with no parameters.
4886
-
1. Let _result_ be Completion(_generatorBody_()).
4887
-
1. Assert: If we return here, the async generator either threw an exception or performed either an implicit or explicit return.
4888
-
1. Remove _genContext_ from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context.
4889
-
1. Set _generator_.[[AsyncGeneratorState]] to ~completed~.
4890
-
1. <ins>Let _env_ be _genContext_'s LexicalEnvironment.</ins>
4891
-
1. <ins>Set _result_ to DisposeResources(_env_.[[DisposeCapability]], _result_).</ins>
4892
-
1. If _result_.[[Type]] is ~normal~, set _result_ to NormalCompletion(*undefined*).
4893
-
1. If _result_.[[Type]] is ~return~, set _result_ to NormalCompletion(_result_.[[Value]]).
1. Assert: _promiseCapability_ is a PromiseCapability Record.
4924
-
1. Let _runningContext_ be the running execution context.
4925
-
1. [fence-effects="user-code"] Set the code evaluation state of _asyncContext_ such that when evaluation is resumed for that execution context the following steps will be performed:
4926
-
1. Let _result_ be the result of evaluating _asyncBody_.
4927
-
1. Assert: If we return here, the async function either threw an exception or performed an implicit or explicit return; all awaiting is done.
4928
-
1. Remove _asyncContext_ from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context.
4929
-
1. <ins>Let _env_ be _asyncContext_'s LexicalEnvironment.</ins>
4930
-
1. <ins>Set _result_ to DisposeResources(_env_.[[DisposeCapability]], _result_).</ins>
1. Push _asyncContext_ onto the execution context stack; _asyncContext_ is now the running execution context.
4940
-
1. <emu-meta effects="user-code">Resume the suspended evaluation of _asyncContext_</emu-meta>. Let _result_ be the value returned by the resumed computation.
4941
-
1. Assert: When we return here, _asyncContext_ has already been removed from the execution context stack and _runningContext_ is the currently running execution context.
4942
-
1. Assert: _result_ is a normal completion with a value of ~unused~. The possible sources of this value are Await or, if the async function doesn't await anything, step <emu-xref href="#step-asyncblockstart-return-undefined"></emu-xref> above.
0 commit comments