From 35af90949f809a9fe36da75d0131cd965593b527 Mon Sep 17 00:00:00 2001 From: jhnaldo Date: Thu, 21 Nov 2024 08:12:18 -1000 Subject: [PATCH] Editorial: Fixed return types of algorithms returning ~empty~ (#2924) Co-authored-by: jhnaldo Co-authored-by: Michael Ficarra Co-authored-by: Kevin Gibbons --- esmeta-ignore.json | 8 ++------ spec.html | 37 ++++++++++++++++++++----------------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/esmeta-ignore.json b/esmeta-ignore.json index d49de7b1a8..fd4453e322 100644 --- a/esmeta-ignore.json +++ b/esmeta-ignore.json @@ -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", @@ -26,8 +25,8 @@ "GetMethod", "GetPromiseResolve", "GetThisValue", + "Initializer[0,0].EvaluateBody", "InnerModuleEvaluation", - "LabelledItem[1,0].LabelledEvaluation", "MethodDefinition[0,0].DefineMethod", "ModuleNamespaceCreate", "OrdinaryFunctionCreate", @@ -37,9 +36,6 @@ "SourceTextModuleRecord.ExecuteModule", "SourceTextModuleRecord.ResolveExport", "SpeciesConstructor", - "Statement[0,0].LabelledEvaluation", - "Statement[1,0].LabelledEvaluation", - "Statement[2,0].LabelledEvaluation", "StringCreate", "TypedArrayCreateFromConstructor" ] diff --git a/spec.html b/spec.html index 90d2015448..01a536baa4 100644 --- a/spec.html +++ b/spec.html @@ -13407,8 +13407,8 @@

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_.

When _calleeContext_ is removed from the execution context stack in step it must not be destroyed if it is suspended and retained for later resumption by an accessible Generator.

@@ -13478,7 +13478,7 @@

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

@@ -13543,7 +13543,7 @@

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

@@ -13580,12 +13580,12 @@

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_. @@ -22968,7 +22968,7 @@

Runtime Semantics: Evaluation

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

@@ -23096,7 +23096,7 @@

Static Semantics: Early Errors

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

@@ -23571,14 +23571,16 @@

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

FunctionBody : FunctionStatementList 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*). @@ -23754,7 +23756,7 @@

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

@@ -24960,7 +24962,7 @@

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

@@ -24968,7 +24970,8 @@

1. Assert: _functionObject_ is a synthetic function created by ClassStaticBlockDefinitionEvaluation step . 1. Perform ! FunctionDeclarationInstantiation(_functionObject_, « »). - 1. Return ? Evaluation of |ClassStaticBlockStatementList|. + 1. Perform ? Evaluation of |ClassStaticBlockStatementList|. + 1. Return ReturnCompletion(*undefined*).