@@ -12366,14 +12366,21 @@ object is associated with.
12366
12366
<div algorithm>
12367
12367
To <dfn export lt="new|create|create a new|create an object implementing|create an object
12368
12368
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:
12370
12370
12371
12371
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|.
12372
12380
1. Let |instance| be a newly created [=ECMAScript/object=] in |realm|.
12381
+ 1. Set |instance|.\[[Prototype]] to |prototype|.
12373
12382
1. Set |instance|'s essential internal methods to the definitions specified in
12374
12383
[=ECMA-262 Ordinary object internal methods and internal slots=].
12375
- 1. Set |instance|.\[[Prototype]] to the [=interface prototype object=] for |interface| in
12376
- |realm|.
12377
12384
1. Let |interfaces| be the [=inclusive inherited interfaces=] of |interface|.
12378
12385
1. [=list/iterate|For every=] [=interface=] |ancestor interface| in |interfaces|:
12379
12386
1. [=Define the unforgeable regular operations=] of |ancestor interface| on |instance|,
@@ -12402,12 +12409,14 @@ object is associated with.
12402
12409
1. Return |instance|.
12403
12410
</div>
12404
12411
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
+
12405
12417
The <dfn id="dfn-primary-interface" export>primary interface</dfn> of a platform object
12406
12418
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.
12411
12420
12412
12421
The global environment that a given [=platform object=]
12413
12422
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
13360
13369
The <dfn constructor for="DOMException"><code>DOMException(|message|, |name|)</code></dfn>
13361
13370
constructor, when invoked, must run these steps:
13362
13371
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}} .
13364
13373
1. Set |e|'s [=DOMException/name=] to |name|.
13365
13374
1. Set |e|'s [=DOMException/message=] to |message|.
13366
13375
1. Return |e|.
0 commit comments