Skip to content

Commit 5f4628a

Browse files
committed
fixup! Use the new algorithm to create DOMExceptions.
1 parent 3e4a2d6 commit 5f4628a

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

index.bs

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12366,14 +12366,21 @@ object is associated with.
1236612366
<div algorithm>
1236712367
To <dfn export lt="new|create|create a new|create an object implementing|create an object
1236812368
implementing the interface">create an object implementing the interface</dfn> |interface| in the
12369-
Realm |realm|, perform the following steps:
12369+
Realm |realm|, with optional `new.target` value |newTarget|, perform the following steps:
1237012370

1237112371
1. Assert: |interface| is [=exposed=] in |realm|.
12372+
1. Let prototype be the [=interface prototype object=] for |interface| in
12373+
|realm|.
12374+
1. If |newTarget| is provided, then:
12375+
1. Issue: If we just pass {{NewTarget}} through in a constructor, would this not
12376+
always be defined (sometimes to the [=interface object=] itself)?
12377+
1. Let |newTargetPrototype| be [=?=] [$Get$](|newTarget|, "prototype").
12378+
1. If [$Type$](|newTargetPrototype|) is Object, then set |prototype| to
12379+
|newTargetPrototype|.
1237212380
1. Let |instance| be a newly created [=ECMAScript/object=] in |realm|.
12381+
1. Set |instance|.\[[Prototype]] to |prototype|.
1237312382
1. Set |instance|'s essential internal methods to the definitions specified in
1237412383
[=ECMA-262 Ordinary object internal methods and internal slots=].
12375-
1. Set |instance|.\[[Prototype]] to the [=interface prototype object=] for |interface| in
12376-
|realm|.
1237712384
1. Let |interfaces| be the [=inclusive inherited interfaces=] of |interface|.
1237812385
1. [=list/iterate|For every=] [=interface=] |ancestor interface| in |interfaces|:
1237912386
1. [=Define the unforgeable regular operations=] of |ancestor interface| on |instance|,
@@ -12402,12 +12409,14 @@ object is associated with.
1240212409
1. Return |instance|.
1240312410
</div>
1240412411

12412+
<div class="note">
12413+
Specifications may refer to the "[=create an object implementing the
12414+
interface=]" algorithm in various ways, including "a new |interface| object".
12415+
</div>
12416+
1240512417
The <dfn id="dfn-primary-interface" export>primary interface</dfn> of a platform object
1240612418
that implements one or more interfaces is the most-derived [=interface=]
12407-
that it implements. The value of the \[[Prototype]] [=internal slot=]
12408-
of the platform object is the [=interface prototype object=]
12409-
of the [=primary interface=]
12410-
from the [=platform object=]’s associated global environment.
12419+
that it implements.
1241112420

1241212421
The global environment that a given [=platform object=]
1241312422
is associated with can <dfn id="dfn-change-global-environment" for="global environment" export>change</dfn> after it has been created. When
@@ -13360,7 +13369,7 @@ Each {{DOMException}} object has an associated <dfn for="DOMException">name</dfn
1336013369
The <dfn constructor for="DOMException"><code>DOMException(|message|, |name|)</code></dfn>
1336113370
constructor, when invoked, must run these steps:
1336213371

13363-
1. Let |e| be a [=new=] {{DOMException}} object in {{NewTarget}}'s Realm.
13372+
1. Let |e| be a [=new=] {{DOMException}} object in {{NewTarget}}'s Realm, with {{NewTarget}}.
1336413373
1. Set |e|'s [=DOMException/name=] to |name|.
1336513374
1. Set |e|'s [=DOMException/message=] to |message|.
1336613375
1. Return |e|.

0 commit comments

Comments
 (0)