Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: call MakeClassConstructor on default class constructor #3212

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 5 additions & 4 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -13168,7 +13168,7 @@ <h1>ECMAScript Function Objects</h1>
a Boolean
</td>
<td>
Indicates whether the function is a class constructor. (If *true*, invoking the function's [[Call]] will immediately throw a *TypeError* exception.)
Indicates whether the function is a class constructor. This field also appears on the default class constructor. (If *true*, invoking the function's [[Call]] will immediately throw a *TypeError* exception.)
</td>
</tr>
</table>
Expand Down Expand Up @@ -13490,12 +13490,13 @@ <h1>
<emu-clause id="sec-makeclassconstructor" type="abstract operation">
<h1>
MakeClassConstructor (
_F_: an ECMAScript function object,
_F_: a function object,
): ~unused~
</h1>
<dl class="header">
</dl>
<emu-alg>
1. Assert: _F_ has a [[IsClassConstructor]] internal slot.
1. Assert: _F_.[[IsClassConstructor]] is *false*.
1. Set _F_.[[IsClassConstructor]] to *true*.
1. Return ~unused~.
Expand Down Expand Up @@ -24911,13 +24912,13 @@ <h1>
1. Let _result_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%Object.prototype%"*).
1. Perform ? InitializeInstanceElements(_result_, _F_).
1. Return _result_.
1. Let _F_ be CreateBuiltinFunction(_defaultConstructor_, 0, _className_, « [[ConstructorKind]], [[SourceText]] », the current Realm Record, _constructorParent_).
1. Let _F_ be CreateBuiltinFunction(_defaultConstructor_, 0, _className_, « [[ConstructorKind]], [[SourceText]], [[IsClassConstructor]] », the current Realm Record, _constructorParent_).
1. Else,
1. Let _constructorInfo_ be ! DefineMethod of _constructor_ with arguments _proto_ and _constructorParent_.
1. Let _F_ be _constructorInfo_.[[Closure]].
1. Perform MakeClassConstructor(_F_).
1. Perform SetFunctionName(_F_, _className_).
1. Perform MakeConstructor(_F_, *false*, _proto_).
1. Perform MakeClassConstructor(_F_).
1. If |ClassHeritage?| is present, set _F_.[[ConstructorKind]] to ~derived~.
1. Perform CreateMethodProperty(_proto_, *"constructor"*, _F_).
1. If |ClassBody?| is not present, let _elements_ be a new empty List.
Expand Down