@@ -19790,14 +19790,14 @@ <h1>Static Semantics: PropName</h1>
19790
19790
19791
19791
<emu-clause id="sec-runtime-semantics-classdefinitionevaluation">
19792
19792
<h1>Runtime Semantics: ClassDefinitionEvaluation</h1>
19793
- <p>With parameter _className_.</p>
19793
+ <p>With parameters _classBinding_ and _className_.</p>
19794
19794
<emu-grammar>ClassTail : ClassHeritage? `{` ClassBody? `}`</emu-grammar>
19795
19795
<emu-alg>
19796
19796
1. Let _lex_ be the LexicalEnvironment of the running execution context.
19797
19797
1. Let _classScope_ be NewDeclarativeEnvironment(_lex_).
19798
19798
1. Let _classScopeEnvRec_ be _classScope_'s EnvironmentRecord.
19799
- 1. If _className_ is not *undefined*, then
19800
- 1. Perform _classScopeEnvRec_.CreateImmutableBinding(_className_ , *true*).
19799
+ 1. If _classBinding_ is not *undefined*, then
19800
+ 1. Perform _classScopeEnvRec_.CreateImmutableBinding(_classBinding_ , *true*).
19801
19801
1. If |ClassHeritage_opt| is not present, then
19802
19802
1. Let _protoParent_ be the intrinsic object %ObjectPrototype%.
19803
19803
1. Let _constructorParent_ be the intrinsic object %FunctionPrototype%.
@@ -19833,6 +19833,8 @@ <h1>Runtime Semantics: ClassDefinitionEvaluation</h1>
19833
19833
1. If |ClassHeritage_opt| is present, set _F_.[[ConstructorKind]] to `"derived"`.
19834
19834
1. Perform MakeConstructor(_F_, *false*, _proto_).
19835
19835
1. Perform MakeClassConstructor(_F_).
19836
+ 1. If _className_ is not *undefined*, then
19837
+ 1. Perform SetFunctionName(_F_, _className_).
19836
19838
1. Perform CreateMethodProperty(_proto_, `"constructor"`, _F_).
19837
19839
1. If |ClassBody_opt| is not present, let _methods_ be a new empty List.
19838
19840
1. Else, let _methods_ be NonConstructorMethodDefinitions of |ClassBody|.
@@ -19845,8 +19847,8 @@ <h1>Runtime Semantics: ClassDefinitionEvaluation</h1>
19845
19847
1. Set the running execution context's LexicalEnvironment to _lex_.
19846
19848
1. Return Completion(_status_).
19847
19849
1. Set the running execution context's LexicalEnvironment to _lex_.
19848
- 1. If _className_ is not *undefined*, then
19849
- 1. Perform _classScopeEnvRec_.InitializeBinding(_className_ , _F_).
19850
+ 1. If _classBinding_ is not *undefined*, then
19851
+ 1. Perform _classScopeEnvRec_.InitializeBinding(_classBinding_ , _F_).
19850
19852
1. Return _F_.
19851
19853
</emu-alg>
19852
19854
</emu-clause>
@@ -19856,20 +19858,18 @@ <h1>Runtime Semantics: BindingClassDeclarationEvaluation</h1>
19856
19858
<emu-grammar>ClassDeclaration : `class` BindingIdentifier ClassTail</emu-grammar>
19857
19859
<emu-alg>
19858
19860
1. Let _className_ be StringValue of |BindingIdentifier|.
19859
- 1. Let _value_ be the result of ClassDefinitionEvaluation of |ClassTail| with argument _className_.
19861
+ 1. Let _value_ be the result of ClassDefinitionEvaluation of |ClassTail| with arguments _className_ and _className_.
19860
19862
1. ReturnIfAbrupt(_value_).
19861
- 1. Let _hasNameProperty_ be ? HasOwnProperty(_value_, `"name"`).
19862
- 1. If _hasNameProperty_ is *false*, perform SetFunctionName(_value_, _className_).
19863
19863
1. Let _env_ be the running execution context's LexicalEnvironment.
19864
19864
1. Perform ? InitializeBoundName(_className_, _value_, _env_).
19865
19865
1. Return _value_.
19866
19866
</emu-alg>
19867
19867
<emu-grammar>ClassDeclaration : `class` ClassTail</emu-grammar>
19868
19868
<emu-alg>
19869
- 1. Return the result of ClassDefinitionEvaluation of |ClassTail| with argument *undefined*.
19869
+ 1. Return the result of ClassDefinitionEvaluation of |ClassTail| with arguments *undefined* and `"default"` .
19870
19870
</emu-alg>
19871
19871
<emu-note>
19872
- <p><emu-grammar>ClassDeclaration : `class` ClassTail</emu-grammar> only occurs as part of an |ExportDeclaration| and the setting of a name property and establishing its binding are handled as part of the evaluation action for that production. See <emu-xref href="#sec-exports-runtime-semantics-evaluation"></emu-xref>.</p>
19872
+ <p><emu-grammar>ClassDeclaration : `class` ClassTail</emu-grammar> only occurs as part of an |ExportDeclaration| and establishing its binding is handled as part of the evaluation action for that production. See <emu-xref href="#sec-exports-runtime-semantics-evaluation"></emu-xref>.</p>
19873
19873
</emu-note>
19874
19874
</emu-clause>
19875
19875
@@ -19878,11 +19878,7 @@ <h1>Runtime Semantics: NamedEvaluation</h1>
19878
19878
<p>With parameter _name_.</p>
19879
19879
<emu-grammar>ClassExpression : `class` ClassTail</emu-grammar>
19880
19880
<emu-alg>
19881
- 1. Let _value_ be the result of evaluating this |ClassExpression|.
19882
- 1. Let _hasNameProperty_ be ? HasOwnProperty(_value_, `"name"`).
19883
- 1. If _hasNameProperty_ is *false*, then
19884
- 1. Perform SetFunctionName(_value_, _name_).
19885
- 1. Return _value_.
19881
+ 1. Return the result of ClassDefinitionEvaluation of |ClassTail| with arguments *undefined* and _name_.
19886
19882
</emu-alg>
19887
19883
</emu-clause>
19888
19884
@@ -19900,17 +19896,8 @@ <h1>Runtime Semantics: Evaluation</h1>
19900
19896
<emu-alg>
19901
19897
1. If |BindingIdentifier_opt| is not present, let _className_ be *undefined*.
19902
19898
1. Else, let _className_ be StringValue of |BindingIdentifier|.
19903
- 1. Let _value_ be the result of ClassDefinitionEvaluation of |ClassTail| with argument _className_.
19904
- 1. ReturnIfAbrupt(_value_).
19905
- 1. If _className_ is not *undefined*, then
19906
- 1. Let _hasNameProperty_ be ? HasOwnProperty(_value_, `"name"`).
19907
- 1. If _hasNameProperty_ is *false*, then
19908
- 1. Perform SetFunctionName(_value_, _className_).
19909
- 1. Return NormalCompletion(_value_).
19899
+ 1. Return the result of ClassDefinitionEvaluation of |ClassTail| with arguments _className_ and _className_.
19910
19900
</emu-alg>
19911
- <emu-note>
19912
- <p>If the class definition included a `name` static method then that method is not over-written with a `name` data property for the class name.</p>
19913
- </emu-note>
19914
19901
</emu-clause>
19915
19902
</emu-clause>
19916
19903
@@ -23121,8 +23108,6 @@ <h1>Runtime Semantics: Evaluation</h1>
23121
23108
1. ReturnIfAbrupt(_value_).
23122
23109
1. Let _className_ be the sole element of BoundNames of |ClassDeclaration|.
23123
23110
1. If _className_ is `"*default*"`, then
23124
- 1. Let _hasNameProperty_ be ? HasOwnProperty(_value_, `"name"`).
23125
- 1. If _hasNameProperty_ is *false*, perform SetFunctionName(_value_, `"default"`).
23126
23111
1. Let _env_ be the running execution context's LexicalEnvironment.
23127
23112
1. Perform ? InitializeBoundName(`"*default*"`, _value_, _env_).
23128
23113
1. Return NormalCompletion(~empty~).
0 commit comments