@@ -9437,12 +9437,31 @@ for the specific requirements that the use of
9437
9437
<h4 oldids="PrimaryGlobal" id="Global" extended-attribute lt="Global">[Global]</h4>
9438
9438
9439
9439
If the [{{Global}}] [=extended attribute=] appears on an [=interface=],
9440
- it indicates that objects implementing this interface can
9441
- be used as the global object in a [=Realm=],
9442
- and that the structure of the prototype chain and how
9443
- properties corresponding to [=interface members=]
9444
- will be reflected on the prototype objects will be different from other
9445
- interfaces. Specifically:
9440
+ it indicates that objects implementing this interface will
9441
+ be used as the global object in a [=Realm=].
9442
+
9443
+ The [{{Global}}] [=extended attribute=] also defines the
9444
+ <dfn id="dfn-global-name" export>global names</dfn> for the [=interface=]:
9445
+
9446
+ <dl class="switch">
9447
+ : If the [{{Global}}] [=extended attribute=] [=takes an identifier=]
9448
+ :: « the given [=identifier=] »
9449
+ : If the [{{Global}}] [=extended attribute=] [=takes an identifier list=]
9450
+ :: the identifier list
9451
+ </dl>
9452
+
9453
+ The [{{Global}}] extended attribute must be one of the forms given above.
9454
+
9455
+ Note: The [=global names=] for the [=interface=] are the [=identifiers=] that can be used to
9456
+ reference it in the [{{Exposed}}] [=extended attribute=].
9457
+ A single name can be shared across multiple different global interfaces,
9458
+ allowing an interface to more easily use [{{Exposed}}] to expose itself to all of them at once.
9459
+ For example, "<code>Worker</code>" is used to refer to several distinct types of threading-related
9460
+ global interfaces.
9461
+
9462
+ For these global [=interfaces=], the structure of the prototype chain and how properties
9463
+ corresponding to [=interface members=] will be reflected on the prototype objects will be different
9464
+ from other interfaces. Specifically:
9446
9465
9447
9466
1. Any [=named properties=]
9448
9467
will be exposed on an object in the prototype chain – the
@@ -9524,21 +9543,6 @@ across those interfaces.
9524
9543
Note: This is because all of the [=members=] of the interface
9525
9544
get flattened down on to the object that [=implements=] the interface.
9526
9545
9527
- The [{{Global}}] extended attribute
9528
- can also be used to give a name to one or more global interfaces,
9529
- which can then be referenced by the [{{Exposed}}]
9530
- extended attribute.
9531
-
9532
- The [{{Global}}] extended attribute must either
9533
- [=takes an identifier|take an identifier=] or
9534
- [=takes an identifier list|take an identifier list=].
9535
-
9536
- The identifier argument or identifier list argument the [{{Global}}] [=extended attribute=] is declared with
9537
- define the interface’s <dfn id="dfn-global-name" export>global names</dfn>.
9538
-
9539
- Note: The identifier argument list exists so that more than one global interface can
9540
- be addressed with a single name in an [{{Exposed}}] [=extended attribute=].
9541
-
9542
9546
See [[#named-properties-object]] for the specific requirements
9543
9547
that the use of [{{Global}}] entails for [=named properties=],
9544
9548
and [[#es-constants]], [[#es-attributes]] and [[#es-operations]]
0 commit comments