Skip to content

Commit c9246d4

Browse files
authored
Clarify object creation in named constructors (#652)
This matches the text for normal constructors. I forgot to update this algorithm in 8e1b529.
1 parent 27afa8c commit c9246d4

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

index.bs

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10724,11 +10724,10 @@ the <code>typeof</code> operator will return "function" when applied to an inter
1072410724
1. Perform the actions listed in the description of |constructor|
1072510725
with |values| as the argument values
1072610726
and |object| as the <emu-val>this</emu-val> value.
10727-
Rethrow any exceptions.
1072810727
1. Let |O| be the result of [=converted to an ECMAScript value|converting=] |object|
1072910728
to an ECMAScript [=interface type=] value |I|.
1073010729
1. Assert: |O| is an object that implements |I|.
10731-
1. Assert: |O|.\[[Realm]] is equal to |realm|.
10730+
1. Assert: |O|.\[[Realm]] is |realm|.
1073210731
1. Return |O|.
1073310732
1. Let |constructorProto| be |realm|.\[[Intrinsics]].[[{{%FunctionPrototype%}}]].
1073410733
1. If |I| inherits from some other interface |P|,
@@ -10763,10 +10762,6 @@ It allows constructing objects that
1076310762
implement the interface on which the
1076410763
[{{NamedConstructor}}] extended attributes appear.
1076510764

10766-
If the actions listed in the description of the constructor return normally,
10767-
then those steps must return an object that implements interface |I|.
10768-
This object's relevant [=Realm=] must be the same as that of the [=named constructor=].
10769-
1077010765
<div algorithm>
1077110766

1077210767
The [=named constructor=] with [=NamedConstructor identifier|identifier=] |id|
@@ -10783,10 +10778,17 @@ This object's relevant [=Realm=] must be the same as that of the [=named constru
1078310778
and with argument count |n|.
1078410779
1. Let &lt;|constructor|, |values|&gt; be the result of passing |S| and
1078510780
|args| to the [=overload resolution algorithm=].
10786-
1. Let |R| be the result of performing the actions listed in the description of
10787-
|constructor| with |values| as the argument values.
10788-
1. Return the result of [=converted to an ECMAScript value|converting=]
10789-
|R| to an ECMAScript [=interface type=] value |I|.
10781+
1. Let |object| be the result of [=internally create a new object implementing the
10782+
interface|internally creating a new object implementing=] |I|, with |realm| and
10783+
{{NewTarget}}.
10784+
1. Perform the actions listed in the description of |constructor|
10785+
with |values| as the argument values
10786+
and |object| as the <emu-val>this</emu-val> value.
10787+
1. Let |O| be the result of [=converted to an ECMAScript value|converting=] |object|
10788+
to an ECMAScript [=interface type=] value |I|.
10789+
1. Assert: |O| is an object that implements |I|.
10790+
1. Assert: |O|.\[[Realm]] is |realm|.
10791+
1. Return |O|.
1079010792
1. Let |F| be [=!=] <a abstract-op>CreateBuiltinFunction</a>(|steps|, « », |realm|).
1079110793
1. Perform [=!=] <a abstract-op>SetFunctionName</a>(|F|, |id|).
1079210794
1. Initialize |S| to the [=effective overload set=]

0 commit comments

Comments
 (0)