Skip to content

Commit

Permalink
Editorial: Fixed return types of algorithms returning ~empty~ (#2924)
Browse files Browse the repository at this point in the history
Co-authored-by: jhnaldo <jhpjhp0223@gmail.com>
Co-authored-by: Michael Ficarra <mficarra@shapesecurity.com>
Co-authored-by: Kevin Gibbons <bakkot@gmail.com>
  • Loading branch information
3 people authored and ljharb committed Nov 21, 2024
1 parent 0b6c5f1 commit 35af909
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
8 changes: 2 additions & 6 deletions esmeta-ignore.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
"AsyncGeneratorBody[0,0].EvaluateAsyncGeneratorBody",
"BindingPattern[1,0].BindingInitialization",
"BoundFunctionCreate",
"Catch[0,0].CatchClauseEvaluation",
"Catch[1,0].CatchClauseEvaluation",
"ClassStaticBlockBody[0,0].EvaluateClassStaticBlockBody",
"ConciseBody[0,0].EvaluateConciseBody",
"CreateBuiltinFunction",
"CreateMappedArgumentsObject",
"CreateSharedByteDataBlock",
Expand All @@ -26,8 +25,8 @@
"GetMethod",
"GetPromiseResolve",
"GetThisValue",
"Initializer[0,0].EvaluateBody",
"InnerModuleEvaluation",
"LabelledItem[1,0].LabelledEvaluation",
"MethodDefinition[0,0].DefineMethod",
"ModuleNamespaceCreate",
"OrdinaryFunctionCreate",
Expand All @@ -37,9 +36,6 @@
"SourceTextModuleRecord.ExecuteModule",
"SourceTextModuleRecord.ResolveExport",
"SpeciesConstructor",
"Statement[0,0].LabelledEvaluation",
"Statement[1,0].LabelledEvaluation",
"Statement[2,0].LabelledEvaluation",
"StringCreate",
"TypedArrayCreateFromConstructor"
]
37 changes: 20 additions & 17 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -13407,8 +13407,8 @@ <h1>
1. Let _result_ be Completion(OrdinaryCallEvaluateBody(_F_, _argumentsList_)).
1. [id="step-call-pop-context-stack"] Remove _calleeContext_ from the execution context stack and restore _callerContext_ as the running execution context.
1. If _result_ is a return completion, return _result_.[[Value]].
1. ReturnIfAbrupt(_result_).
1. Return *undefined*.
1. Assert: _result_ is a throw completion.
1. Return ? _result_.
</emu-alg>
<emu-note>
<p>When _calleeContext_ is removed from the execution context stack in step <emu-xref href="#step-call-pop-context-stack"></emu-xref> it must not be destroyed if it is suspended and retained for later resumption by an accessible Generator.</p>
Expand Down Expand Up @@ -13478,7 +13478,7 @@ <h1>
Runtime Semantics: EvaluateBody (
_functionObject_: an ECMAScript function object,
_argumentsList_: a List of ECMAScript language values,
): either a normal completion containing an ECMAScript language value or an abrupt completion
): a return completion or a throw completion
</h1>
<dl class="header">
</dl>
Expand Down Expand Up @@ -13543,7 +13543,7 @@ <h1>
OrdinaryCallEvaluateBody (
_F_: an ECMAScript function object,
_argumentsList_: a List of ECMAScript language values,
): either a normal completion containing an ECMAScript language value or an abrupt completion
): a return completion or a throw completion
</h1>
<dl class="header">
</dl>
Expand Down Expand Up @@ -13580,12 +13580,12 @@ <h1>
1. Let _constructorEnv_ be the LexicalEnvironment of _calleeContext_.
1. Let _result_ be Completion(OrdinaryCallEvaluateBody(_F_, _argumentsList_)).
1. Remove _calleeContext_ from the execution context stack and restore _callerContext_ as the running execution context.
1. If _result_ is a return completion, then
1. If _result_.[[Value]] is an Object, return _result_.[[Value]].
1. If _kind_ is ~base~, return _thisArgument_.
1. If _result_.[[Value]] is not *undefined*, throw a *TypeError* exception.
1. Else,
1. ReturnIfAbrupt(_result_).
1. If _result_ is a throw completion, then
1. Return ? _result_.
1. Assert: _result_ is a return completion.
1. If _result_.[[Value]] is an Object, return _result_.[[Value]].
1. If _kind_ is ~base~, return _thisArgument_.
1. If _result_.[[Value]] is not *undefined*, throw a *TypeError* exception.
1. Let _thisBinding_ be ? _constructorEnv_.GetThisBinding().
1. Assert: _thisBinding_ is an Object.
1. Return _thisBinding_.
Expand Down Expand Up @@ -22968,7 +22968,7 @@ <h1>Runtime Semantics: Evaluation</h1>
<h1>
Runtime Semantics: LabelledEvaluation (
_labelSet_: a List of Strings,
): either a normal completion containing an ECMAScript language value or an abrupt completion
): either a normal completion containing either an ECMAScript language value or ~empty~, or an abrupt completion
</h1>
<dl class="header">
</dl>
Expand Down Expand Up @@ -23096,7 +23096,7 @@ <h1>Static Semantics: Early Errors</h1>
<h1>
Runtime Semantics: CatchClauseEvaluation (
_thrownValue_: an ECMAScript language value,
): either a normal completion containing an ECMAScript language value or an abrupt completion
): either a normal completion containing either an ECMAScript language value or ~empty~, or an abrupt completion
</h1>
<dl class="header">
</dl>
Expand Down Expand Up @@ -23571,14 +23571,16 @@ <h1>
Runtime Semantics: EvaluateFunctionBody (
_functionObject_: an ECMAScript function object,
_argumentsList_: a List of ECMAScript language values,
): either a normal completion containing an ECMAScript language value or an abrupt completion
): a return completion or a throw completion
</h1>
<dl class="header">
</dl>
<emu-grammar>FunctionBody : FunctionStatementList</emu-grammar>
<emu-alg>
1. Perform ? FunctionDeclarationInstantiation(_functionObject_, _argumentsList_).
1. Return ? Evaluation of |FunctionStatementList|.
1. Perform ? Evaluation of |FunctionStatementList|.
1. NOTE: If the previous step resulted in a normal completion, then evaluation finished by proceeding past the end of the |FunctionStatementList|.
1. Return ReturnCompletion(*undefined*).
</emu-alg>
</emu-clause>

Expand Down Expand Up @@ -23754,7 +23756,7 @@ <h1>
Runtime Semantics: EvaluateConciseBody (
_functionObject_: an ECMAScript function object,
_argumentsList_: a List of ECMAScript language values,
): either a normal completion containing an ECMAScript language value or an abrupt completion
): a return completion or a throw completion
</h1>
<dl class="header">
</dl>
Expand Down Expand Up @@ -24960,15 +24962,16 @@ <h1>
<h1>
Runtime Semantics: EvaluateClassStaticBlockBody (
_functionObject_: an ECMAScript function object,
): either a normal completion containing an ECMAScript language value or an abrupt completion
): a return completion or a throw completion
</h1>
<dl class="header">
</dl>
<emu-grammar>ClassStaticBlockBody : ClassStaticBlockStatementList</emu-grammar>
<emu-alg>
1. Assert: _functionObject_ is a synthetic function created by ClassStaticBlockDefinitionEvaluation step <emu-xref href="#step-synthetic-class-static-block-fn"></emu-xref>.
1. Perform ! FunctionDeclarationInstantiation(_functionObject_, « »).
1. Return ? Evaluation of |ClassStaticBlockStatementList|.
1. Perform ? Evaluation of |ClassStaticBlockStatementList|.
1. Return ReturnCompletion(*undefined*).
</emu-alg>
</emu-clause>

Expand Down

0 comments on commit 35af909

Please sign in to comment.