Skip to content

Commit 48cab84

Browse files
bakkotljharb
authored andcommitted
Editorial: FunctionDeclarationInstantiation cannot return ReturnCompletion (#3607)
1 parent 17b5581 commit 48cab84

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

esmeta-ignore.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"DoWait",
77
"EvaluateImportCall",
88
"FinishLoadingImportedModule",
9+
"FunctionDeclarationInstantiation",
910
"FunctionBody[0,0].EvaluateFunctionBody",
1011
"GetViewByteLength",
1112
"INTRINSICS.Atomics.notify",

spec.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13848,7 +13848,7 @@ <h1>
1384813848
FunctionDeclarationInstantiation (
1384913849
_func_: an ECMAScript function object,
1385013850
_argumentsList_: a List of ECMAScript language values,
13851-
): either a normal completion containing ~unused~ or an abrupt completion
13851+
): either a normal completion containing ~unused~ or a throw completion
1385213852
</h1>
1385313853
<dl class="header">
1385413854
<dt>description</dt>
@@ -13927,9 +13927,11 @@ <h1>
1392713927
1. Let _parameterBindings_ be _parameterNames_.
1392813928
1. Let _iteratorRecord_ be CreateListIteratorRecord(_argumentsList_).
1392913929
1. If _hasDuplicates_ is *true*, then
13930-
1. Perform ? IteratorBindingInitialization of _formals_ with arguments _iteratorRecord_ and *undefined*.
13930+
1. Let _usedEnv_ be *undefined*.
1393113931
1. Else,
13932-
1. Perform ? IteratorBindingInitialization of _formals_ with arguments _iteratorRecord_ and _env_.
13932+
1. Let _usedEnv_ be _env_.
13933+
1. NOTE: The following step cannot return a ReturnCompletion because the only way such a completion can arise in expression position is by use of |YieldExpression|, which is forbidden in parameter lists by Early Error rules in <emu-xref href="#sec-generator-function-definitions-static-semantics-early-errors"></emu-xref> and <emu-xref href="#sec-async-generator-function-definitions-static-semantics-early-errors"></emu-xref>.
13934+
1. Perform ? IteratorBindingInitialization of _formals_ with arguments _iteratorRecord_ and _usedEnv_.
1393313935
1. If _hasParameterExpressions_ is *false*, then
1393413936
1. NOTE: Only a single Environment Record is needed for the parameters and top-level vars.
1393513937
1. Let _instantiatedVarNames_ be a copy of the List _parameterBindings_.

0 commit comments

Comments
 (0)