From 977a6c4ff9ce6343364b5222a8d7de2db9a2cca1 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Thu, 23 May 2024 14:56:27 -0700 Subject: [PATCH 01/49] Editorial: Inline CreateRealm + SetRealmGlobalObject into InitializeHostDefinedRealm (#3139( ... and put the result in the "Realms" section. --- spec.html | 79 ++++++++++++++++++------------------------------------- 1 file changed, 26 insertions(+), 53 deletions(-) diff --git a/spec.html b/spec.html index 2cc6451913..98cf70b8e0 100644 --- a/spec.html +++ b/spec.html @@ -11596,18 +11596,35 @@

Realms

- -

CreateRealm ( ): a Realm Record

+ +

InitializeHostDefinedRealm ( ): either a normal completion containing ~unused~ or a throw completion

- 1. Let _realmRec_ be a new Realm Record. - 1. Perform CreateIntrinsics(_realmRec_). - 1. Set _realmRec_.[[AgentSignifier]] to AgentSignifier(). - 1. Set _realmRec_.[[GlobalObject]] to *undefined*. - 1. Set _realmRec_.[[GlobalEnv]] to *undefined*. - 1. Set _realmRec_.[[TemplateMap]] to a new empty List. - 1. Return _realmRec_. + 1. Let _realm_ be a new Realm Record. + 1. Perform CreateIntrinsics(_realm_). + 1. Set _realm_.[[AgentSignifier]] to AgentSignifier(). + 1. Set _realm_.[[GlobalObject]] to *undefined*. + 1. Set _realm_.[[GlobalEnv]] to *undefined*. + 1. Set _realm_.[[TemplateMap]] to a new empty List. + 1. Let _newContext_ be a new execution context. + 1. Set the Function of _newContext_ to *null*. + 1. Set the Realm of _newContext_ to _realm_. + 1. Set the ScriptOrModule of _newContext_ to *null*. + 1. Push _newContext_ onto the execution context stack; _newContext_ is now the running execution context. + 1. If the host requires use of an exotic object to serve as _realm_'s global object, then + 1. Let _global_ be such an object created in a host-defined manner. + 1. Else, + 1. Let _global_ be OrdinaryObjectCreate(_realm_.[[Intrinsics]].[[%Object.prototype%]]). + 1. If the host requires that the `this` binding in _realm_'s global scope return an object other than the global object, then + 1. Let _thisValue_ be such an object created in a host-defined manner. + 1. Else, + 1. Let _thisValue_ be _global_. + 1. Set _realm_.[[GlobalObject]] to _global_. + 1. Set _realm_.[[GlobalEnv]] to NewGlobalEnvironment(_global_, _thisValue_). + 1. Let _globalObj_ be ? SetDefaultGlobalBindings(_realm_). + 1. Create any host-defined global object properties on _globalObj_. + 1. Return ~unused~.
@@ -11627,29 +11644,6 @@

- -

- SetRealmGlobalObject ( - _realmRec_: a Realm Record, - _globalObj_: an Object or *undefined*, - _thisValue_: an Object or *undefined*, - ): ~unused~ -

-
-
- - 1. If _globalObj_ is *undefined*, then - 1. Let _intrinsics_ be _realmRec_.[[Intrinsics]]. - 1. Set _globalObj_ to OrdinaryObjectCreate(_intrinsics_.[[%Object.prototype%]]). - 1. Assert: _globalObj_ is an Object. - 1. If _thisValue_ is *undefined*, set _thisValue_ to _globalObj_. - 1. Set _realmRec_.[[GlobalObject]] to _globalObj_. - 1. Let _newGlobalEnv_ be NewGlobalEnvironment(_globalObj_, _thisValue_). - 1. Set _realmRec_.[[GlobalEnv]] to _newGlobalEnv_. - 1. Return ~unused~. - -
-

SetDefaultGlobalBindings ( @@ -12065,27 +12059,6 @@

- -

InitializeHostDefinedRealm ( ): either a normal completion containing ~unused~ or a throw completion

-
-
- - - 1. Let _realm_ be CreateRealm(). - 1. Let _newContext_ be a new execution context. - 1. Set the Function of _newContext_ to *null*. - 1. Set the Realm of _newContext_ to _realm_. - 1. Set the ScriptOrModule of _newContext_ to *null*. - 1. Push _newContext_ onto the execution context stack; _newContext_ is now the running execution context. - 1. If the host requires use of an exotic object to serve as _realm_'s global object, let _global_ be such an object created in a host-defined manner. Otherwise, let _global_ be *undefined*, indicating that an ordinary object should be created as the global object. - 1. If the host requires that the `this` binding in _realm_'s global scope return an object other than the global object, let _thisValue_ be such an object created in a host-defined manner. Otherwise, let _thisValue_ be *undefined*, indicating that _realm_'s global `this` binding should be the global object. - 1. Perform SetRealmGlobalObject(_realm_, _global_, _thisValue_). - 1. Let _globalObj_ be ? SetDefaultGlobalBindings(_realm_). - 1. Create any host-defined global object properties on _globalObj_. - 1. Return ~unused~. - -
-

Agents

From 052defa71cdbeae7d62cb893830446e4ae059311 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Thu, 23 May 2024 14:56:33 -0700 Subject: [PATCH 02/49] Editorial: Tweak the return of `SetDefaultGlobalBindings` (#3139) In the status quo, the value returned by SetDefaultGlobalBindings is always just the [[GlobalObject]] of the Realm Record passed in. At the only invocation of SetDefaultGlobalBindings (in InitializeHostDefinedRealm), this is `_realm_.[[GlobalObject]]`, which is just `_global_`. So use `_global_` instead of `_globalObj_` (the alias for the value returned by SetDefaultGlobalBindings), and tweak SetDefaultGlobalBindings to return ~unused~. --- spec.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec.html b/spec.html index 98cf70b8e0..1f646a4bd7 100644 --- a/spec.html +++ b/spec.html @@ -11622,8 +11622,8 @@

InitializeHostDefinedRealm ( ): either a normal completion containing ~unuse 1. Let _thisValue_ be _global_. 1. Set _realm_.[[GlobalObject]] to _global_. 1. Set _realm_.[[GlobalEnv]] to NewGlobalEnvironment(_global_, _thisValue_). - 1. Let _globalObj_ be ? SetDefaultGlobalBindings(_realm_). - 1. Create any host-defined global object properties on _globalObj_. + 1. Perform ? SetDefaultGlobalBindings(_realm_). + 1. Create any host-defined global object properties on _global_. 1. Return ~unused~. @@ -11648,7 +11648,7 @@

SetDefaultGlobalBindings ( _realmRec_: a Realm Record, - ): either a normal completion containing an Object or a throw completion + ): either a normal completion containing ~unused~ or a throw completion

@@ -11658,7 +11658,7 @@

1. Let _name_ be the String value of the property name. 1. Let _desc_ be the fully populated data Property Descriptor for the property, containing the specified attributes for the property. For properties listed in , , or the value of the [[Value]] attribute is the corresponding intrinsic object from _realmRec_. 1. Perform ? DefinePropertyOrThrow(_global_, _name_, _desc_). - 1. Return _global_. + 1. Return ~unused~. From 1babaf809575e073f07b12e4907fadae8a45b349 Mon Sep 17 00:00:00 2001 From: Shu-yu Guo Date: Thu, 23 May 2024 15:05:18 -0700 Subject: [PATCH 03/49] Editorial: Rework memory model relations (#3321) --- spec.html | 160 +++++++++++++++++++++++------------------------------- 1 file changed, 69 insertions(+), 91 deletions(-) diff --git a/spec.html b/spec.html index 1f646a4bd7..b53a6a0c3b 100644 --- a/spec.html +++ b/spec.html @@ -4022,7 +4022,7 @@

The List and Record Specification Types

The Set and Relation Specification Types

The Set type is used to explain a collection of unordered elements for use in the memory model. It is distinct from the ECMAScript collection type of the same name. To disambiguate, instances of the ECMAScript collection are consistently referred to as "Set objects" within this specification. Values of the Set type are simple collections of elements, where no element appears more than once. Elements may be added to and removed from Sets. Sets may be unioned, intersected, or subtracted from each other.

-

The Relation type is used to explain constraints on Sets. Values of the Relation type are Sets of ordered pairs of values from its value domain. For example, a Relation on events is a set of ordered pairs of events. For a Relation _R_ and two values _a_ and _b_ in the value domain of _R_, _a_ _R_ _b_ is shorthand for saying the ordered pair (_a_, _b_) is a member of _R_. A Relation is least with respect to some conditions when it is the smallest Relation that satisfies those conditions.

+

The Relation type is used to explain constraints on Sets. Values of the Relation type are Sets of ordered pairs of values from its value domain. For example, a Relation on events is a set of ordered pairs of events. For a Relation _R_ and two values _a_ and _b_ in the value domain of _R_, _a_ _R_ _b_ is shorthand for saying the ordered pair (_a_, _b_) is a member of _R_. A Relation is the least Relation with respect to some conditions when it is the smallest Relation that satisfies those conditions.

A strict partial order is a Relation value _R_ that satisfies the following.

  • @@ -48696,7 +48696,7 @@

    Memory Model Fundamentals

    In addition to Shared Data Block and Synchronize events, there are host-specific events.

    Let the range of a ReadSharedMemory, WriteSharedMemory, or ReadModifyWriteSharedMemory event be the Set of contiguous integers from its [[ByteIndex]] to [[ByteIndex]] + [[ElementSize]] - 1. Two events' ranges are equal when the events have the same [[Block]], and the ranges are element-wise equal. Two events' ranges are overlapping when the events have the same [[Block]], the ranges are not equal and their intersection is non-empty. Two events' ranges are disjoint when the events do not have the same [[Block]] or their ranges are neither equal nor overlapping.

    -

    Examples of host-specific synchronizing events that should be accounted for are: sending a SharedArrayBuffer from one agent to another (e.g., by `postMessage` in a browser), starting and stopping agents, and communicating within the agent cluster via channels other than shared memory. It is assumed those events are appended to agent-order during evaluation like the other SharedArrayBuffer events.

    +

    Examples of host-specific synchronizing events that should be accounted for are: sending a SharedArrayBuffer from one agent to another (e.g., by `postMessage` in a browser), starting and stopping agents, and communicating within the agent cluster via channels other than shared memory. For a particular execution _execution_, those events are provided by the host via the host-synchronizes-with strict partial order. Additionally, hosts can add host-specific synchronizing events to _execution_.[[EventList]] so as to participate in the is-agent-order-before Relation.

    Events are ordered within candidate executions by the relations defined below.

    @@ -48774,40 +48774,10 @@

    Candidate Executions

    a List of Chosen Value Records Maps ReadSharedMemory or ReadModifyWriteSharedMemory events to the List of byte values chosen during the evaluation. - - [[AgentOrder]] - an agent-order Relation - Defined below. - - - [[ReadsBytesFrom]] - a reads-bytes-from mathematical function - Defined below. - - - [[ReadsFrom]] - a reads-from Relation - Defined below. - - - [[HostSynchronizesWith]] - a host-synchronizes-with Relation - Defined below. - - - [[SynchronizesWith]] - a synchronizes-with Relation - Defined below. - - - [[HappensBefore]] - a happens-before Relation - Defined below. - -

    An empty candidate execution is a candidate execution Record whose fields are empty Lists and Relations.

    +

    An empty candidate execution is a candidate execution Record whose fields are empty Lists.

    @@ -48907,7 +48877,7 @@

    - 1. Let _Ws_ be _execution_.[[ReadsBytesFrom]](_R_). + 1. Let _Ws_ be reads-bytes-from(_R_) in _execution_. 1. Assert: _Ws_ is a List of WriteSharedMemory or ReadModifyWriteSharedMemory events with length equal to _R_.[[ElementSize]]. 1. Return ComposeWriteEventBytes(_execution_, _R_.[[ByteIndex]], _Ws_). @@ -48917,11 +48887,13 @@

    Relations of Candidate Executions

    - -

    agent-order

    -

    For a candidate execution _execution_, _execution_.[[AgentOrder]] is a Relation on events that satisfies the following.

    +

    The following relations and mathematical functions are parameterized over a particular candidate execution and order its events.

    + + +

    is-agent-order-before

    +

    For a candidate execution _execution_, its is-agent-order-before Relation is the least Relation on events that satisfies the following.

      -
    • For each pair (_E_, _D_) in EventSet(_execution_), _execution_.[[AgentOrder]] contains (_E_, _D_) if there is some Agent Events Record _aer_ in _execution_.[[EventsRecords]] such that _E_ and _D_ are in _aer_.[[EventList]] and _E_ is before _D_ in List order of _aer_.[[EventList]].
    • +
    • For events _E_ and _D_, _E_ is-agent-order-before _D_ in _execution_ if there is some Agent Events Record _aer_ in _execution_.[[EventsRecords]] such that _aer_.[[EventList]] contains both _E_ and _D_ and _E_ is before _D_ in List order of _aer_.[[EventList]].
    @@ -48931,88 +48903,94 @@

    agent-order

    reads-bytes-from

    -

    For a candidate execution _execution_, _execution_.[[ReadsBytesFrom]] is a mathematical function mapping events in SharedDataBlockEventSet(_execution_) to Lists of events in SharedDataBlockEventSet(_execution_) that satisfies the following conditions.

    +

    For a candidate execution _execution_, its reads-bytes-from function is a mathematical function mapping events in SharedDataBlockEventSet(_execution_) to Lists of events in SharedDataBlockEventSet(_execution_) that satisfies the following conditions.

    • -

      For each ReadSharedMemory or ReadModifyWriteSharedMemory event _R_ in SharedDataBlockEventSet(_execution_), _execution_.[[ReadsBytesFrom]](_R_) is a List of length _R_.[[ElementSize]] whose elements are WriteSharedMemory or ReadModifyWriteSharedMemory events _Ws_ such that all of the following are true.

      +

      For each ReadSharedMemory or ReadModifyWriteSharedMemory event _R_ in SharedDataBlockEventSet(_execution_), reads-bytes-from(_R_) in _execution_ is a List of length _R_.[[ElementSize]] whose elements are WriteSharedMemory or ReadModifyWriteSharedMemory events _Ws_ such that all of the following are true.

      • Each event _W_ with index _i_ in _Ws_ has _R_.[[ByteIndex]] + _i_ in its range.
      • _R_ is not in _Ws_.
    +

    A candidate execution always admits a reads-bytes-from function.

    - +

    reads-from

    -

    For a candidate execution _execution_, _execution_.[[ReadsFrom]] is the least Relation on events that satisfies the following.

    +

    For a candidate execution _execution_, its reads-from Relation is the least Relation on events that satisfies the following.

      -
    • For each pair (_R_, _W_) in SharedDataBlockEventSet(_execution_), _execution_.[[ReadsFrom]] contains (_R_, _W_) if _execution_.[[ReadsBytesFrom]](_R_) contains _W_.
    • +
    • For events _R_ and _W_, _R_ reads-from _W_ in _execution_ if SharedDataBlockEventSet(_execution_) contains both _R_ and _W_, and reads-bytes-from(_R_) in _execution_ contains _W_.
    - +

    host-synchronizes-with

    -

    For a candidate execution _execution_, _execution_.[[HostSynchronizesWith]] is a host-provided strict partial order on host-specific events that satisfies at least the following.

    +

    For a candidate execution _execution_, its host-synchronizes-with Relation is a host-provided strict partial order on host-specific events that satisfies at least the following.

      -
    • If _execution_.[[HostSynchronizesWith]] contains (_E_, _D_), _E_ and _D_ are in HostEventSet(_execution_).
    • -
    • There is no cycle in the union of _execution_.[[HostSynchronizesWith]] and _execution_.[[AgentOrder]].
    • +
    • If _E_ host-synchronizes-with _D_ in _execution_, HostEventSet(_execution_) contains _E_ and _D_.
    • +
    • There is no cycle in the union of host-synchronizes-with and is-agent-order-before in _execution_.
    -

    For two host-specific events _E_ and _D_, _E_ host-synchronizes-with _D_ implies _E_ happens-before _D_.

    +

    For two host-specific events _E_ and _D_ in a candidate execution _execution_, _E_ host-synchronizes-with _D_ in _execution_ implies _E_ happens-before _D_ in _execution_.

    -

    The host-synchronizes-with relation allows the host to provide additional synchronization mechanisms, such as `postMessage` between HTML workers.

    +

    This Relation allows the host to provide additional synchronization mechanisms, such as `postMessage` between HTML workers.

    - +

    synchronizes-with

    -

    For a candidate execution _execution_, _execution_.[[SynchronizesWith]] is the least Relation on events that satisfies the following.

    +

    For a candidate execution _execution_, its synchronizes-with Relation is the least Relation on events that satisfies the following.

    • - For each pair (_R_, _W_) in _execution_.[[ReadsFrom]], _execution_.[[SynchronizesWith]] contains (_W_, _R_) if _R_.[[Order]] is ~seq-cst~, _W_.[[Order]] is ~seq-cst~, and _R_ and _W_ have equal ranges. + For events _R_ and _W_, _W_ synchronizes-with _R_ in _execution_ if _R_ reads-from _W_ in _execution_, _R_.[[Order]] is ~seq-cst~, _W_.[[Order]] is ~seq-cst~, and _R_ and _W_ have equal ranges.
    • For each element _eventsRecord_ of _execution_.[[EventsRecords]], the following is true.
        -
      • For each pair (_S_, _Sw_) in _eventsRecord_.[[AgentSynchronizesWith]], _execution_.[[SynchronizesWith]] contains (_S_, _Sw_).
      • +
      • For events _S_ and _Sw_, _S_ synchronizes-with _Sw_ in _execution_ if _eventsRecord_.[[AgentSynchronizesWith]] contains (_S_, _Sw_).
    • -
    • For each pair (_E_, _D_) in _execution_.[[HostSynchronizesWith]], _execution_.[[SynchronizesWith]] contains (_E_, _D_).
    • +
    • For events _E_ and _D_, _E_ synchronizes-with _D_ in _execution_ if _execution_.[[HostSynchronizesWith]] contains (_E_, _D_).
    -

    Owing to convention, write events synchronizes-with read events, instead of read events synchronizes-with write events.

    +

    Owing to convention in memory model literature, in a candidate execution _execution_, write events synchronizes-with read events, instead of read events synchronizes-with write events.

    -

    ~init~ events do not participate in synchronizes-with, and are instead constrained directly by happens-before.

    +

    In a candidate execution _execution_, ~init~ events do not participate in this Relation and are instead constrained directly by happens-before.

    -

    Not all ~seq-cst~ events related by reads-from are related by synchronizes-with. Only events that also have equal ranges are related by synchronizes-with.

    +

    In a candidate execution _execution_, not all ~seq-cst~ events related by reads-from are related by synchronizes-with. Only events that also have equal ranges are related by synchronizes-with.

    -

    For Shared Data Block events _R_ and _W_ such that _W_ synchronizes-with _R_, _R_ may reads-from other writes than _W_.

    +

    For Shared Data Block events _R_ and _W_ in a candidate execution _execution_ such that _W_ synchronizes-with _R_, _R_ may reads-from other writes than _W_.

    - +

    happens-before

    -

    For a candidate execution _execution_, _execution_.[[HappensBefore]] is the least Relation on events that satisfies the following.

    +

    For a candidate execution _execution_, its happens-before Relation is the least Relation on events that satisfies the following.

      -
    • For each pair (_E_, _D_) in _execution_.[[AgentOrder]], _execution_.[[HappensBefore]] contains (_E_, _D_).
    • -
    • For each pair (_E_, _D_) in _execution_.[[SynchronizesWith]], _execution_.[[HappensBefore]] contains (_E_, _D_).
    • -
    • For each pair (_E_, _D_) in SharedDataBlockEventSet(_execution_), _execution_.[[HappensBefore]] contains (_E_, _D_) if _E_.[[Order]] is ~init~ and _E_ and _D_ have overlapping ranges.
    • -
    • For each pair (_E_, _D_) in EventSet(_execution_), _execution_.[[HappensBefore]] contains (_E_, _D_) if there is an event _F_ such that the pairs (_E_, _F_) and (_F_, _D_) are in _execution_.[[HappensBefore]].
    • +
    • +

      For events _E_ and _D_, _E_ happens-before _D_ in _execution_ if any of the following conditions are true.

      +
        +
      • _E_ is-agent-order-before _D_ in _execution_.
      • +
      • _E_ synchronizes-with _D_ in _execution_.
      • +
      • SharedDataBlockEventSet(_execution_) contains both _E_ and _D_, _E_.[[Order]] is ~init~, and _E_ and _D_ have overlapping ranges.
      • +
      • There is an event _F_ such that _E_ happens-before _F_ and _F_ happens-before _D_ in _execution_.
      • +
      +
    -

    Because happens-before is a superset of agent-order, candidate executions are consistent with the single-thread evaluation semantics of ECMAScript.

    +

    Because happens-before is a superset of agent-order, a candidate execution is consistent with the single-thread evaluation semantics of ECMAScript.

    @@ -49043,12 +49021,12 @@

    Coherent Reads

    A candidate execution _execution_ has coherent reads if the following algorithm returns *true*.

    1. For each ReadSharedMemory or ReadModifyWriteSharedMemory event _R_ of SharedDataBlockEventSet(_execution_), do - 1. Let _Ws_ be _execution_.[[ReadsBytesFrom]](_R_). + 1. Let _Ws_ be reads-bytes-from(_R_) in _execution_. 1. Let _byteLocation_ be _R_.[[ByteIndex]]. 1. For each element _W_ of _Ws_, do - 1. If _execution_.[[HappensBefore]] contains (_R_, _W_), then + 1. If _R_ happens-before _W_ in _execution_, then 1. Return *false*. - 1. If there exists a WriteSharedMemory or ReadModifyWriteSharedMemory event _V_ that has _byteLocation_ in its range such that the pairs (_W_, _V_) and (_V_, _R_) are in _execution_.[[HappensBefore]], then + 1. If there exists a WriteSharedMemory or ReadModifyWriteSharedMemory event _V_ that has _byteLocation_ in its range such that _W_ happens-before _V_ in _execution_ and _V_ happens-before _R_ in _execution_, then 1. Return *false*. 1. Set _byteLocation_ to _byteLocation_ + 1. 1. Return *true*. @@ -49062,8 +49040,8 @@

    Tear Free Reads

    1. For each ReadSharedMemory or ReadModifyWriteSharedMemory event _R_ of SharedDataBlockEventSet(_execution_), do 1. If _R_.[[NoTear]] is *true*, then 1. Assert: The remainder of dividing _R_.[[ByteIndex]] by _R_.[[ElementSize]] is 0. - 1. For each event _W_ such that _execution_.[[ReadsFrom]] contains (_R_, _W_) and _W_.[[NoTear]] is *true*, do - 1. If _R_ and _W_ have equal ranges and there exists an event _V_ such that _V_ and _W_ have equal ranges, _V_.[[NoTear]] is *true*, _W_ and _V_ are not the same Shared Data Block event, and _execution_.[[ReadsFrom]] contains (_R_, _V_), then + 1. For each event _W_ such that _R_ reads-from _W_ in _execution_ and _W_.[[NoTear]] is *true*, do + 1. If _R_ and _W_ have equal ranges and there exists an event _V_ such that _V_ and _W_ have equal ranges, _V_.[[NoTear]] is *true*, _W_ and _V_ are not the same Shared Data Block event, and _R_ reads-from _V_ in _execution_, then 1. Return *false*. 1. Return *true*.
    @@ -49074,17 +49052,17 @@

    Tear Free Reads

    - +

    Sequentially Consistent Atomics

    -

    For a candidate execution _execution_, memory-order is a strict total order of all events in EventSet(_execution_) that satisfies the following.

    +

    For a candidate execution _execution_, is-memory-order-before is a strict total order of all events in EventSet(_execution_) that satisfies the following.

      -
    • For each pair (_E_, _D_) in _execution_.[[HappensBefore]], (_E_, _D_) is in memory-order.
    • +
    • For events _E_ and _D_, _E_ is-memory-order-before _D_ in _execution_ if _E_ happens-before _D_ in _execution_.
    • -

      For each pair (_R_, _W_) in _execution_.[[ReadsFrom]], there is no WriteSharedMemory or ReadModifyWriteSharedMemory event _V_ in SharedDataBlockEventSet(_execution_) such that _V_.[[Order]] is ~seq-cst~, the pairs (_W_, _V_) and (_V_, _R_) are in memory-order, and any of the following conditions are true.

      +

      For events _R_ and _W_ such that _R_ reads-from _W_ in _execution_, there is no WriteSharedMemory or ReadModifyWriteSharedMemory event _V_ in SharedDataBlockEventSet(_execution_) such that _V_.[[Order]] is ~seq-cst~, _W_ is-memory-order-before _V_ in _execution_, _V_ is-memory-order-before _R_ in _execution_, and any of the following conditions are true.

        -
      • _execution_.[[SynchronizesWith]] contains the pair (_W_, _R_), and _V_ and _R_ have equal ranges.
      • -
      • The pairs (_W_, _R_) and (_V_, _R_) are in _execution_.[[HappensBefore]], _W_.[[Order]] is ~seq-cst~, and _W_ and _V_ have equal ranges.
      • -
      • The pairs (_W_, _R_) and (_W_, _V_) are in _execution_.[[HappensBefore]], _R_.[[Order]] is ~seq-cst~, and _V_ and _R_ have equal ranges.
      • +
      • _W_ synchronizes-with _R_ in _execution_, and _V_ and _R_ have equal ranges.
      • +
      • _W_ happens-before _R_ and _V_ happens-before _R_ in _execution_, _W_.[[Order]] is ~seq-cst~, and _W_ and _V_ have equal ranges.
      • +
      • _W_ happens-before _R_ and _W_ happens-before _V_ in _execution_, _R_.[[Order]] is ~seq-cst~, and _V_ and _R_ have equal ranges.

      This clause additionally constrains ~seq-cst~ events on equal ranges.

      @@ -49097,10 +49075,10 @@

      Sequentially Consistent Atomics

    -

    A candidate execution has sequentially consistent atomics if a memory-order exists.

    +

    A candidate execution has sequentially consistent atomics if it admits an is-memory-order-before Relation.

    -

    While memory-order includes all events in EventSet(_execution_), those that are not constrained by happens-before or synchronizes-with are allowed to occur anywhere in the order.

    +

    While is-memory-order-before includes all events in EventSet(_execution_), those that are not constrained by happens-before or synchronizes-with in _execution_ are allowed to occur anywhere in the order.

    @@ -49108,8 +49086,8 @@

    Sequentially Consistent Atomics

    Valid Executions

    A candidate execution _execution_ is a valid execution (or simply an execution) if all of the following are true.

      -
    • The host provides a host-synchronizes-with Relation for _execution_.[[HostSynchronizesWith]].
    • -
    • _execution_.[[HappensBefore]] is a strict partial order.
    • +
    • The host provides a host-synchronizes-with Relation for _execution_.
    • +
    • _execution_ admits a happens-before Relation that is a strict partial order.
    • _execution_ has valid chosen reads.
    • _execution_ has coherent reads.
    • _execution_ has tear free reads.
    • @@ -49121,13 +49099,13 @@

      Valid Executions

      Races

      -

      For an execution _execution_, two events _E_ and _D_ in SharedDataBlockEventSet(_execution_) are in a race if the following algorithm returns *true*.

      +

      For an execution _execution_ and events _E_ and _D_ that are contained in SharedDataBlockEventSet(_execution_), _E_ and _D_ are in a race if the following algorithm returns *true*.

      1. If _E_ and _D_ are not the same Shared Data Block event, then - 1. If the pairs (_E_, _D_) and (_D_, _E_) are not in _execution_.[[HappensBefore]], then + 1. If it is not the case that both _E_ happens-before _D_ in _execution_ and _D_ happens-before _E_ in _execution_, then 1. If _E_ and _D_ are both WriteSharedMemory or ReadModifyWriteSharedMemory events and _E_ and _D_ do not have disjoint ranges, then 1. Return *true*. - 1. If _execution_.[[ReadsFrom]] contains either (_E_, _D_) or (_D_, _E_), then + 1. If _E_ reads-from _D_ in _execution_ or _D_ reads-from _E_ in _execution_, then 1. Return *true*. 1. Return *false*. @@ -49135,9 +49113,9 @@

      Races

      Data Races

      -

      For an execution _execution_, two events _E_ and _D_ in SharedDataBlockEventSet(_execution_) are in a data race if the following algorithm returns *true*.

      +

      For an execution _execution_ and events _E_ and _D_ that are contained in SharedDataBlockEventSet(_execution_), _E_ and _D_ are in a data race if the following algorithm returns *true*.

      - 1. If _E_ and _D_ are in a race in _execution_, then + 1. If _E_ and _D_ are in a race in _execution_, then 1. If _E_.[[Order]] is not ~seq-cst~ or _D_.[[Order]] is not ~seq-cst~, then 1. Return *true*. 1. If _E_ and _D_ have overlapping ranges, then @@ -49148,7 +49126,7 @@

      Data Races

      Data Race Freedom

      -

      An execution _execution_ is data race free if there are no two events in SharedDataBlockEventSet(_execution_) that are in a data race.

      +

      An execution _execution_ is data race free if there are no two events in SharedDataBlockEventSet(_execution_) that are in a data race.

      A program is data race free if all its executions are data race free.

      The memory model guarantees sequential consistency of all events for data race free programs.

      @@ -49163,14 +49141,14 @@

      Shared Memory Guidelines

      The following are guidelines for ECMAScript implementers writing compiler transformations for programs using shared memory.

      -

      It is desirable to allow most program transformations that are valid in a single-agent setting in a multi-agent setting, to ensure that the performance of each agent in a multi-agent program is as good as it would be in a single-agent setting. Frequently these transformations are hard to judge. We outline some rules about program transformations that are intended to be taken as normative (in that they are implied by the memory model or stronger than what the memory model implies) but which are likely not exhaustive. These rules are intended to apply to program transformations that precede the introductions of the events that make up the agent-order.

      -

      Let an agent-order slice be the subset of the agent-order pertaining to a single agent.

      +

      It is desirable to allow most program transformations that are valid in a single-agent setting in a multi-agent setting, to ensure that the performance of each agent in a multi-agent program is as good as it would be in a single-agent setting. Frequently these transformations are hard to judge. We outline some rules about program transformations that are intended to be taken as normative (in that they are implied by the memory model or stronger than what the memory model implies) but which are likely not exhaustive. These rules are intended to apply to program transformations that precede the introductions of the events that make up the is-agent-order-before Relation.

      +

      Let an agent-order slice be the subset of the is-agent-order-before Relation pertaining to a single agent.

      Let possible read values of a read event be the set of all values of ValueOfReadEvent for that event across all valid executions.

      Any transformation of an agent-order slice that is valid in the absence of shared memory is valid in the presence of shared memory, with the following exceptions.

      • -

        Atomics are carved in stone: Program transformations must not cause the ~seq-cst~ events in an agent-order slice to be reordered with its ~unordered~ operations, nor its ~seq-cst~ operations to be reordered with each other, nor may a program transformation remove a ~seq-cst~ operation from the agent-order.

        -

        (In practice, the prohibition on reorderings forces a compiler to assume that every ~seq-cst~ operation is a synchronization and included in the final memory-order, which it would usually have to assume anyway in the absence of inter-agent program analysis. It also forces the compiler to assume that every call where the callee's effects on the memory-order are unknown may contain ~seq-cst~ operations.)

        +

        Atomics are carved in stone: Program transformations must not cause the ~seq-cst~ events in an agent-order slice to be reordered with its ~unordered~ operations, nor its ~seq-cst~ operations to be reordered with each other, nor may a program transformation remove a ~seq-cst~ operation from the is-agent-order-before Relation.

        +

        (In practice, the prohibition on reorderings forces a compiler to assume that every ~seq-cst~ operation is a synchronization and included in the final is-memory-order-before Relation, which it would usually have to assume anyway in the absence of inter-agent program analysis. It also forces the compiler to assume that every call where the callee's effects on the memory-order are unknown may contain ~seq-cst~ operations.)

      • Reads must be stable: Any given shared memory read must only observe a single value in an execution.

        From c305c1117e5c435f16107dbfbdc4aa39587c069c Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Thu, 23 May 2024 15:09:24 -0700 Subject: [PATCH 04/49] Editorial: remove some "are both" usages (#3330) --- spec.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec.html b/spec.html index b53a6a0c3b..211b060666 100644 --- a/spec.html +++ b/spec.html @@ -20459,7 +20459,7 @@

        Runtime Semantics: Evaluation

        1. If |LeftHandSideExpression| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then 1. Let _lref_ be ? Evaluation of |LeftHandSideExpression|. - 1. If IsAnonymousFunctionDefinition(|AssignmentExpression|) and IsIdentifierRef of |LeftHandSideExpression| are both *true*, then + 1. If IsAnonymousFunctionDefinition(|AssignmentExpression|) is *true* and IsIdentifierRef of |LeftHandSideExpression| is *true*, then 1. Let _rval_ be ? NamedEvaluation of |AssignmentExpression| with argument _lref_.[[ReferencedName]]. 1. Else, 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. @@ -20950,7 +20950,7 @@

        1. Let _lref_ be ? Evaluation of |DestructuringAssignmentTarget|. 1. Let _v_ be ? GetV(_value_, _propertyName_). 1. If |Initializer| is present and _v_ is *undefined*, then - 1. If IsAnonymousFunctionDefinition(|Initializer|) and IsIdentifierRef of |DestructuringAssignmentTarget| are both *true*, then + 1. If IsAnonymousFunctionDefinition(|Initializer|) is *true* and IsIdentifierRef of |DestructuringAssignmentTarget| is *true*, then 1. Let _rhsValue_ be ? NamedEvaluation of |Initializer| with argument _lref_.[[ReferencedName]]. 1. Else, 1. Let _defaultValue_ be ? Evaluation of |Initializer|. From 6e70429fa163207ab1ff9bbb6018108cdc00e26c Mon Sep 17 00:00:00 2001 From: Ross Kirsling Date: Thu, 30 May 2024 16:19:31 -0700 Subject: [PATCH 05/49] Normative: Allow [[ReferencedName]] in Reference Records to be a not-yet-resolved property key (#3307) --- spec.html | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/spec.html b/spec.html index 211b060666..7f233fd669 100644 --- a/spec.html +++ b/spec.html @@ -4163,7 +4163,7 @@

        The Reference Record Specification Type

        The Reference Record type is used to explain the behaviour of such operators as `delete`, `typeof`, the assignment operators, the `super` keyword and other language features. For example, the left-hand operand of an assignment is expected to produce a Reference Record.

        -

        A Reference Record is a resolved name or property binding; its fields are defined by .

        +

        A Reference Record is a resolved name or (possibly not-yet-resolved) property binding; its fields are defined by .

        @@ -4179,8 +4179,8 @@

        The Reference Record Specification Type

        - - + + @@ -4265,6 +4265,8 @@

        1. [id="step-getvalue-toobject"] Let _baseObj_ be ? ToObject(_V_.[[Base]]). 1. If IsPrivateReference(_V_) is *true*, then 1. Return ? PrivateGet(_baseObj_, _V_.[[ReferencedName]]). + 1. If _V_.[[ReferencedName]] is not a property key, then + 1. Set _V_.[[ReferencedName]] to ? ToPropertyKey(_V_.[[ReferencedName]]). 1. Return ? _baseObj_.[[Get]](_V_.[[ReferencedName]], GetThisValue(_V_)). 1. Else, 1. Let _base_ be _V_.[[Base]]. @@ -4296,6 +4298,8 @@

        1. [id="step-putvalue-toobject"] Let _baseObj_ be ? ToObject(_V_.[[Base]]). 1. If IsPrivateReference(_V_) is *true*, then 1. Return ? PrivateSet(_baseObj_, _V_.[[ReferencedName]], _W_). + 1. If _V_.[[ReferencedName]] is not a property key, then + 1. Set _V_.[[ReferencedName]] to ? ToPropertyKey(_V_.[[ReferencedName]]). 1. Let _succeeded_ be ? _baseObj_.[[Set]](_V_.[[ReferencedName]], _W_, GetThisValue(_V_)). 1. If _succeeded_ is *false* and _V_.[[Strict]] is *true*, throw a *TypeError* exception. 1. Return ~unused~. @@ -19106,8 +19110,8 @@

        1. Let _propertyNameReference_ be ? Evaluation of _expression_. 1. Let _propertyNameValue_ be ? GetValue(_propertyNameReference_). - 1. Let _propertyKey_ be ? ToPropertyKey(_propertyNameValue_). - 1. Return the Reference Record { [[Base]]: _baseValue_, [[ReferencedName]]: _propertyKey_, [[Strict]]: _strict_, [[ThisValue]]: ~empty~ }. + 1. NOTE: In most cases, ToPropertyKey will be performed on _propertyNameValue_ immediately after this step. However, in the case of `a[b] = c`, it will not be performed until after evaluation of `c`. + 1. Return the Reference Record { [[Base]]: _baseValue_, [[ReferencedName]]: _propertyNameValue_, [[Strict]]: _strict_, [[ThisValue]]: ~empty~ }. @@ -19239,9 +19243,9 @@

        Runtime Semantics: Evaluation

        1. Let _actualThis_ be ? _env_.GetThisBinding(). 1. Let _propertyNameReference_ be ? Evaluation of |Expression|. 1. Let _propertyNameValue_ be ? GetValue(_propertyNameReference_). - 1. Let _propertyKey_ be ? ToPropertyKey(_propertyNameValue_). 1. Let _strict_ be IsStrict(this |SuperProperty|). - 1. Return ? MakeSuperPropertyReference(_actualThis_, _propertyKey_, _strict_). + 1. NOTE: In most cases, ToPropertyKey will be performed on _propertyNameValue_ immediately after this step. However, in the case of `super[b] = c`, it will not be performed until after evaluation of `c`. + 1. Return ? MakeSuperPropertyReference(_actualThis_, _propertyNameValue_, _strict_). SuperProperty : `super` `.` IdentifierName @@ -19286,7 +19290,7 @@

        GetSuperConstructor ( ): an ECMAScript language value

        MakeSuperPropertyReference ( _actualThis_: an ECMAScript language value, - _propertyKey_: a property key, + _propertyKey_: an ECMAScript language value, _strict_: a Boolean, ): either a normal completion containing a Super Reference Record or a throw completion

        @@ -19800,6 +19804,8 @@

        Runtime Semantics: Evaluation

        1. Assert: IsPrivateReference(_ref_) is *false*. 1. If IsSuperReference(_ref_) is *true*, throw a *ReferenceError* exception. 1. [id="step-delete-operator-toobject"] Let _baseObj_ be ? ToObject(_ref_.[[Base]]). + 1. If _ref_.[[ReferencedName]] is not a property key, then + 1. Set _ref_.[[ReferencedName]] to ? ToPropertyKey(_ref_.[[ReferencedName]]). 1. Let _deleteStatus_ be ? _baseObj_.[[Delete]](_ref_.[[ReferencedName]]). 1. If _deleteStatus_ is *false* and _ref_.[[Strict]] is *true*, throw a *TypeError* exception. 1. Return _deleteStatus_. @@ -20460,7 +20466,8 @@

        Runtime Semantics: Evaluation

        1. If |LeftHandSideExpression| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then 1. Let _lref_ be ? Evaluation of |LeftHandSideExpression|. 1. If IsAnonymousFunctionDefinition(|AssignmentExpression|) is *true* and IsIdentifierRef of |LeftHandSideExpression| is *true*, then - 1. Let _rval_ be ? NamedEvaluation of |AssignmentExpression| with argument _lref_.[[ReferencedName]]. + 1. Let _lhs_ be the StringValue of |LeftHandSideExpression|. + 1. Let _rval_ be ? NamedEvaluation of |AssignmentExpression| with argument _lhs_. 1. Else, 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. 1. Let _rval_ be ? GetValue(_rref_). @@ -20509,7 +20516,8 @@

        Runtime Semantics: Evaluation

        1. Let _lbool_ be ToBoolean(_lval_). 1. If _lbool_ is *false*, return _lval_. 1. If IsAnonymousFunctionDefinition(|AssignmentExpression|) is *true* and IsIdentifierRef of |LeftHandSideExpression| is *true*, then - 1. Let _rval_ be ? NamedEvaluation of |AssignmentExpression| with argument _lref_.[[ReferencedName]]. + 1. Let _lhs_ be the StringValue of |LeftHandSideExpression|. + 1. Let _rval_ be ? NamedEvaluation of |AssignmentExpression| with argument _lhs_. 1. Else, 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. 1. Let _rval_ be ? GetValue(_rref_). @@ -20523,7 +20531,8 @@

        Runtime Semantics: Evaluation

        1. Let _lbool_ be ToBoolean(_lval_). 1. If _lbool_ is *true*, return _lval_. 1. If IsAnonymousFunctionDefinition(|AssignmentExpression|) is *true* and IsIdentifierRef of |LeftHandSideExpression| is *true*, then - 1. Let _rval_ be ? NamedEvaluation of |AssignmentExpression| with argument _lref_.[[ReferencedName]]. + 1. Let _lhs_ be the StringValue of |LeftHandSideExpression|. + 1. Let _rval_ be ? NamedEvaluation of |AssignmentExpression| with argument _lhs_. 1. Else, 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. 1. Let _rval_ be ? GetValue(_rref_). @@ -20536,7 +20545,8 @@

        Runtime Semantics: Evaluation

        1. [id="step-assignmentexpression-evaluation-lgcl-nullish-getvalue"] Let _lval_ be ? GetValue(_lref_). 1. If _lval_ is neither *undefined* nor *null*, return _lval_. 1. If IsAnonymousFunctionDefinition(|AssignmentExpression|) is *true* and IsIdentifierRef of |LeftHandSideExpression| is *true*, then - 1. Let _rval_ be ? NamedEvaluation of |AssignmentExpression| with argument _lref_.[[ReferencedName]]. + 1. Let _lhs_ be the StringValue of |LeftHandSideExpression|. + 1. Let _rval_ be ? NamedEvaluation of |AssignmentExpression| with argument _lhs_. 1. Else, 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. 1. Let _rval_ be ? GetValue(_rref_). @@ -20903,7 +20913,8 @@

        1. Set _value_ to _next_. 1. If |Initializer| is present and _value_ is *undefined*, then 1. If IsAnonymousFunctionDefinition(|Initializer|) is *true* and IsIdentifierRef of |DestructuringAssignmentTarget| is *true*, then - 1. Let _v_ be ? NamedEvaluation of |Initializer| with argument _lref_.[[ReferencedName]]. + 1. Let _target_ be the StringValue of |DestructuringAssignmentTarget|. + 1. Let _v_ be ? NamedEvaluation of |Initializer| with argument _target_. 1. Else, 1. Let _defaultValue_ be ? Evaluation of |Initializer|. 1. Let _v_ be ? GetValue(_defaultValue_). @@ -20951,7 +20962,8 @@

        1. Let _v_ be ? GetV(_value_, _propertyName_). 1. If |Initializer| is present and _v_ is *undefined*, then 1. If IsAnonymousFunctionDefinition(|Initializer|) is *true* and IsIdentifierRef of |DestructuringAssignmentTarget| is *true*, then - 1. Let _rhsValue_ be ? NamedEvaluation of |Initializer| with argument _lref_.[[ReferencedName]]. + 1. Let _target_ be the StringValue of |DestructuringAssignmentTarget|. + 1. Let _rhsValue_ be ? NamedEvaluation of |Initializer| with argument _target_. 1. Else, 1. Let _defaultValue_ be ? Evaluation of |Initializer|. 1. Let _rhsValue_ be ? GetValue(_defaultValue_). From 30257dd22f2e7ef1832b4cc1f5acb19f1e02e96b Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Thu, 30 May 2024 16:56:10 -0700 Subject: [PATCH 06/49] Editorial: introduce CanonicalizeKeyedCollectionKey (#3337) --- spec.html | 43 +++++++++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/spec.html b/spec.html index 7f233fd669..10b2af570b 100644 --- a/spec.html +++ b/spec.html @@ -6811,7 +6811,7 @@

        1. IfAbruptCloseIterator(_key_, _iteratorRecord_). 1. Else, 1. Assert: _keyCoercion_ is ~zero~. - 1. If _key_ is *-0*𝔽, set _key_ to *+0*𝔽. + 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). 1. Perform AddValueToKeyedGroup(_groups_, _key_, _value_). 1. Set _k_ to _k_ + 1. @@ -41809,8 +41809,9 @@

        Map.prototype.delete ( _key_ )

        1. Let _M_ be the *this* value. 1. Perform ? RequireInternalSlot(_M_, [[MapData]]). + 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). 1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[MapData]], do - 1. If _p_.[[Key]] is not ~empty~ and SameValueZero(_p_.[[Key]], _key_) is *true*, then + 1. If _p_.[[Key]] is not ~empty~ and _p_.[[Key]] is _key_, then 1. Set _p_.[[Key]] to ~empty~. 1. Set _p_.[[Value]] to ~empty~. 1. Return *true*. @@ -41863,8 +41864,9 @@

        Map.prototype.get ( _key_ )

        1. Let _M_ be the *this* value. 1. Perform ? RequireInternalSlot(_M_, [[MapData]]). + 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). 1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[MapData]], do - 1. If _p_.[[Key]] is not ~empty~ and SameValueZero(_p_.[[Key]], _key_) is *true*, return _p_.[[Value]]. + 1. If _p_.[[Key]] is not ~empty~ and _p_.[[Key]] is _key_, return _p_.[[Value]]. 1. Return *undefined*. @@ -41875,8 +41877,9 @@

        Map.prototype.has ( _key_ )

        1. Let _M_ be the *this* value. 1. Perform ? RequireInternalSlot(_M_, [[MapData]]). + 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). 1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[MapData]], do - 1. If _p_.[[Key]] is not ~empty~ and SameValueZero(_p_.[[Key]], _key_) is *true*, return *true*. + 1. If _p_.[[Key]] is not ~empty~ and _p_.[[Key]] is _key_, return *true*. 1. Return *false*. @@ -41896,11 +41899,11 @@

        Map.prototype.set ( _key_, _value_ )

        1. Let _M_ be the *this* value. 1. Perform ? RequireInternalSlot(_M_, [[MapData]]). + 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). 1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[MapData]], do - 1. If _p_.[[Key]] is not ~empty~ and SameValueZero(_p_.[[Key]], _key_) is *true*, then + 1. If _p_.[[Key]] is not ~empty~ and _p_.[[Key]] is _key_, then 1. Set _p_.[[Value]] to _value_. 1. Return _M_. - 1. If _key_ is *-0*𝔽, set _key_ to *+0*𝔽. 1. Let _p_ be the Record { [[Key]]: _key_, [[Value]]: _value_ }. 1. Append _p_ to _M_.[[MapData]]. 1. Return _M_. @@ -42091,10 +42094,10 @@

        Set.prototype.add ( _value_ )

        1. Let _S_ be the *this* value. 1. Perform ? RequireInternalSlot(_S_, [[SetData]]). + 1. Set _value_ to CanonicalizeKeyedCollectionKey(_value_). 1. For each element _e_ of _S_.[[SetData]], do - 1. If _e_ is not ~empty~ and SameValueZero(_e_, _value_) is *true*, then + 1. If _e_ is not ~empty~ and _e_ is _value_, then 1. Return _S_. - 1. If _value_ is *-0*𝔽, set _value_ to *+0*𝔽. 1. Append _value_ to _S_.[[SetData]]. 1. Return _S_. @@ -42126,8 +42129,9 @@

        Set.prototype.delete ( _value_ )

        1. Let _S_ be the *this* value. 1. Perform ? RequireInternalSlot(_S_, [[SetData]]). + 1. Set _value_ to CanonicalizeKeyedCollectionKey(_value_). 1. For each element _e_ of _S_.[[SetData]], do - 1. If _e_ is not ~empty~ and SameValueZero(_e_, _value_) is *true*, then + 1. If _e_ is not ~empty~ and _e_ is _value_, then 1. Replace the element of _S_.[[SetData]] whose value is _e_ with an element whose value is ~empty~. 1. Return *true*. 1. Return *false*. @@ -42184,8 +42188,9 @@

        Set.prototype.has ( _value_ )

        1. Let _S_ be the *this* value. 1. Perform ? RequireInternalSlot(_S_, [[SetData]]). + 1. Set _value_ to CanonicalizeKeyedCollectionKey(_value_). 1. For each element _e_ of _S_.[[SetData]], do - 1. If _e_ is not ~empty~ and SameValueZero(_e_, _value_) is *true*, return *true*. + 1. If _e_ is not ~empty~ and _e_ is _value_, return *true*. 1. Return *false*. @@ -42574,6 +42579,24 @@

        Properties of WeakSet Instances

        WeakSet instances are ordinary objects that inherit properties from the WeakSet prototype. WeakSet instances also have a [[WeakSetData]] internal slot.

        + + +

        Abstract Operations for Keyed Collections

        + + +

        + CanonicalizeKeyedCollectionKey ( + _key_: an ECMAScript language value, + ): an ECMAScript language value +

        +
        +
        + + 1. If _key_ is *-0*𝔽, return *+0*𝔽. + 1. Return _key_. + +
        +
        From a78d50412129e8ed614dba9bdee90aa8729c3d81 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Tue, 4 Jun 2024 22:27:51 -0700 Subject: [PATCH 07/49] Normative: add set methods (#3306) - suggested changes (to the set-methods PR) (#3308) --- spec.html | 347 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 343 insertions(+), 4 deletions(-) diff --git a/spec.html b/spec.html index 10b2af570b..238977e478 100644 --- a/spec.html +++ b/spec.html @@ -42020,6 +42020,152 @@

        Set Objects

        Set objects are collections of ECMAScript language values. A distinct value may only occur once as an element of a Set's collection. Distinct values are discriminated using the SameValueZero comparison algorithm.

        Set objects must be implemented using either hash tables or other mechanisms that, on average, provide access times that are sublinear on the number of elements in the collection. The data structure used in this specification is only intended to describe the required observable semantics of Set objects. It is not intended to be a viable implementation model.

        + +

        Abstract Operations For Set Objects

        + + +

        Set Records

        +

        An Set Record is a Record value used to encapsulate the interface of a Set or similar object.

        +

        Set Records have the fields listed in .

        + +

        [[ReferencedName]]a String, a Symbol, or a Private NameThe name of the binding. Always a String if [[Base]] value is an Environment Record.an ECMAScript language value or a Private NameThe name of the binding. Always a String if [[Base]] value is an Environment Record. Otherwise, may be an ECMAScript language value other than a String or a Symbol until ToPropertyKey is performed.
        [[Strict]]
        + + + + + + + + + + + + + + + + + + + + + + + + + +
        + Field Name + + Value + + Meaning +
        + [[SetObject]] + + an Object + + the Set or similar object. +
        + [[Size]] + + a non-negative integer or +∞ + + The reported size of the object. +
        + [[Has]] + + a function object + + The `has` method of the object. +
        + [[Keys]] + + a function object + + The `keys` method of the object. +
        +
        +
        + + +

        + GetSetRecord ( + _obj_: an ECMAScript language value, + ): either a normal completion containing a Set Record or a throw completion +

        +
        +
        + + 1. If _obj_ is not an Object, throw a *TypeError* exception. + 1. Let _rawSize_ be ? Get(_obj_, *"size"*). + 1. Let _numSize_ be ? ToNumber(_rawSize_). + 1. NOTE: If _rawSize_ is *undefined*, then _numSize_ will be *NaN*. + 1. If _numSize_ is *NaN*, throw a *TypeError* exception. + 1. Let _intSize_ be ! ToIntegerOrInfinity(_numSize_). + 1. If _intSize_ < 0, throw a *RangeError* exception. + 1. Let _has_ be ? Get(_obj_, *"has"*). + 1. If IsCallable(_has_) is *false*, throw a *TypeError* exception. + 1. Let _keys_ be ? Get(_obj_, *"keys"*). + 1. If IsCallable(_keys_) is *false*, throw a *TypeError* exception. + 1. Return a new Set Record { [[SetObject]]: _obj_, [[Size]]: _intSize_, [[Has]]: _has_, [[Keys]]: _keys_ }. + +
        + + +

        + SetDataHas ( + _setData_: a List of either ECMAScript language values or ~empty~, + _value_: an ECMAScript language value, + ): a Boolean +

        +
        +
        + + 1. If SetDataIndex(_setData_, _value_) is ~not-found~, return *false*. + 1. Return *true*. + +
        + + +

        + SetDataIndex ( + _setData_: a List of either ECMAScript language values or ~empty~, + _value_: an ECMAScript language value, + ): a non-negative integer or ~not-found~ +

        +
        +
        + + 1. Set _value_ to CanonicalizeKeyedCollectionKey(_value_). + 1. Let _size_ be the number of elements in _setData_. + 1. Let _index_ be 0. + 1. Repeat, while _index_ < _size_, + 1. Let _e_ be _setData_[_index_]. + 1. If _e_ is not ~empty~ and _e_ is _value_, then + 1. Return _index_. + 1. Set _index_ to _index_ + 1. + 1. Return ~not-found~. + +
        + + +

        + SetDataSize ( + _setData_: a List of either ECMAScript language values or ~empty~, + ): a non-negative integer +

        +
        +
        + + 1. Let _count_ be 0. + 1. For each element _e_ of _setData_, do + 1. If _e_ is not ~empty~, set _count_ to _count_ + 1. + 1. Return _count_. + +
        + +

        The Set Constructor

        The Set constructor:

        @@ -42141,6 +42287,40 @@

        Set.prototype.delete ( _value_ )

        + +

        Set.prototype.difference ( _other_ )

        +

        This method performs the following steps when called:

        + + 1. Let _O_ be the *this* value. + 1. Perform ? RequireInternalSlot(_O_, [[SetData]]). + 1. Let _otherRec_ be ? GetSetRecord(_other_). + 1. Let _resultSetData_ be a copy of _O_.[[SetData]]. + 1. If SetDataSize(_O_.[[SetData]]) ≤ _otherRec_.[[Size]], then + 1. Let _thisSize_ be the number of elements in _O_.[[SetData]]. + 1. Let _index_ be 0. + 1. Repeat, while _index_ < _thisSize_, + 1. Let _e_ be _resultSetData_[_index_]. + 1. If _e_ is not ~empty~, then + 1. Let _inOther_ be ToBoolean(? Call(_otherRec_.[[Has]], _otherRec_.[[SetObject]], « _e_ »)). + 1. If _inOther_ is *true*, then + 1. Set _resultSetData_[_index_] to ~empty~. + 1. Set _index_ to _index_ + 1. + 1. Else, + 1. Let _keysIter_ be ? GetIteratorFromMethod(_otherRec_.[[SetObject]], _otherRec_.[[Keys]]). + 1. Let _next_ be ~not-started~. + 1. Repeat, while _next_ is not ~done~, + 1. Set _next_ to ? IteratorStepValue(_keysIter_). + 1. If _next_ is not ~done~, then + 1. Set _next_ to CanonicalizeKeyedCollectionKey(_next_). + 1. Let _valueIndex_ be SetDataIndex(_resultSetData_, _next_). + 1. If _valueIndex_ is not ~not-found~, then + 1. Set _resultSetData_[_valueIndex_] to ~empty~. + 1. Let _result_ be OrdinaryObjectCreate(%Set.prototype%, « [[SetData]] »). + 1. Set _result_.[[SetData]] to _resultSetData_. + 1. Return _result_. + +
        +

        Set.prototype.entries ( )

        This method performs the following steps when called:

        @@ -42195,6 +42375,119 @@

        Set.prototype.has ( _value_ )

        + +

        Set.prototype.intersection ( _other_ )

        +

        This method performs the following steps when called:

        + + 1. Let _O_ be the *this* value. + 1. Perform ? RequireInternalSlot(_O_, [[SetData]]). + 1. Let _otherRec_ be ? GetSetRecord(_other_). + 1. Let _resultSetData_ be a new empty List. + 1. If SetDataSize(_O_.[[SetData]]) ≤ _otherRec_.[[Size]], then + 1. Let _thisSize_ be the number of elements in _O_.[[SetData]]. + 1. Let _index_ be 0. + 1. Repeat, while _index_ < _thisSize_, + 1. Let _e_ be _O_.[[SetData]][_index_]. + 1. Set _index_ to _index_ + 1. + 1. If _e_ is not ~empty~, then + 1. Let _inOther_ be ToBoolean(? Call(_otherRec_.[[Has]], _otherRec_.[[SetObject]], « _e_ »)). + 1. If _inOther_ is *true*, then + 1. NOTE: It is possible for earlier calls to _otherRec_.[[Has]] to remove and re-add an element of _O_.[[SetData]], which can cause the same element to be visited twice during this iteration. + 1. If SetDataHas(_resultSetData_, _e_) is *false*, then + 1. Append _e_ to _resultSetData_. + 1. NOTE: The number of elements in _O_.[[SetData]] may have increased during execution of _otherRec_.[[Has]]. + 1. Set _thisSize_ to the number of elements in _O_.[[SetData]]. + 1. Else, + 1. Let _keysIter_ be ? GetIteratorFromMethod(_otherRec_.[[SetObject]], _otherRec_.[[Keys]]). + 1. Let _next_ be ~not-started~. + 1. Repeat, while _next_ is not ~done~, + 1. Set _next_ to ? IteratorStepValue(_keysIter_). + 1. If _next_ is not ~done~, then + 1. Set _next_ to CanonicalizeKeyedCollectionKey(_next_). + 1. Let _inThis_ be SetDataHas(_O_.[[SetData]], _next_). + 1. If _inThis_ is *true*, then + 1. NOTE: Because _other_ is an arbitrary object, it is possible for its *"keys"* iterator to produce the same value more than once. + 1. If SetDataHas(_resultSetData_, _next_) is *false*, then + 1. Append _next_ to _resultSetData_. + 1. Let _result_ be OrdinaryObjectCreate(%Set.prototype%, « [[SetData]] »). + 1. Set _result_.[[SetData]] to _resultSetData_. + 1. Return _result_. + +
        + + +

        Set.prototype.isDisjointFrom ( _other_ )

        +

        This method performs the following steps when called:

        + + 1. Let _O_ be the *this* value. + 1. Perform ? RequireInternalSlot(_O_, [[SetData]]). + 1. Let _otherRec_ be ? GetSetRecord(_other_). + 1. If SetDataSize(_O_.[[SetData]]) ≤ _otherRec_.[[Size]], then + 1. Let _thisSize_ be the number of elements in _O_.[[SetData]]. + 1. Let _index_ be 0. + 1. Repeat, while _index_ < _thisSize_, + 1. Let _e_ be _O_.[[SetData]][_index_]. + 1. Set _index_ to _index_ + 1. + 1. If _e_ is not ~empty~, then + 1. Let _inOther_ be ToBoolean(? Call(_otherRec_.[[Has]], _otherRec_.[[SetObject]], « _e_ »)). + 1. If _inOther_ is *true*, return *false*. + 1. NOTE: The number of elements in _O_.[[SetData]] may have increased during execution of _otherRec_.[[Has]]. + 1. Set _thisSize_ to the number of elements in _O_.[[SetData]]. + 1. Else, + 1. Let _keysIter_ be ? GetIteratorFromMethod(_otherRec_.[[SetObject]], _otherRec_.[[Keys]]). + 1. Let _next_ be ~not-started~. + 1. Repeat, while _next_ is not ~done~, + 1. Set _next_ to ? IteratorStepValue(_keysIter_). + 1. If _next_ is not ~done~, then + 1. If SetDataHas(_O_.[[SetData]], _next_) is *true*, then + 1. Perform ? IteratorClose(_keysIter_, NormalCompletion(~unused~)). + 1. Return *false*. + 1. Return *true*. + +
        + + +

        Set.prototype.isSubsetOf ( _other_ )

        +

        This method performs the following steps when called:

        + + 1. Let _O_ be the *this* value. + 1. Perform ? RequireInternalSlot(_O_, [[SetData]]). + 1. Let _otherRec_ be ? GetSetRecord(_other_). + 1. If SetDataSize(_O_.[[SetData]]) > _otherRec_.[[Size]], return *false*. + 1. Let _thisSize_ be the number of elements in _O_.[[SetData]]. + 1. Let _index_ be 0. + 1. Repeat, while _index_ < _thisSize_, + 1. Let _e_ be _O_.[[SetData]][_index_]. + 1. Set _index_ to _index_ + 1. + 1. If _e_ is not ~empty~, then + 1. Let _inOther_ be ToBoolean(? Call(_otherRec_.[[Has]], _otherRec_.[[SetObject]], « _e_ »)). + 1. If _inOther_ is *false*, return *false*. + 1. NOTE: The number of elements in _O_.[[SetData]] may have increased during execution of _otherRec_.[[Has]]. + 1. Set _thisSize_ to the number of elements in _O_.[[SetData]]. + 1. Return *true*. + +
        + + +

        Set.prototype.isSupersetOf ( _other_ )

        +

        This method performs the following steps when called:

        + + 1. Let _O_ be the *this* value. + 1. Perform ? RequireInternalSlot(_O_, [[SetData]]). + 1. Let _otherRec_ be ? GetSetRecord(_other_). + 1. If SetDataSize(_O_.[[SetData]]) < _otherRec_.[[Size]], return *false*. + 1. Let _keysIter_ be ? GetIteratorFromMethod(_otherRec_.[[SetObject]], _otherRec_.[[Keys]]). + 1. Let _next_ be ~not-started~. + 1. Repeat, while _next_ is not ~done~, + 1. Set _next_ to ? IteratorStepValue(_keysIter_). + 1. If _next_ is not ~done~, then + 1. If SetDataHas(_O_.[[SetData]], _next_) is *false*, then + 1. Perform ? IteratorClose(_keysIter_, NormalCompletion(~unused~)). + 1. Return *false*. + 1. Return *true*. + +
        +

        Set.prototype.keys ( )

        The initial value of the *"keys"* property is %Set.prototype.values%, defined in .

        @@ -42209,10 +42502,56 @@

        get Set.prototype.size

        1. Let _S_ be the *this* value. 1. Perform ? RequireInternalSlot(_S_, [[SetData]]). - 1. Let _count_ be 0. - 1. For each element _e_ of _S_.[[SetData]], do - 1. If _e_ is not ~empty~, set _count_ to _count_ + 1. - 1. Return 𝔽(_count_). + 1. Let _size_ be SetDataSize(_S_.[[SetData]]). + 1. Return 𝔽(_size_). + +
        + + +

        Set.prototype.symmetricDifference ( _other_ )

        +

        This method performs the following steps when called:

        + + 1. Let _O_ be the *this* value. + 1. Perform ? RequireInternalSlot(_O_, [[SetData]]). + 1. Let _otherRec_ be ? GetSetRecord(_other_). + 1. Let _keysIter_ be ? GetIteratorFromMethod(_otherRec_.[[SetObject]], _otherRec_.[[Keys]]). + 1. Let _resultSetData_ be a copy of _O_.[[SetData]]. + 1. Let _next_ be ~not-started~. + 1. Repeat, while _next_ is not ~done~, + 1. Set _next_ to ? IteratorStepValue(_keysIter_). + 1. If _next_ is not ~done~, then + 1. Set _next_ to CanonicalizeKeyedCollectionKey(_next_). + 1. Let _resultIndex_ be SetDataIndex(_resultSetData_, _next_). + 1. If _resultIndex_ is ~not-found~, let _alreadyInResult_ be *false*. Otherwise let _alreadyInResult_ be *true*. + 1. If SetDataHas(_O_.[[SetData]], _next_) is *true*, then + 1. If _alreadyInResult_ is *true*, set _resultSetData_[_resultIndex_] to ~empty~. + 1. Else, + 1. If _alreadyInResult_ is *false*, append _next_ to _resultSetData_. + 1. Let _result_ be OrdinaryObjectCreate(%Set.prototype%, « [[SetData]] »). + 1. Set _result_.[[SetData]] to _resultSetData_. + 1. Return _result_. + +
        + + +

        Set.prototype.union ( _other_ )

        +

        This method performs the following steps when called:

        + + 1. Let _O_ be the *this* value. + 1. Perform ? RequireInternalSlot(_O_, [[SetData]]). + 1. Let _otherRec_ be ? GetSetRecord(_other_). + 1. Let _keysIter_ be ? GetIteratorFromMethod(_otherRec_.[[SetObject]], _otherRec_.[[Keys]]). + 1. Let _resultSetData_ be a copy of _O_.[[SetData]]. + 1. Let _next_ be ~not-started~. + 1. Repeat, while _next_ is not ~done~, + 1. Set _next_ to ? IteratorStepValue(_keysIter_). + 1. If _next_ is not ~done~, then + 1. Set _next_ to CanonicalizeKeyedCollectionKey(_next_). + 1. If SetDataHas(_resultSetData_, _next_) is *false*, then + 1. Append _next_ to _resultSetData_. + 1. Let _result_ be OrdinaryObjectCreate(%Set.prototype%, « [[SetData]] »). + 1. Set _result_.[[SetData]] to _resultSetData_. + 1. Return _result_.
        From 623e2c8f3e4d3e1248ad2c02f75e0511e083560f Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Tue, 4 Jun 2024 22:33:22 -0700 Subject: [PATCH 08/49] Editorial: Better align GroupBy keyCoercion with CanonicalizeKeyedCollectionKey (#3343) --- spec.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec.html b/spec.html index 238977e478..d762d150f5 100644 --- a/spec.html +++ b/spec.html @@ -6785,7 +6785,7 @@

        GroupBy ( _items_: an ECMAScript language value, _callbackfn_: an ECMAScript language value, - _keyCoercion_: ~property~ or ~zero~, + _keyCoercion_: ~property~ or ~collection~, ): either a normal completion containing a List of Records with fields [[Key]] (an ECMAScript language value) and [[Elements]] (a List of ECMAScript language values), or a throw completion

        @@ -6810,7 +6810,7 @@

        1. Set _key_ to Completion(ToPropertyKey(_key_)). 1. IfAbruptCloseIterator(_key_, _iteratorRecord_). 1. Else, - 1. Assert: _keyCoercion_ is ~zero~. + 1. Assert: _keyCoercion_ is ~collection~. 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). 1. Perform AddValueToKeyedGroup(_groups_, _key_, _value_). 1. Set _k_ to _k_ + 1. @@ -41743,7 +41743,7 @@

        Map.groupBy ( _items_, _callbackfn_ )

        This function performs the following steps when called:

        - 1. Let _groups_ be ? GroupBy(_items_, _callbackfn_, ~zero~). + 1. Let _groups_ be ? GroupBy(_items_, _callbackfn_, ~collection~). 1. Let _map_ be ! Construct(%Map%). 1. For each Record { [[Key]], [[Elements]] } _g_ of _groups_, do 1. Let _elements_ be CreateArrayFromList(_g_.[[Elements]]). From ec57fa30daaaab8fd8c9d656380c9c3eb6032d19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aki=20=F0=9F=8C=B9?= Date: Wed, 5 Jun 2024 22:41:05 -0700 Subject: [PATCH 09/49] Markup: Add theads to all tables (#3341) --- spec.html | 1686 +++++++++++++++++++++++++++++------------------------ 1 file changed, 925 insertions(+), 761 deletions(-) diff --git a/spec.html b/spec.html index d762d150f5..8e605cc2e4 100644 --- a/spec.html +++ b/spec.html @@ -1210,17 +1210,19 @@

        Well-Known Symbols

        Within this specification a well-known symbol is referred to by using a notation of the form @@name, where “name” is one of the values listed in .

        - - - - - + + + + + + +
        - Specification Name - - [[Description]] - - Value and Purpose -
        + Specification Name + + [[Description]] + + Value and Purpose +
        @@asyncIterator @@ -1374,20 +1376,22 @@

        Numeric Types

        ECMAScript has two built-in numeric types: Number and BigInt. The following abstract operations are defined over these numeric types. The "Result" column shows the return type, along with an indication if it is possible for some invocations of the operation to return an abrupt completion.

        - - - - - - + + + + + + + +
        - Operation - - Example source - - Invoked by the Evaluation semantics of ... - - Result -
        + Operation + + Example source + + Invoked by the Evaluation semantics of ... + + Result +
        @@ -2724,13 +2728,15 @@

        Property Attributes

        Attributes are used in this specification to define and explain the state of Object properties as described in . Unless specified explicitly, the initial value of each attribute is its Default Value.

        - - - - - - - + + + + + + + + +
        Attribute NameTypes of property for which it is presentValue DomainDefault ValueDescription
        Attribute NameTypes of property for which it is presentValue DomainDefault ValueDescription
        [[Value]] @@ -2864,17 +2870,19 @@

        Object Internal Methods and Internal Slots

        An internal method implicitly returns a Completion Record, either a normal completion that wraps a value of the return type shown in its invocation pattern, or a throw completion.

        - - - - - + + + + + + +
        - Internal Method - - Signature - - Description -
        + Internal Method + + Signature + + Description +
        [[GetPrototypeOf]] @@ -3001,17 +3009,19 @@

        Object Internal Methods and Internal Slots

        summarizes additional essential internal methods that are supported by objects that may be called as functions. A function object is an object that supports the [[Call]] internal method. A constructor is an object that supports the [[Construct]] internal method. Every object that supports [[Construct]] must support [[Call]]; that is, every constructor must be a function object. Therefore, a constructor may also be referred to as a constructor function or constructor function object.

        - - - - - + + + + + + +
        - Internal Method - - Signature - - Description -
        + Internal Method + + Signature + + Description +
        [[Call]] @@ -3234,17 +3244,19 @@

        Well-Known Intrinsic Objects

        Within this specification a reference such as %name% means the intrinsic object, associated with the current realm, corresponding to the name. A reference such as %name.a.b% means, as if the *"b"* property of the value of the *"a"* property of the intrinsic object %name% was accessed prior to any ECMAScript code being evaluated. Determination of the current realm and its intrinsics is described in . The well-known intrinsics are listed in .

        - - - - - + + + + + + +
        - Intrinsic Name - - Global Name - - ECMAScript Language Association -
        + Intrinsic Name + + Global Name + + ECMAScript Language Association +
        %AggregateError% @@ -4058,17 +4070,19 @@

        The Completion Record Specification Type

        Completion Records have the fields defined in .

        - - - - - + + + + + + +
        - Field Name - - Value - - Meaning -
        + Field Name + + Value + + Meaning +
        [[Type]] @@ -4167,11 +4181,13 @@

        The Reference Record Specification Type

        - - - - - + + + + + + + @@ -4622,20 +4638,22 @@

        The PrivateElement Specification Type

        Values of the PrivateElement type are Record values whose fields are defined by . Such values are referred to as PrivateElements.

        Field NameValueMeaning
        Field NameValueMeaning
        [[Base]] an ECMAScript language value, an Environment Record, or ~unresolvable~
        - - - - - - + + + + + + + +
        - Field Name - - Values of the [[Kind]] field for which it is present - - Value - - Meaning -
        + Field Name + + Values of the [[Kind]] field for which it is present + + Value + + Meaning +
        [[Key]] @@ -4716,17 +4734,19 @@

        The ClassFieldDefinition Record Specification Type

        Values of the ClassFieldDefinition type are Record values whose fields are defined by . Such values are referred to as ClassFieldDefinition Records.

        - - - - - + + + + + + +
        - Field Name - - Value - - Meaning -
        + Field Name + + Value + + Meaning +
        [[Name]] @@ -4764,17 +4784,19 @@

        The ClassStaticBlockDefinition Record Specification Type

        ClassStaticBlockDefinition Records have the fields listed in .

        - - - - - + + + + + + +
        - Field Name - - Value - - Meaning -
        + Field Name + + Value + + Meaning +
        [[BodyFunction]] @@ -5286,14 +5308,16 @@

        - - - - + + + + + +
        - Argument Type - - Result -
        + Argument Type + + Result +
        Undefined @@ -5474,14 +5498,16 @@

        - - - - + + + + + +
        - Argument Type - - Result -
        + Argument Type + + Result +
        Undefined @@ -5637,14 +5663,16 @@

        - - - - + + + + + +
        - Argument Type - - Result -
        + Argument Type + + Result +
        Undefined @@ -6828,17 +6856,19 @@

        Iterator Records

        Iterator Records have the fields listed in .

        - - - - - + + + + + + +
        - Field Name - - Value - - Meaning -
        + Field Name + + Value + + Meaning +
        [[Iterator]] @@ -9945,14 +9975,16 @@

        The Environment Record Type Hierarchy

        The Environment Record abstract class includes the abstract specification methods defined in . These abstract methods have distinct concrete algorithms for each of the concrete subclasses.

        - - - - + + + + + +
        - Method - - Purpose -
        + Method + + Purpose +
        HasBinding(N) @@ -10250,17 +10282,19 @@

        Object Environment Records

        Object Environment Records have the additional state fields listed in .

        - - - - - + + + + + + +
        - Field Name - - Value - - Meaning -
        + Field Name + + Value + + Meaning +
        [[BindingObject]] @@ -10478,17 +10512,19 @@

        Function Environment Records

        Function Environment Records have the additional state fields listed in .

        - - - - - + + + + + + +
        - Field Name - - Value - - Meaning -
        + Field Name + + Value + + Meaning +
        [[ThisValue]] @@ -10538,14 +10574,16 @@

        Function Environment Records

        Function Environment Records support all of the Declarative Environment Record methods listed in and share the same specifications for all of those methods except for HasThisBinding and HasSuperBinding. In addition, Function Environment Records support the methods listed in :

        - - - - + + + + + +
        - Method - - Purpose -
        + Method + + Purpose +
        BindThisValue(V) @@ -10652,17 +10690,19 @@

        Global Environment Records

        Global Environment Records have the additional fields listed in and the additional methods listed in .

        - - - - - + + + + + + +
        - Field Name - - Value - - Meaning -
        + Field Name + + Value + + Meaning +
        [[ObjectRecord]] @@ -10711,14 +10751,16 @@

        Global Environment Records

        - - - - + + + + + +
        - Method - - Purpose -
        + Method + + Purpose +
        GetThisBinding() @@ -11180,14 +11222,16 @@

        Module Environment Records

        Module Environment Records support all of the Declarative Environment Record methods listed in and share the same specifications for all of those methods except for GetBindingValue, DeleteBinding, HasThisBinding and GetThisBinding. In addition, Module Environment Records support the methods listed in :

        - - - - + + + + + +
        - Method - - Purpose -
        + Method + + Purpose +
        CreateImportBinding(N, M, N2) @@ -11505,17 +11549,19 @@

        Realms

        A realm is represented in this specification as a Realm Record with the fields specified in :

        - - - - - + + + + + + +
        - Field Name - - Value - - Meaning -
        + Field Name + + Value + + Meaning +
        [[AgentSignifier]] @@ -11674,14 +11720,16 @@

        Execution Contexts

        An execution context contains whatever implementation specific state is necessary to track the execution progress of its associated code. Each execution context has at least the state components listed in .

        - - - - + + + + + +
        - Component - - Purpose -
        + Component + + Purpose +
        code evaluation state @@ -11721,14 +11769,16 @@

        Execution Contexts

        ECMAScript code execution contexts have the additional state components listed in .

        - - - - + + + + + +
        - Component - - Purpose -
        + Component + + Purpose +
        LexicalEnvironment @@ -11759,14 +11809,16 @@

        Execution Contexts

        Execution contexts representing the evaluation of Generators have the additional state components listed in .

        - - - - + + + + + +
        - Component - - Purpose -
        + Component + + Purpose +
        Generator @@ -11925,17 +11977,19 @@

        JobCallback Records

        JobCallback Records have the fields listed in .

        - - - - - + + + + + + +
        - Field Name - - Value - - Meaning -
        + Field Name + + Value + + Meaning +
        [[Callback]] @@ -12075,11 +12129,13 @@

        Agents

        An agent signifier is a globally-unique opaque value used to identify an Agent.

        - - - - - + + + + + + + @@ -13012,17 +13068,19 @@

        ECMAScript Function Objects

        In addition to [[Extensible]] and [[Prototype]], ECMAScript function objects also have the internal slots listed in .

        Field NameValueMeaning
        Field NameValueMeaning
        [[LittleEndian]] a Boolean
        - - - - - + + + + + + +
        - Internal Slot - - Type - - Description -
        + Internal Slot + + Type + + Description +
        [[Environment]] @@ -13873,17 +13931,19 @@

        Bound Function Exotic Objects

        Bound function exotic objects do not have the internal slots of ECMAScript function objects listed in . Instead they have the internal slots listed in , in addition to [[Prototype]] and [[Extensible]].

        - - - - - + + + + + + +
        - Internal Slot - - Type - - Description -
        + Internal Slot + + Type + + Description +
        [[BoundTargetFunction]] @@ -14671,17 +14731,19 @@

        TypedArray With Buffer Witness Records

        TypedArray With Buffer Witness Records have the fields listed in .

        - - - - - + + + + + + +
        - Field Name - - Value - - Meaning -
        + Field Name + + Value + + Meaning +
        [[Object]] @@ -14913,17 +14975,19 @@

        Module Namespace Exotic Objects

        Module namespace exotic objects have the internal slots defined in .

        - - - - - + + + + + + +
        - Internal Slot - - Type - - Description -
        + Internal Slot + + Type + + Description +
        [[Module]] @@ -15216,14 +15280,16 @@

        Proxy Object Internal Methods and Internal Slots

        - - - - + + + + + +
        - Internal Method - - Handler Method -
        + Internal Method + + Handler Method +
        [[GetPrototypeOf]] @@ -16249,17 +16315,19 @@

        White Space

        The ECMAScript white space code points are listed in .

        - - - - - + + + + + + +
        - Code Points - - Name - - Abbreviation -
        + Code Points + + Name + + Abbreviation +
        `U+0009` @@ -16341,17 +16409,19 @@

        Line Terminators

        The ECMAScript line terminator code points are listed in .

        - - - - - + + + + + + +
        - Code Point - - Unicode Name - - Abbreviation -
        + Code Point + + Unicode Name + + Abbreviation +
        `U+000A` @@ -17170,20 +17240,22 @@

        Static Semantics: SV ( ): a String

        - - - - - - + + + + + + + +
        - Escape Sequence - - Code Unit Value - - Unicode Character Name - - Symbol -
        + Escape Sequence + + Code Unit Value + + Unicode Character Name + + Symbol +
        `\\b` @@ -20490,7 +20562,9 @@

        Runtime Semantics: Evaluation

        - + + + @@ -20591,7 +20665,9 @@

        _assignmentOpText_ _opText_
        _assignmentOpText_ _opText_
        `**=` `**`
        `*=` `*`
        `/=` `/`
        - + + + @@ -22318,17 +22394,19 @@

        Properties of For-In Iterator Instances

        For-In Iterator instances are ordinary objects that inherit properties from the %ForInIteratorPrototype% intrinsic object. For-In Iterator instances are initially created with the internal slots listed in .

        _opText_ Type(_lnum_) _operation_
        _opText_ Type(_lnum_) _operation_
        `**` Number Number::exponentiate
        `*` Number Number::multiply
        `*` BigInt BigInt::multiply
        - - - - - + + + + + + +
        - Internal Slot - - Type - - Description -
        + Internal Slot + + Type + + Description +
        [[Object]] @@ -26159,14 +26237,16 @@

        Abstract Module Records

        - - - - + + + + + +
        - Method - - Purpose -
        + Method + + Purpose +
        LoadRequestedModules( [ _hostDefined_ ] ) @@ -26222,17 +26302,19 @@

        Cyclic Module Records

        In addition to the fields defined in Cyclic Module Records have the additional fields listed in

        - - - - - + + + + + + +
        - Field Name - - Value Type - - Meaning -
        + Field Name + + Value Type + + Meaning +
        [[Status]] @@ -26370,14 +26452,16 @@

        Cyclic Module Records

        In addition to the methods defined in Cyclic Module Records have the additional methods listed in

        - - - - + + + + + +
        - Method - - Purpose -
        + Method + + Purpose +
        InitializeEnvironment() @@ -26400,17 +26484,19 @@

        Cyclic Module Records

        A GraphLoadingState Record is a Record that contains information about the loading process of a module graph. It's used to continue loading after a call to HostLoadImportedModule. Each GraphLoadingState Record has the fields defined in :

        - - - - - + + + + + + +
        - Field Name - - Value Type - - Meaning -
        + Field Name + + Value Type + + Meaning +
        [[PromiseCapability]] @@ -27284,17 +27370,19 @@

        Source Text Module Records

        In addition to the fields defined in , Source Text Module Records have the additional fields listed in . Each of these fields is initially set in ParseModule.

        - - - - - + + + + + + +
        - Field Name - - Value Type - - Meaning -
        + Field Name + + Value Type + + Meaning +
        [[ECMAScriptCode]] @@ -27377,17 +27465,19 @@

        Source Text Module Records

        An ImportEntry Record is a Record that digests information about a single declarative import. Each ImportEntry Record has the fields defined in :

        - - - - - + + + + + + +
        - Field Name - - Value Type - - Meaning -
        + Field Name + + Value Type + + Meaning +
        [[ModuleRequest]] @@ -27427,20 +27517,22 @@

        Source Text Module Records

        gives examples of ImportEntry records fields used to represent the syntactic import forms:

        - - - - - - + + + + + + + +
        - Import Statement Form - - [[ModuleRequest]] - - [[ImportName]] - - [[LocalName]] -
        + Import Statement Form + + [[ModuleRequest]] + + [[ImportName]] + + [[LocalName]] +
        `import v from "mod";` @@ -27511,17 +27603,19 @@

        Source Text Module Records

        An ExportEntry Record is a Record that digests information about a single declarative export. Each ExportEntry Record has the fields defined in :

        - - - - - + + + + + + +
        - Field Name - - Value Type - - Meaning -
        + Field Name + + Value Type + + Meaning +
        [[ExportName]] @@ -27572,23 +27666,25 @@

        Source Text Module Records

        gives examples of the ExportEntry record fields used to represent the syntactic export forms:

        - - - - - - - + + + + + + + + +
        - Export Statement Form - - [[ExportName]] - - [[ModuleRequest]] - - [[ImportName]] - - [[LocalName]] -
        + Export Statement Form + + [[ExportName]] + + [[ModuleRequest]] + + [[ImportName]] + + [[LocalName]] +
        `export var v;` @@ -30557,17 +30653,19 @@

        Symbol.for ( _key_ )

        The GlobalSymbolRegistry is an append-only List that is globally available. It is shared by all realms. Prior to the evaluation of any ECMAScript code, it is initialized as a new empty List. Elements of the GlobalSymbolRegistry are Records with the structure defined in .

        - - - - - + + + + + + +
        - Field Name - - Value - - Usage -
        + Field Name + + Value + + Usage +
        [[Key]] @@ -32656,11 +32754,13 @@

        Time Zone Identifier Record

        Time Zone Identifier Records have the fields listed in .

        - - - - - + + + + + + + @@ -33101,17 +33201,19 @@

        Time Zone Offset String Format

        Field NameValueMeaning
        Field NameValueMeaning
        [[Identifier]] a String
        - - - - - + + + + + + +
        - Code Point - - Unicode Name - - Abbreviation -
        + Code Point + + Unicode Name + + Abbreviation +
        `U+2212` @@ -34016,14 +34118,16 @@

        - - - - + + + + + +
        - Number - - Name -
        + Number + + Name +
        *+0*𝔽 @@ -34084,14 +34188,16 @@

        - - - - + + + + + +
        - Number - - Name -
        + Number + + Name +
        *+0*𝔽 @@ -35910,23 +36016,25 @@

        Static Semantics: CharacterValue ( ): a non-negative integer

        - - - - - - - + + + + + + + + +
        - ControlEscape - - Numeric Value - - Code Point - - Unicode Name - - Symbol -
        + ControlEscape + + Numeric Value + + Code Point + + Unicode Name + + Symbol +
        `t` @@ -36297,11 +36405,13 @@

        RegExp Records

        It has the following fields:

        - - - - - + + + + + + + @@ -38291,11 +38401,13 @@

        Match Records

        Match Records have the fields listed in .

        Field NameValueMeaning
        Field NameValueMeaning
        [[IgnoreCase]] a Boolean
        - - - - - + + + + + + + @@ -40031,23 +40143,25 @@

        TypedArray Objects

        A _TypedArray_ presents an array-like view of an underlying binary data buffer (). A TypedArray element type is the underlying binary scalar data type that all elements of a _TypedArray_ instance have. There is a distinct _TypedArray_ constructor, listed in , for each of the supported element types. Each constructor in has a corresponding distinct prototype object.

        Field NameValueMeaning
        Field NameValueMeaning
        [[StartIndex]] a non-negative integer
        - - - - - - - + + + + + + + + +
        - Constructor Name and Intrinsic - - Element Type - - Element Size - - Conversion Operation - - Description -
        + Constructor Name and Intrinsic + + Element Type + + Element Size + + Conversion Operation + + Description +
        Int8Array
        @@ -43960,17 +44074,19 @@

        DataView With Buffer Witness Records

        DataView With Buffer Witness Records have the fields listed in .

        - - - - - + + + + + + +
        - Field Name - - Value - - Meaning -
        + Field Name + + Value + + Meaning +
        [[Object]] @@ -44469,17 +44585,19 @@

        Waiter Record

        A Waiter Record has fields listed in .

        - - - - - + + + + + + +
        - Field Name - - Value - - Meaning -
        + Field Name + + Value + + Meaning +
        [[AgentSignifier]] @@ -44534,17 +44652,19 @@

        WaiterList Records

        A WaiterList Record has fields listed in .

        - - - - - + + + + + + +
        - Field Name - - Value - - Meaning -
        + Field Name + + Value + + Meaning +
        [[Waiters]] @@ -45431,11 +45551,13 @@

        JSON Serialization Record

        JSON Serialization Records have the fields listed in .

        - - - - - + + + + + + + @@ -45533,17 +45655,19 @@

        Field NameValueMeaning
        Field NameValueMeaning
        [[ReplacerFunction]] a function object or *undefined*
        - - - - - + + + + + + +
        - Code Point - - Unicode Character Name - - Escape Sequence -
        + Code Point + + Unicode Character Name + + Escape Sequence +
        U+0008 @@ -46025,17 +46149,19 @@

        The Iterable Interface

        The Iterable interface includes the property described in :

        - - - - - + + + + + + +
        - Property - - Value - - Requirements -
        + Property + + Value + + Requirements +
        `@@iterator` @@ -46056,17 +46182,19 @@

        The Iterator Interface

        An object that implements the Iterator interface must include the property in . Such objects may also implement the properties in .

        - - - - - + + + + + + +
        - Property - - Value - - Requirements -
        + Property + + Value + + Requirements +
        *"next"* @@ -46085,17 +46213,19 @@

        The Iterator Interface

        - - - - - + + + + + + +
        - Property - - Value - - Requirements -
        + Property + + Value + + Requirements +
        *"return"* @@ -46130,11 +46260,13 @@

        The AsyncIterable Interface

        The AsyncIterable interface includes the properties described in :

        - - - - - + + + + + + + @@ -46149,11 +46281,13 @@

        The AsyncIterator Interface

        An object that implements the AsyncIterator interface must include the properties in . Such objects may also implement the properties in .

        PropertyValueRequirements
        PropertyValueRequirements
        `@@asyncIterator` a function that returns an AsyncIterator object
        - - - - - + + + + + + + @@ -46170,11 +46304,13 @@

        The AsyncIterator Interface

        PropertyValueRequirements
        PropertyValueRequirements
        *"next"* a function that returns a promise for an IteratorResult object
        - - - - - + + + + + + + @@ -46205,17 +46341,19 @@

        The IteratorResult Interface

        The IteratorResult interface includes the properties listed in :

        PropertyValueRequirements
        PropertyValueRequirements
        *"return"* a function that returns a promise for an IteratorResult object
        - - - - - + + + + + + +
        - Property - - Value - - Requirements -
        + Property + + Value + + Requirements +
        *"done"* @@ -46479,17 +46617,19 @@

        PromiseCapability Records

        PromiseCapability Records have the fields listed in .

        - - - - - + + + + + + +
        - Field Name - - Value - - Meaning -
        + Field Name + + Value + + Meaning +
        [[Promise]] @@ -46550,17 +46690,19 @@

        PromiseReaction Records

        PromiseReaction Records have the fields listed in .

        - - - - - + + + + + + +
        - Field Name - - Value - - Meaning -
        + Field Name + + Value + + Meaning +
        [[Capability]] @@ -47488,17 +47630,19 @@

        Properties of Promise Instances

        Promise instances are ordinary objects that inherit properties from the Promise prototype object (the intrinsic, %Promise.prototype%). Promise instances are initially created with the internal slots described in .

        - - - - - + + + + + + +
        - Internal Slot - - Type - - Description -
        + Internal Slot + + Type + + Description +
        [[PromiseState]] @@ -47828,17 +47972,19 @@

        Properties of Generator Instances

        Generator instances are initially created with the internal slots described in .

        - - - - - + + + + + + + - + @@ -48397,7 +48397,7 @@

        Properties of AsyncGenerator Instances

        - + @@ -48461,7 +48461,7 @@

        1. Let _result_ be Completion(_generatorBody_()). 1. Assert: If we return here, the async generator either threw an exception or performed either an implicit or explicit return. 1. Remove _acGenContext_ from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context. - 1. Set _acGenerator_.[[AsyncGeneratorState]] to ~awaiting-return~. + 1. Set _acGenerator_.[[AsyncGeneratorState]] to ~draining-queue~. 1. If _result_ is a normal completion, set _result_ to NormalCompletion(*undefined*). 1. If _result_ is a return completion, set _result_ to NormalCompletion(_result_.[[Value]]). 1. Perform AsyncGeneratorCompleteStep(_acGenerator_, _result_, *true*). @@ -48626,7 +48626,7 @@

        - 1. Assert: _generator_.[[AsyncGeneratorState]] is ~awaiting-return~. + 1. Assert: _generator_.[[AsyncGeneratorState]] is ~draining-queue~. 1. Let _queue_ be _generator_.[[AsyncGeneratorQueue]]. 1. Assert: _queue_ is not empty. 1. Let _next_ be the first element of _queue_. @@ -48640,14 +48640,14 @@

        1. Assert: _promiseCompletion_ is a normal completion. 1. Let _promise_ be _promiseCompletion_.[[Value]]. 1. Let _fulfilledClosure_ be a new Abstract Closure with parameters (_value_) that captures _generator_ and performs the following steps when called: - 1. Assert: _generator_.[[AsyncGeneratorState]] is ~awaiting-return~. + 1. Assert: _generator_.[[AsyncGeneratorState]] is ~draining-queue~. 1. Let _result_ be NormalCompletion(_value_). 1. Perform AsyncGeneratorCompleteStep(_generator_, _result_, *true*). 1. Perform AsyncGeneratorDrainQueue(_generator_). 1. Return *undefined*. 1. Let _onFulfilled_ be CreateBuiltinFunction(_fulfilledClosure_, 1, *""*, « »). 1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_reason_) that captures _generator_ and performs the following steps when called: - 1. Assert: _generator_.[[AsyncGeneratorState]] is ~awaiting-return~. + 1. Assert: _generator_.[[AsyncGeneratorState]] is ~draining-queue~. 1. Let _result_ be ThrowCompletion(_reason_). 1. Perform AsyncGeneratorCompleteStep(_generator_, _result_, *true*). 1. Perform AsyncGeneratorDrainQueue(_generator_). @@ -48669,7 +48669,7 @@

        It drains the generator's AsyncGeneratorQueue until it encounters an AsyncGeneratorRequest which holds a return completion.
        - 1. Assert: _generator_.[[AsyncGeneratorState]] is ~awaiting-return~. + 1. Assert: _generator_.[[AsyncGeneratorState]] is ~draining-queue~. 1. Let _queue_ be _generator_.[[AsyncGeneratorQueue]]. 1. If _queue_ is empty, then 1. Set _generator_.[[AsyncGeneratorState]] to ~completed~. From 14676dbdff141af58071df59f7af5d2965f9043c Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Thu, 15 Aug 2024 14:47:24 -0700 Subject: [PATCH 32/49] Normative: fully define Math.sqrt (#3345) --- spec.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec.html b/spec.html index 0c5c642734..0940af6a76 100644 --- a/spec.html +++ b/spec.html @@ -31908,7 +31908,7 @@

        Math [ %Symbol.toStringTag% ]

        Function Properties of the Math Object

        -

        The behaviour of the functions `acos`, `acosh`, `asin`, `asinh`, `atan`, `atanh`, `atan2`, `cbrt`, `cos`, `cosh`, `exp`, `expm1`, `hypot`, `log`, `log1p`, `log2`, `log10`, `pow`, `random`, `sin`, `sinh`, `sqrt`, `tan`, and `tanh` is not precisely specified here except to require specific results for certain argument values that represent boundary cases of interest. For other argument values, these functions are intended to compute approximations to the results of familiar mathematical functions, but some latitude is allowed in the choice of approximation algorithms. The general intent is that an implementer should be able to use the same mathematical library for ECMAScript on a given hardware platform that is available to C programmers on that platform.

        +

        The behaviour of the functions `acos`, `acosh`, `asin`, `asinh`, `atan`, `atanh`, `atan2`, `cbrt`, `cos`, `cosh`, `exp`, `expm1`, `hypot`, `log`, `log1p`, `log2`, `log10`, `pow`, `random`, `sin`, `sinh`, `tan`, and `tanh` is not precisely specified here except to require specific results for certain argument values that represent boundary cases of interest. For other argument values, these functions are intended to compute approximations to the results of familiar mathematical functions, but some latitude is allowed in the choice of approximation algorithms. The general intent is that an implementer should be able to use the same mathematical library for ECMAScript on a given hardware platform that is available to C programmers on that platform.

        Although the choice of algorithms is left to the implementation, it is recommended (but not specified by this standard) that implementations use the approximation algorithms for IEEE 754-2019 arithmetic contained in `fdlibm`, the freely distributable mathematical library from Sun Microsystems (http://www.netlib.org/fdlibm).

        @@ -32381,7 +32381,7 @@

        Math.sqrt ( _x_ )

        1. Let _n_ be ? ToNumber(_x_). 1. If _n_ is one of *NaN*, *+0*𝔽, *-0*𝔽, or *+∞*𝔽, return _n_. 1. If _n_ < *-0*𝔽, return *NaN*. - 1. Return an implementation-approximated Number value representing the square root of ℝ(_n_). + 1. Return 𝔽(the square root of ℝ(_n_)).
        From ac21460fedf4b926520b06c9820bdbebad596a8b Mon Sep 17 00:00:00 2001 From: Shu-yu Guo Date: Sat, 17 Aug 2024 15:09:03 -0700 Subject: [PATCH 33/49] Normative: Fix hangs with top-level await (#3357) Closes #3356. Modules that depend on modules with top-level await but do not themselves have a top-level await may currently hang. When a module with TLA finishes evaluating, it triggers evaluation of ancestors modules that depend on it. Currently, ancestors that do not have TLA themselves are evaluated and have their [[Status]] set to ~evaluated~ but incorrectly leaves their [[AsyncEvaluation]] field unchanged as true. This means subsequent importers of those ancestors consider them as in the middle of async evaluation and will wait on them in InnerModuleEvaluation. But since they are already evaluated, those waits cause a hang. This PR sets [[AsyncEvaluation]] to false for those ancestors when their [[Status]] transition to ~evaluated~. Note that the ancestors that error out during evaluation do not need this fix because there is a bail-out path for errored out modules in InnerModuleEvaluation. - Set [[AsyncEvaluation]] to false in rejection closure for symmetry --- spec.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec.html b/spec.html index 0940af6a76..3f95b6d214 100644 --- a/spec.html +++ b/spec.html @@ -26922,6 +26922,7 @@

        1. If _result_ is an abrupt completion, then 1. Perform AsyncModuleExecutionRejected(_m_, _result_.[[Value]]). 1. Else, + 1. Set _m_.[[AsyncEvaluation]] to *false*. 1. Set _m_.[[Status]] to ~evaluated~. 1. If _m_.[[TopLevelCapability]] is not ~empty~, then 1. Assert: _m_.[[CycleRoot]] and _m_ are the same Module Record. @@ -26948,6 +26949,8 @@

        1. Assert: _module_.[[EvaluationError]] is ~empty~. 1. Set _module_.[[EvaluationError]] to ThrowCompletion(_error_). 1. Set _module_.[[Status]] to ~evaluated~. + 1. Set _module_.[[AsyncEvaluation]] to *false*. + 1. NOTE: _module_.[[AsyncEvaluation]] is set to *false* for symmetry with AsyncModuleExecutionFulfilled. In InnerModuleEvaluation, the value of a module's [[AsyncEvaluation]] internal slot is unused when its [[EvaluationError]] internal slot is not ~empty~. 1. For each Cyclic Module Record _m_ of _module_.[[AsyncParentModules]], do 1. Perform AsyncModuleExecutionRejected(_m_, _error_). 1. If _module_.[[TopLevelCapability]] is not ~empty~, then From cb2495cc0e72c8b357ce0487a8cd48a0334bbc73 Mon Sep 17 00:00:00 2001 From: Jihyeok Park Date: Sun, 25 Aug 2024 20:21:24 -0700 Subject: [PATCH 34/49] Editorial: Initialize [[GeneratorState]] and [[AsyncGeneratorState]] (#3383) --- spec.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec.html b/spec.html index 3f95b6d214..264e39164f 100644 --- a/spec.html +++ b/spec.html @@ -23980,6 +23980,7 @@

        1. Perform ? FunctionDeclarationInstantiation(_functionObject_, _argumentsList_). 1. Let _G_ be ? OrdinaryCreateFromConstructor(_functionObject_, *"%GeneratorFunction.prototype.prototype%"*, « [[GeneratorState]], [[GeneratorContext]], [[GeneratorBrand]] »). 1. Set _G_.[[GeneratorBrand]] to ~empty~. + 1. Set _G_.[[GeneratorState]] to ~suspended-start~. 1. Perform GeneratorStart(_G_, |FunctionBody|). 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _G_, [[Target]]: ~empty~ }. @@ -24207,6 +24208,7 @@

        1. Perform ? FunctionDeclarationInstantiation(_functionObject_, _argumentsList_). 1. Let _generator_ be ? OrdinaryCreateFromConstructor(_functionObject_, *"%AsyncGeneratorFunction.prototype.prototype%"*, « [[AsyncGeneratorState]], [[AsyncGeneratorContext]], [[AsyncGeneratorQueue]], [[GeneratorBrand]] »). 1. Set _generator_.[[GeneratorBrand]] to ~empty~. + 1. Set _generator_.[[AsyncGeneratorState]] to ~suspended-start~. 1. Perform AsyncGeneratorStart(_generator_, |FunctionBody|). 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _generator_, [[Target]]: ~empty~ }. @@ -48045,7 +48047,7 @@

        Properties of Generator Instances

        [[GeneratorState]]

        - + @@ -48451,7 +48452,7 @@

        - 1. Assert: _generator_.[[AsyncGeneratorState]] is *undefined*. + 1. Assert: _generator_.[[AsyncGeneratorState]] is ~suspended-start~. 1. Let _genContext_ be the running execution context. 1. Set the Generator component of _genContext_ to _generator_. 1. Let _closure_ be a new Abstract Closure with no parameters that captures _generatorBody_ and performs the following steps when called: @@ -48472,7 +48473,6 @@

        1. Return *undefined*. 1. Set the code evaluation state of _genContext_ such that when evaluation is resumed for that execution context, _closure_ will be called with no arguments. 1. Set _generator_.[[AsyncGeneratorContext]] to _genContext_. - 1. Set _generator_.[[AsyncGeneratorState]] to ~suspended-start~. 1. Set _generator_.[[AsyncGeneratorQueue]] to a new empty List. 1. Return ~unused~. From 6c621d2efb89ac03a0e4a1fbc8f721b206a5027e Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Sun, 25 Aug 2024 20:56:36 -0700 Subject: [PATCH 35/49] Meta: do not npm audit in CI (#3390) --- .github/workflows/build.yml | 4 +++- .github/workflows/deploy.yml | 4 +++- .github/workflows/enforce-format.yml | 4 +++- .github/workflows/ipr.yml | 4 +++- .github/workflows/preview-build.yml | 4 +++- .github/workflows/preview.yml | 4 +++- .github/workflows/publish-biblio.yml | 2 +- .github/workflows/spellcheck.yml | 4 +++- 8 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 237f4c9cc3..eda5ecd5b2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,9 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ljharb/actions/node/install@d9f477827ed71a259056764107f74afc29febcae - name: 'nvm install lts/* && npm ci' + name: 'nvm install lts/* && npm ci --no-audit' + env: + NPM_CONFIG_AUDIT: false with: node-version: lts/* use-npm-ci: true diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 424c2d3f97..a567db1f65 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,7 +14,9 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ljharb/actions/node/install@d9f477827ed71a259056764107f74afc29febcae - name: 'nvm install lts/* && npm ci' + name: 'nvm install lts/* && npm ci --no-audit' + env: + NPM_CONFIG_AUDIT: false with: node-version: lts/* use-npm-ci: true diff --git a/.github/workflows/enforce-format.yml b/.github/workflows/enforce-format.yml index d2358e0e47..d40c94ff9b 100644 --- a/.github/workflows/enforce-format.yml +++ b/.github/workflows/enforce-format.yml @@ -10,7 +10,9 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ljharb/actions/node/install@d9f477827ed71a259056764107f74afc29febcae - name: 'nvm install lts/* && npm ci' + name: 'nvm install lts/* && npm ci --no-audit' + env: + NPM_CONFIG_AUDIT: false with: node-version: lts/* use-npm-ci: true diff --git a/.github/workflows/ipr.yml b/.github/workflows/ipr.yml index 608b514867..cc313dfb42 100644 --- a/.github/workflows/ipr.yml +++ b/.github/workflows/ipr.yml @@ -16,7 +16,9 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ljharb/actions/node/install@d9f477827ed71a259056764107f74afc29febcae - name: 'nvm install lts/* && npm ci' + name: 'nvm install lts/* && npm ci --no-audit' + env: + NPM_CONFIG_AUDIT: false with: node-version: lts/* use-npm-ci: true diff --git a/.github/workflows/preview-build.yml b/.github/workflows/preview-build.yml index d2dd361ea5..55a4474dc2 100644 --- a/.github/workflows/preview-build.yml +++ b/.github/workflows/preview-build.yml @@ -10,7 +10,9 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ljharb/actions/node/install@d9f477827ed71a259056764107f74afc29febcae - name: 'nvm install lts/* && npm ci' + name: 'nvm install lts/* && npm ci --no-audit' + env: + NPM_CONFIG_AUDIT: false with: node-version: lts/* use-npm-ci: true diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index c3ab4f7f83..1f1e69a4b6 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -20,7 +20,9 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ljharb/actions/node/install@d9f477827ed71a259056764107f74afc29febcae - name: 'nvm install lts/* && npm ci' + name: 'nvm install lts/* && npm ci --no-audit' + env: + NPM_CONFIG_AUDIT: false with: node-version: lts/* use-npm-ci: true diff --git a/.github/workflows/publish-biblio.yml b/.github/workflows/publish-biblio.yml index dad842ff86..bca1c1919f 100644 --- a/.github/workflows/publish-biblio.yml +++ b/.github/workflows/publish-biblio.yml @@ -24,7 +24,7 @@ jobs: registry-url: 'https://registry.npmjs.org' - name: Install dependencies - run: npm ci + run: npm ci --no-audit - name: Publish biblio run: scripts/publish-biblio.sh diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml index 7a32ba3c0f..6a02292048 100644 --- a/.github/workflows/spellcheck.yml +++ b/.github/workflows/spellcheck.yml @@ -15,7 +15,9 @@ jobs: # Default: 1 fetch-depth: 0 - uses: ljharb/actions/node/install@d9f477827ed71a259056764107f74afc29febcae - name: 'nvm install lts/* && npm ci' + name: 'nvm install lts/* && npm ci --no-audit' + env: + NPM_CONFIG_AUDIT: false with: node-version: lts/* use-npm-ci: true From 6ece111aa3b5914b771b8e0358afed6f6cfd5654 Mon Sep 17 00:00:00 2001 From: Shreyans Pathak Date: Sun, 25 Aug 2024 21:50:59 -0700 Subject: [PATCH 36/49] Markup: Update broken link in `Number::toString` (#3393) --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index 264e39164f..be1ef40f72 100644 --- a/spec.html +++ b/spec.html @@ -2370,7 +2370,7 @@

        Implementers of ECMAScript may find useful the paper and code written by David M. Gay for binary-to-decimal conversion of floating-point numbers:

        Gay, David M. Correctly Rounded Binary-Decimal and Decimal-Binary Conversions. Numerical Analysis, Manuscript 90-10. AT&T Bell Laboratories (Murray Hill, New Jersey). 30 November 1990. Available as
        - http://ampl.com/REFS/abstracts.html#rounding. Associated code available as
        + https://ampl.com/_archive/first-website/REFS/rounding.pdf. Associated code available as
        http://netlib.sandia.gov/fp/dtoa.c and as
        http://netlib.sandia.gov/fp/g_fmt.c and may also be found at the various `netlib` mirror sites.

        From 815aa8a4d68ce24bec81ba6789c37d55bc87b54a Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Mon, 26 Aug 2024 11:16:08 -0700 Subject: [PATCH 37/49] Editorial: Clamp size before using with "substring of" (#3400) Fixes #3261 --- spec.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spec.html b/spec.html index be1ef40f72..8493c6364b 100644 --- a/spec.html +++ b/spec.html @@ -35229,7 +35229,9 @@

        String.prototype.split ( _separator_, _limit_ )

        1. Return CreateArrayFromList(« _S_ »). 1. Let _separatorLength_ be the length of _R_. 1. If _separatorLength_ = 0, then - 1. Let _head_ be the substring of _S_ from 0 to _lim_. + 1. Let _strLen_ be the length of _S_. + 1. Let _outLen_ be the result of clamping _lim_ between 0 and _strLen_. + 1. Let _head_ be the substring of _S_ from 0 to _outLen_. 1. Let _codeUnits_ be a List consisting of the sequence of code units that are the elements of _head_. 1. Return CreateArrayFromList(_codeUnits_). 1. If _S_ is the empty String, return CreateArrayFromList(« _S_ »). From c4f433e0b79e70d8a9bffde0d71661aa583d0144 Mon Sep 17 00:00:00 2001 From: Denis Date: Mon, 2 Sep 2024 14:53:30 -0700 Subject: [PATCH 38/49] Editorial: replace non-existent type 'Reference' with type 'Reference Record' and its link (#3375) --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index 8493c6364b..a5803db65a 100644 --- a/spec.html +++ b/spec.html @@ -4035,7 +4035,7 @@

        Well-Known Intrinsic Objects

        ECMAScript Specification Types

        -

        A specification type corresponds to meta-values that are used within algorithms to describe the semantics of ECMAScript language constructs and ECMAScript language types. The specification types include Reference, List, Completion Record, Property Descriptor, Environment Record, Abstract Closure, and Data Block. Specification type values are specification artefacts that do not necessarily correspond to any specific entity within an ECMAScript implementation. Specification type values may be used to describe intermediate results of ECMAScript expression evaluation but such values cannot be stored as properties of objects or values of ECMAScript language variables.

        +

        A specification type corresponds to meta-values that are used within algorithms to describe the semantics of ECMAScript language constructs and ECMAScript language types. The specification types include Reference Record, List, Completion Record, Property Descriptor, Environment Record, Abstract Closure, and Data Block. Specification type values are specification artefacts that do not necessarily correspond to any specific entity within an ECMAScript implementation. Specification type values may be used to describe intermediate results of ECMAScript expression evaluation but such values cannot be stored as properties of objects or values of ECMAScript language variables.

        The Enum Specification Type

        From 9d945cf2d9e30524314d10114833ba40640e959b Mon Sep 17 00:00:00 2001 From: Hyunjoon Kim Date: Mon, 2 Sep 2024 15:08:12 -0700 Subject: [PATCH 39/49] Editorial: Using Object instead of Constructor in PromiseResolve (#3376) --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index a5803db65a..826b3afdb4 100644 --- a/spec.html +++ b/spec.html @@ -47515,7 +47515,7 @@

        Promise.resolve ( _x_ )

        PromiseResolve ( - _C_: a constructor, + _C_: an Object, _x_: an ECMAScript language value, ): either a normal completion containing an ECMAScript language value or a throw completion

        From d9d77ad3f8717748f80972fe54f8b7628200a412 Mon Sep 17 00:00:00 2001 From: tmdghks Date: Mon, 2 Sep 2024 16:31:31 -0700 Subject: [PATCH 40/49] Editorial: Narrow `integer` into `non-negative integer` in return type of ExpectedArgumentCount (#3378) --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index 826b3afdb4..5c941e8da4 100644 --- a/spec.html +++ b/spec.html @@ -23286,7 +23286,7 @@

        Static Semantics: HasInitializer ( ): a Boolean

        -

        Static Semantics: ExpectedArgumentCount ( ): an integer

        +

        Static Semantics: ExpectedArgumentCount ( ): a non-negative integer

        From 62bb5c575327996050ac9cd32124c8efde38f666 Mon Sep 17 00:00:00 2001 From: tmdghks Date: Mon, 2 Sep 2024 20:32:16 -0700 Subject: [PATCH 41/49] Editorial: Widen parameter type of CreateDynamicFunction (#3380) --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index 5c941e8da4..e8fa3043cf 100644 --- a/spec.html +++ b/spec.html @@ -30299,7 +30299,7 @@

        Function ( ..._parameterArgs_, _bodyArg_ )

        CreateDynamicFunction ( _constructor_: a constructor, - _newTarget_: a constructor, + _newTarget_: a constructor or *undefined*, _kind_: ~normal~, ~generator~, ~async~, or ~async-generator~, _parameterArgs_: a List of ECMAScript language values, _bodyArg_: an ECMAScript language value, From f4d28eb6a43557882179dd81b66e17cfac9eda99 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 5 Sep 2024 15:16:02 -0700 Subject: [PATCH 42/49] Editorial: add `SameType` AO (#3408) --- spec.html | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/spec.html b/spec.html index e8fa3043cf..7da8622829 100644 --- a/spec.html +++ b/spec.html @@ -5871,6 +5871,30 @@

        + +

        + SameType ( + _x_: an ECMAScript language value, + _y_: an ECMAScript language value, + ): a Boolean +

        +
        +
        description
        +
        It determines whether or not the two arguments are the same type.
        +
        + + 1. If _x_ is *undefined* and _y_ is *undefined*, return *true*. + 1. If _x_ is *null* and _y_ is *null*, return *true*. + 1. If _x_ is a Boolean and _y_ is a Boolean, return *true*. + 1. If _x_ is a Number and _y_ is a Number, return *true*. + 1. If _x_ is a BigInt and _y_ is a BigInt, return *true*. + 1. If _x_ is a Symbol and _y_ is a Symbol, return *true*. + 1. If _x_ is a String and _y_ is a String, return *true*. + 1. If _x_ is an Object and _y_ is an Object, return *true*. + 1. Return *false*. + +
        +

        SameValue ( @@ -5883,7 +5907,7 @@

        It determines whether or not the two arguments are the same value.
        - 1. If Type(_x_) is not Type(_y_), return *false*. + 1. If SameType(_x_, _y_) is *false*, return *false*. 1. If _x_ is a Number, then 1. Return Number::sameValue(_x_, _y_). 1. Return SameValueNonNumber(_x_, _y_). @@ -5905,7 +5929,7 @@

        It determines whether or not the two arguments are the same value (ignoring the difference between *+0*𝔽 and *-0*𝔽).
        - 1. If Type(_x_) is not Type(_y_), return *false*. + 1. If SameType(_x_, _y_) is *false*, return *false*. 1. If _x_ is a Number, then 1. Return Number::sameValueZero(_x_, _y_). 1. Return SameValueNonNumber(_x_, _y_). @@ -5925,7 +5949,7 @@

        - 1. Assert: Type(_x_) is Type(_y_). + 1. Assert: SameType(_x_, _y_) is *true*. 1. If _x_ is either *null* or *undefined*, return *true*. 1. If _x_ is a BigInt, then 1. Return BigInt::equal(_x_, _y_). @@ -5985,7 +6009,7 @@

        1. NOTE: Because _px_ and _py_ are primitive values, evaluation order is not important. 1. Let _nx_ be ? ToNumeric(_px_). 1. Let _ny_ be ? ToNumeric(_py_). - 1. If Type(_nx_) is Type(_ny_), then + 1. If SameType(_nx_, _ny_) is *true*, then 1. If _nx_ is a Number, then 1. Return Number::lessThan(_nx_, _ny_). 1. Else, @@ -6017,7 +6041,7 @@

        It provides the semantics for the `==` operator.
        - 1. If Type(_x_) is Type(_y_), then + 1. If SameType(_x_, _y_) is *true*, then 1. Return IsStrictlyEqual(_x_, _y_). 1. If _x_ is *null* and _y_ is *undefined*, return *true*. 1. If _x_ is *undefined* and _y_ is *null*, return *true*. @@ -6052,7 +6076,7 @@

        It provides the semantics for the `===` operator.
        - 1. If Type(_x_) is not Type(_y_), return *false*. + 1. If SameType(_x_, _y_) is *false*, return *false*. 1. If _x_ is a Number, then 1. Return Number::equal(_x_, _y_). 1. Return SameValueNonNumber(_x_, _y_). @@ -20659,7 +20683,7 @@

        1. NOTE: At this point, it must be a numeric operation. 1. Let _lNum_ be ? ToNumeric(_lVal_). 1. Let _rNum_ be ? ToNumeric(_rVal_). - 1. If Type(_lNum_) is not Type(_rNum_), throw a *TypeError* exception. + 1. If SameType(_lNum_, _rNum_) is *false*, throw a *TypeError* exception. 1. If _lNum_ is a BigInt, then 1. If _opText_ is `**`, return ? BigInt::exponentiate(_lNum_, _rNum_). 1. If _opText_ is `/`, return ? BigInt::divide(_lNum_, _rNum_). From 6d6515a69ddd723fa8e220db7928a995b2544894 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 5 Sep 2024 15:29:47 -0700 Subject: [PATCH 43/49] Editorial: `CreateListFromArrayLike`: change element type list to a 2-state enum (#3409) --- spec.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/spec.html b/spec.html index 7da8622829..bf5a1f9535 100644 --- a/spec.html +++ b/spec.html @@ -6471,7 +6471,7 @@

        CreateListFromArrayLike ( _obj_: an ECMAScript language value, - optional _elementTypes_: a List of names of ECMAScript Language Types, + optional _requirePropertyKeys_: a boolean, ): either a normal completion containing a List of ECMAScript language values or a throw completion

        @@ -6479,7 +6479,6 @@

        It is used to create a List value whose elements are provided by the indexed properties of _obj_. _elementTypes_ contains the names of ECMAScript Language Types that are allowed for element values of the List that is created.

        - 1. If _elementTypes_ is not present, set _elementTypes_ to « Undefined, Null, Boolean, String, Symbol, Number, BigInt, Object ». 1. If _obj_ is not an Object, throw a *TypeError* exception. 1. Let _len_ be ? LengthOfArrayLike(_obj_). 1. Let _list_ be a new empty List. @@ -6487,7 +6486,7 @@

        1. Repeat, while _index_ < _len_, 1. Let _indexName_ be ! ToString(𝔽(_index_)). 1. Let _next_ be ? Get(_obj_, _indexName_). - 1. If _elementTypes_ does not contain Type(_next_), throw a *TypeError* exception. + 1. If _requirePropertyKeys_ is *true* and _next_ is not a property key, throw a *TypeError* exception. 1. Append _next_ to _list_. 1. Set _index_ to _index_ + 1. 1. Return _list_. @@ -15885,7 +15884,7 @@

        [[OwnPropertyKeys]] ( ): either a normal completion containing a List of pro 1. If _trap_ is *undefined*, then 1. Return ? _target_.[[OwnPropertyKeys]](). 1. Let _trapResultArray_ be ? Call(_trap_, _handler_, « _target_ »). - 1. Let _trapResult_ be ? CreateListFromArrayLike(_trapResultArray_, « String, Symbol »). + 1. Let _trapResult_ be ? CreateListFromArrayLike(_trapResultArray_, *true*). 1. If _trapResult_ contains any duplicate entries, throw a *TypeError* exception. 1. Let _extensibleTarget_ be ? IsExtensible(_target_). 1. Let _targetKeys_ be ? _target_.[[OwnPropertyKeys]](). From afecb99a04a109e44651052bc17240ffd2b1a079 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 5 Sep 2024 15:32:46 -0700 Subject: [PATCH 44/49] Editorial: avoid "The Type of" (#3410) --- spec.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec.html b/spec.html index bf5a1f9535..07e21a380d 100644 --- a/spec.html +++ b/spec.html @@ -3147,7 +3147,7 @@

        [[GetOwnProperty]] ( _P_ )

        The normal return type is either Property Descriptor or Undefined.
      • - If the Type of the return value is Property Descriptor, the return value must be a fully populated Property Descriptor. + If the return value is a Property Descriptor, it must be a fully populated Property Descriptor.
      • If _P_ is described as a non-configurable, non-writable own data property, all future calls to [[GetOwnProperty]] ( _P_ ) must return Property Descriptor whose [[Value]] is SameValue as _P_'s [[Value]] attribute. @@ -3236,7 +3236,7 @@

        [[OwnPropertyKeys]] ( )

        The returned List must not contain any duplicate entries.
      • - The Type of each element of the returned List is either String or Symbol. + Each element of the returned List must be a property key.
      • The returned List must contain at least the keys of all non-configurable own properties that have previously been observed. @@ -15921,7 +15921,7 @@

        [[OwnPropertyKeys]] ( ): either a normal completion containing a List of pro The returned List contains no duplicate entries.

      • - The Type of each result List element is either String or Symbol. + Each element of the returned List is a property key.
      • The result List must contain the keys of all non-configurable own properties of the target object. From 92aa8e08cd014e0bddff46c00e11023b893490ff Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Thu, 5 Sep 2024 21:56:45 -0400 Subject: [PATCH 45/49] Editorial: Quick fixes for CreateListFromArrayLike (#3419) - When an operation has an optional parameter X, the op doesn't do anything with X until either: - it has established that a value was passed to X, or - it has established that a value wasn't passed to X, and has set X to some value. --- spec.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec.html b/spec.html index 07e21a380d..21c038784a 100644 --- a/spec.html +++ b/spec.html @@ -6471,7 +6471,7 @@

        CreateListFromArrayLike ( _obj_: an ECMAScript language value, - optional _requirePropertyKeys_: a boolean, + optional _validElementTypes_: ~all~ or ~property-key~, ): either a normal completion containing a List of ECMAScript language values or a throw completion

        @@ -6479,6 +6479,7 @@

        It is used to create a List value whose elements are provided by the indexed properties of _obj_. _elementTypes_ contains the names of ECMAScript Language Types that are allowed for element values of the List that is created.

        + 1. If _validElementTypes_ is not present, set _validElementTypes_ to ~all~. 1. If _obj_ is not an Object, throw a *TypeError* exception. 1. Let _len_ be ? LengthOfArrayLike(_obj_). 1. Let _list_ be a new empty List. @@ -6486,7 +6487,7 @@

        1. Repeat, while _index_ < _len_, 1. Let _indexName_ be ! ToString(𝔽(_index_)). 1. Let _next_ be ? Get(_obj_, _indexName_). - 1. If _requirePropertyKeys_ is *true* and _next_ is not a property key, throw a *TypeError* exception. + 1. If _validElementTypes_ is ~property-key~ and _next_ is not a property key, throw a *TypeError* exception. 1. Append _next_ to _list_. 1. Set _index_ to _index_ + 1. 1. Return _list_. @@ -15884,7 +15885,7 @@

        [[OwnPropertyKeys]] ( ): either a normal completion containing a List of pro 1. If _trap_ is *undefined*, then 1. Return ? _target_.[[OwnPropertyKeys]](). 1. Let _trapResultArray_ be ? Call(_trap_, _handler_, « _target_ »). - 1. Let _trapResult_ be ? CreateListFromArrayLike(_trapResultArray_, *true*). + 1. Let _trapResult_ be ? CreateListFromArrayLike(_trapResultArray_, ~property-key~). 1. If _trapResult_ contains any duplicate entries, throw a *TypeError* exception. 1. Let _extensibleTarget_ be ? IsExtensible(_target_). 1. Let _targetKeys_ be ? _target_.[[OwnPropertyKeys]](). From 579e0d2892c35c8d5bb45fecad0bcb19a2c664d4 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Fri, 6 Sep 2024 13:08:40 -0700 Subject: [PATCH 46/49] Editorial: `ApplyStringOrNumericBinaryOperator`: refactor into two explicit tables (#3420) --- spec.html | 73 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 44 insertions(+), 29 deletions(-) diff --git a/spec.html b/spec.html index 21c038784a..7d72456fe8 100644 --- a/spec.html +++ b/spec.html @@ -20689,35 +20689,50 @@

        1. If _opText_ is `/`, return ? BigInt::divide(_lNum_, _rNum_). 1. If _opText_ is `%`, return ? BigInt::remainder(_lNum_, _rNum_). 1. If _opText_ is `>>>`, return ? BigInt::unsignedRightShift(_lNum_, _rNum_). - 1. Let _operation_ be the abstract operation associated with _opText_ and Type(_lNum_) in the following table: -
        - -

      • - Internal Slot - - Type - - Description -
        + Internal Slot + + Type + + Description +
        [[GeneratorState]] @@ -48179,11 +48325,13 @@

        Properties of AsyncGenerator Instances

        AsyncGenerator instances are initially created with the internal slots described below:

        - - - - - + + + + + + + @@ -48217,11 +48365,13 @@

        AsyncGeneratorRequest Records

        They have the following fields:

        Internal SlotTypeDescription
        Internal SlotTypeDescription
        [[AsyncGeneratorState]] *undefined*, ~suspended-start~, ~suspended-yield~, ~executing~, ~awaiting-return~, or ~completed~
        - - - - - + + + + + + + @@ -48947,11 +49097,13 @@

        Memory Model Fundamentals

        Field NameValueMeaning
        Field NameValueMeaning
        [[Completion]] a Completion Record
        - - - - - + + + + + + + @@ -48982,11 +49134,13 @@

        Memory Model Fundamentals

        Field NameValueMeaning
        Field NameValueMeaning
        [[Order]] ~seq-cst~ or ~unordered~
        - - - - - + + + + + + + @@ -49022,11 +49176,13 @@

        Memory Model Fundamentals

        Field NameValueMeaning
        Field NameValueMeaning
        [[Order]] ~seq-cst~, ~unordered~, or ~init~
        - - - - - + + + + + + + @@ -49080,11 +49236,13 @@

        Agent Events Records

        An Agent Events Record is a Record with the following fields.

        Field NameValueMeaning
        Field NameValueMeaning
        [[Order]] ~seq-cst~
        - - - - - + + + + + + + @@ -49109,11 +49267,13 @@

        Chosen Value Records

        A Chosen Value Record is a Record with the following fields.

        Field NameValueMeaning
        Field NameValueMeaning
        [[AgentSignifier]] an agent signifier
        - - - - - + + + + + + + @@ -49133,11 +49293,13 @@

        Candidate Executions

        A candidate execution of the evaluation of an agent cluster is a Record with the following fields.

        Field NameValueMeaning
        Field NameValueMeaning
        [[Event]] a Shared Data Block event
        - - - - - + + + + + + + @@ -50358,17 +50520,19 @@

        Additional Properties of the Global Object

        The entries in are added to .

        Field NameValueMeaning
        Field NameValueMeaning
        [[EventsRecords]] a List of Agent Events Records
        - - - - - + + + + + + +
        - Intrinsic Name - - Global Name - - ECMAScript Language Association -
        + Intrinsic Name + + Global Name + + ECMAScript Language Association +
        %escape% From 4e32b345d044e3b6a4a737ef9c4396942e2597e7 Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Wed, 5 Jun 2024 22:44:23 -0700 Subject: [PATCH 10/49] Editorial: Replace `IsIntegralNumber` with `is an integral Number` (#3344) Also, add "finite" to the definition of "integral Number". --- spec.html | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/spec.html b/spec.html index 8e605cc2e4..d182f4d537 100644 --- a/spec.html +++ b/spec.html @@ -1056,7 +1056,7 @@

        Mathematical Operations

        In the language of this specification, numerical values are distinguished among different numeric kinds using subscript suffixes. The subscript 𝔽 refers to Numbers, and the subscript refers to BigInts. Numeric values without a subscript suffix refer to mathematical values. This specification denotes most numeric values in base 10; it also uses numeric values of the form 0x followed by digits 0-9 or A-F as base-16 values.

        In general, when this specification refers to a numerical value, such as in the phrase, "the length of _y_" or "the integer represented by the four hexadecimal digits ...", without explicitly specifying a numeric kind, the phrase refers to a mathematical value. Phrases which refer to a Number or a BigInt value are explicitly annotated as such; for example, "the Number value for the number of code points in …" or "the BigInt value for …".

        -

        When the term integer is used in this specification, it refers to a mathematical value which is in the set of integers, unless otherwise stated. When the term integral Number is used in this specification, it refers to a Number value whose mathematical value is in the set of integers.

        +

        When the term integer is used in this specification, it refers to a mathematical value which is in the set of integers, unless otherwise stated. When the term integral Number is used in this specification, it refers to a finite Number value whose mathematical value is in the set of integers.

        Numeric operators such as +, ×, =, and ≥ refer to those operations as determined by the type of the operands. When applied to mathematical values, the operators refer to the usual mathematical operations. When applied to extended mathematical values, the operators refer to the usual mathematical operations over the extended real numbers; indeterminate forms are not defined and their use in this specification should be considered an editorial error. When applied to Numbers, the operators refer to the relevant operations within IEEE 754-2019. When applied to BigInts, the operators refer to the usual mathematical operations applied to the mathematical value of the BigInt. Numeric operators applied to mixed-type operands (such as a Number and a mathematical value) are not defined and should be considered an editorial error in this specification.

        Conversions between mathematical values and Numbers or BigInts are always explicit in this document. A conversion from a mathematical value or extended mathematical value _x_ to a Number is denoted as "the Number value for _x_" or 𝔽(_x_), and is defined in . A conversion from an integer _x_ to a BigInt is denoted as "the BigInt value for _x_" or ℤ(_x_). A conversion from a Number or BigInt _x_ to a mathematical value is denoted as "the mathematical value of _x_", or ℝ(_x_). The mathematical value of *+0*𝔽 and *-0*𝔽 is the mathematical value 0. The mathematical value of non-finite values is not defined. The extended mathematical value of _x_ is the mathematical value of _x_ for finite values, and is +∞ and -∞ for *+∞*𝔽 and *-∞*𝔽 respectively; it is not defined for *NaN*.

        The mathematical function abs(_x_) produces the absolute value of _x_, which is -_x_ if _x_ < 0 and otherwise is _x_ itself.

        @@ -5809,24 +5809,6 @@

        - -

        - IsIntegralNumber ( - _argument_: an ECMAScript language value, - ): a Boolean -

        -
        -
        description
        -
        It determines if _argument_ is a finite integral Number value.
        -
        - - 1. If _argument_ is not a Number, return *false*. - 1. If _argument_ is not finite, return *false*. - 1. If truncate(ℝ(_argument_)) ≠ ℝ(_argument_), return *false*. - 1. Return *true*. - -
        -

        IsRegExp ( @@ -14297,7 +14279,7 @@

        1. If _P_ is not a String, return *undefined*. 1. Let _index_ be CanonicalNumericIndexString(_P_). 1. If _index_ is *undefined*, return *undefined*. - 1. If IsIntegralNumber(_index_) is *false*, return *undefined*. + 1. If _index_ is not an integral Number, return *undefined*. 1. If _index_ is *-0*𝔽, return *undefined*. 1. Let _str_ be _S_.[[StringData]]. 1. Assert: _str_ is a String. @@ -14892,7 +14874,7 @@

        1. If IsDetachedBuffer(_O_.[[ViewedArrayBuffer]]) is *true*, return *false*. - 1. If IsIntegralNumber(_index_) is *false*, return *false*. + 1. If _index_ is not an integral Number, return *false*. 1. If _index_ is *-0*𝔽, return *false*. 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_O_, ~unordered~). 1. NOTE: Bounds checking is not a synchronizing operation when _O_'s backing buffer is a growable SharedArrayBuffer. @@ -31279,7 +31261,8 @@

        Number.isFinite ( _number_ )

        Number.isInteger ( _number_ )

        This function performs the following steps when called:

        - 1. Return IsIntegralNumber(_number_). + 1. If _number_ is an integral Number, return *true*. + 1. Return *false*. @@ -31303,7 +31286,7 @@

        Number.isSafeInteger ( _number_ )

        This function performs the following steps when called:

        - 1. If IsIntegralNumber(_number_) is *true*, then + 1. If _number_ is an integral Number, then 1. If abs(ℝ(_number_)) ≤ 253 - 1, return *true*. 1. Return *false*. @@ -31618,7 +31601,7 @@

        - 1. If IsIntegralNumber(_number_) is *false*, throw a *RangeError* exception. + 1. If _number_ is not an integral Number, throw a *RangeError* exception. 1. Return ℤ(ℝ(_number_)). @@ -34473,7 +34456,7 @@

        String.fromCodePoint ( ..._codePoints_ )

        1. Let _result_ be the empty String. 1. For each element _next_ of _codePoints_, do 1. Let _nextCP_ be ? ToNumber(_next_). - 1. If IsIntegralNumber(_nextCP_) is *false*, throw a *RangeError* exception. + 1. If _nextCP_ is not an integral Number, throw a *RangeError* exception. 1. If ℝ(_nextCP_) < 0 or ℝ(_nextCP_) > 0x10FFFF, throw a *RangeError* exception. 1. Set _result_ to the string-concatenation of _result_ and UTF16EncodeCodePoint(ℝ(_nextCP_)). 1. Assert: If _codePoints_ is empty, then _result_ is the empty String. From 6363c2dd4ed0f85066281c2528a51ec027ad2605 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Wed, 26 Jun 2024 15:23:54 -0700 Subject: [PATCH 11/49] Normative: handle broken promises in AsyncGenerator.prototype.return (#2683) --- spec.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spec.html b/spec.html index d182f4d537..9fc41b4652 100644 --- a/spec.html +++ b/spec.html @@ -48562,7 +48562,14 @@

        1. Let _next_ be the first element of _queue_. 1. Let _completion_ be Completion(_next_.[[Completion]]). 1. Assert: _completion_ is a return completion. - 1. Let _promise_ be ? PromiseResolve(%Promise%, _completion_.[[Value]]). + 1. Let _promiseCompletion_ be Completion(PromiseResolve(%Promise%, _completion_.[[Value]])). + 1. If _promiseCompletion_ is an abrupt completion, then + 1. Set _generator_.[[AsyncGeneratorState]] to ~completed~. + 1. Perform AsyncGeneratorCompleteStep(_generator_, _promiseCompletion_, *true*). + 1. Perform AsyncGeneratorDrainQueue(_generator_). + 1. Return ~unused~. + 1. Assert: _promiseCompletion_ is a normal completion. + 1. Let _promise_ be _promiseCompletion_.[[Value]]. 1. Let _fulfilledClosure_ be a new Abstract Closure with parameters (_value_) that captures _generator_ and performs the following steps when called: 1. Set _generator_.[[AsyncGeneratorState]] to ~completed~. 1. Let _result_ be NormalCompletion(_value_). From 32e88095ea8fcd4897b879807d7c58e12c62ceae Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Wed, 26 Jun 2024 15:24:00 -0700 Subject: [PATCH 12/49] Editorial: AsyncGeneratorAwaitReturn does not throw (#2683) --- spec.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec.html b/spec.html index 9fc41b4652..46b38e094b 100644 --- a/spec.html +++ b/spec.html @@ -48263,7 +48263,7 @@

        %AsyncGeneratorPrototype%.return ( _value_ )

        1. Let _state_ be _generator_.[[AsyncGeneratorState]]. 1. If _state_ is either ~suspended-start~ or ~completed~, then 1. Set _generator_.[[AsyncGeneratorState]] to ~awaiting-return~. - 1. Perform ! AsyncGeneratorAwaitReturn(_generator_). + 1. Perform AsyncGeneratorAwaitReturn(_generator_). 1. Else if _state_ is ~suspended-yield~, then 1. Perform AsyncGeneratorResume(_generator_, _completion_). 1. Else, @@ -48552,7 +48552,7 @@

        AsyncGeneratorAwaitReturn ( _generator_: an AsyncGenerator, - ): either a normal completion containing ~unused~ or a throw completion + ): ~unused~

        @@ -48609,7 +48609,7 @@

        1. Let _completion_ be Completion(_next_.[[Completion]]). 1. If _completion_ is a return completion, then 1. Set _generator_.[[AsyncGeneratorState]] to ~awaiting-return~. - 1. Perform ! AsyncGeneratorAwaitReturn(_generator_). + 1. Perform AsyncGeneratorAwaitReturn(_generator_). 1. Set _done_ to *true*. 1. Else, 1. If _completion_ is a normal completion, then From 773782efc3b8b1ff6b8c598d32dcdb82fcbbcf7a Mon Sep 17 00:00:00 2001 From: Michael Dyck Date: Wed, 26 Jun 2024 15:27:28 -0700 Subject: [PATCH 13/49] Editorial: Change some `X is Y` to `SameValue(X, Y) is *true*` (#3340) (apply editorial convention to recently-merged PR #3337) --- spec.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/spec.html b/spec.html index 46b38e094b..25bf97edec 100644 --- a/spec.html +++ b/spec.html @@ -41908,7 +41908,7 @@

        Map.prototype.delete ( _key_ )

        1. Perform ? RequireInternalSlot(_M_, [[MapData]]). 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). 1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[MapData]], do - 1. If _p_.[[Key]] is not ~empty~ and _p_.[[Key]] is _key_, then + 1. If _p_.[[Key]] is not ~empty~ and SameValue(_p_.[[Key]], _key_) is *true*, then 1. Set _p_.[[Key]] to ~empty~. 1. Set _p_.[[Value]] to ~empty~. 1. Return *true*. @@ -41963,7 +41963,7 @@

        Map.prototype.get ( _key_ )

        1. Perform ? RequireInternalSlot(_M_, [[MapData]]). 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). 1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[MapData]], do - 1. If _p_.[[Key]] is not ~empty~ and _p_.[[Key]] is _key_, return _p_.[[Value]]. + 1. If _p_.[[Key]] is not ~empty~ and SameValue(_p_.[[Key]], _key_) is *true*, return _p_.[[Value]]. 1. Return *undefined*. @@ -41976,7 +41976,7 @@

        Map.prototype.has ( _key_ )

        1. Perform ? RequireInternalSlot(_M_, [[MapData]]). 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). 1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[MapData]], do - 1. If _p_.[[Key]] is not ~empty~ and _p_.[[Key]] is _key_, return *true*. + 1. If _p_.[[Key]] is not ~empty~ and SameValue(_p_.[[Key]], _key_) is *true*, return *true*. 1. Return *false*. @@ -41998,7 +41998,7 @@

        Map.prototype.set ( _key_, _value_ )

        1. Perform ? RequireInternalSlot(_M_, [[MapData]]). 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). 1. For each Record { [[Key]], [[Value]] } _p_ of _M_.[[MapData]], do - 1. If _p_.[[Key]] is not ~empty~ and _p_.[[Key]] is _key_, then + 1. If _p_.[[Key]] is not ~empty~ and SameValue(_p_.[[Key]], _key_) is *true*, then 1. Set _p_.[[Value]] to _value_. 1. Return _M_. 1. Let _p_ be the Record { [[Key]]: _key_, [[Value]]: _value_ }. @@ -42339,7 +42339,7 @@

        Set.prototype.add ( _value_ )

        1. Perform ? RequireInternalSlot(_S_, [[SetData]]). 1. Set _value_ to CanonicalizeKeyedCollectionKey(_value_). 1. For each element _e_ of _S_.[[SetData]], do - 1. If _e_ is not ~empty~ and _e_ is _value_, then + 1. If _e_ is not ~empty~ and SameValue(_e_, _value_) is *true*, then 1. Return _S_. 1. Append _value_ to _S_.[[SetData]]. 1. Return _S_. @@ -42374,7 +42374,7 @@

        Set.prototype.delete ( _value_ )

        1. Perform ? RequireInternalSlot(_S_, [[SetData]]). 1. Set _value_ to CanonicalizeKeyedCollectionKey(_value_). 1. For each element _e_ of _S_.[[SetData]], do - 1. If _e_ is not ~empty~ and _e_ is _value_, then + 1. If _e_ is not ~empty~ and SameValue(_e_, _value_) is *true*, then 1. Replace the element of _S_.[[SetData]] whose value is _e_ with an element whose value is ~empty~. 1. Return *true*. 1. Return *false*. @@ -42467,7 +42467,7 @@

        Set.prototype.has ( _value_ )

        1. Perform ? RequireInternalSlot(_S_, [[SetData]]). 1. Set _value_ to CanonicalizeKeyedCollectionKey(_value_). 1. For each element _e_ of _S_.[[SetData]], do - 1. If _e_ is not ~empty~ and _e_ is _value_, return *true*. + 1. If _e_ is not ~empty~ and SameValue(_e_, _value_) is *true*, return *true*. 1. Return *false*. From b5097875532b0487049cf5f66f0a3e10f0c1af7e Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Wed, 26 Jun 2024 15:38:57 -0700 Subject: [PATCH 14/49] Markup: also insert snapshot warning in multipage (#3348) --- scripts/insert_snapshot_warning.js | 35 +++++++++++++++++++----------- scripts/snapshot_warning.html | 10 +++++++++ 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/scripts/insert_snapshot_warning.js b/scripts/insert_snapshot_warning.js index e2d02e6bfc..92b0f48cc3 100644 --- a/scripts/insert_snapshot_warning.js +++ b/scripts/insert_snapshot_warning.js @@ -2,7 +2,7 @@ const fs = require('fs'); const path = require('path'); -const { JSDOM } = require('jsdom'); +const { JSDOM, VirtualConsole } = require('jsdom'); const { execSync } = require('child_process'); const COMMIT = String(execSync('git rev-parse --verify HEAD')).trim(); @@ -13,21 +13,30 @@ const WARNING_CSS = fs.readFileSync(path.join(__dirname, 'snapshot_warning.css') console.log('Inserting snapshot reference warning...'); -JSDOM.fromFile('./out/index.html', { contentType: 'text/html; charset=utf-8' }).then((dom) => { - const { document } = dom.window; +const virtualConsole = new VirtualConsole(); +virtualConsole.on('error', () => { + // Suppress warnings from e.g. CSS features not supported by JSDOM +}); - const style = document.createElement('style'); - style.textContent = WARNING_CSS; - document.head.append(style); +(async () => { + let files = ['out/index.html', ...fs.readdirSync('out/multipage').filter(f => f.endsWith('.html')).map(f => 'out/multipage/' + f)]; + for (let file of files) { + console.log(file); + let dom = await JSDOM.fromFile(file, { contentType: 'text/html; charset=utf-8', virtualConsole }); + const { document } = dom.window; - // insert WARNING_HTML in beginning of body so it renders - // first even on slower devices and browsers - document.body.insertAdjacentHTML('afterbegin', WARNING_HTML); + const style = document.createElement('style'); + style.textContent = WARNING_CSS; + document.head.append(style); - fs.writeFileSync('./out/index.html', dom.serialize(), 'utf8'); + // insert WARNING_HTML in beginning of body so it renders + // first even on slower devices and browsers + document.body.insertAdjacentHTML('afterbegin', WARNING_HTML); + fs.writeFileSync(file, dom.serialize(), 'utf8'); + } console.log('Done!'); -}).catch((reason) => { - console.error(reason); - process.exitCode = 1; +})().catch(e => { + console.error(e); + process.exit(1); }); diff --git a/scripts/snapshot_warning.html b/scripts/snapshot_warning.html index 3e2043ea2f..e0e3108b76 100644 --- a/scripts/snapshot_warning.html +++ b/scripts/snapshot_warning.html @@ -13,3 +13,13 @@ living specification.

        + From 2e67557bfa4c5b0ff53d27ef95c835e3909a9748 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 27 Jun 2024 09:59:22 -0700 Subject: [PATCH 15/49] Meta: update `ecmarkup` (#1314) --- package-lock.json | 9 +++++---- package.json | 4 +--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index bd2ac49ed1..c6580787fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "SEE LICENSE IN https://tc39.es/ecma262/#sec-copyright-and-software-license", "devDependencies": { - "ecmarkup": "^18.3.1", + "ecmarkup": "^19.0.0", "glob": "^7.1.6", "jsdom": "^15.0.0", "pagedjs": "^0.4.3", @@ -1243,10 +1243,11 @@ } }, "node_modules/ecmarkup": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/ecmarkup/-/ecmarkup-18.3.1.tgz", - "integrity": "sha512-ouyfwgVjtvyF9AdAQnI9krCWNE5srK90XGPym8vs6WPtjUso6Pq887DwAYBDbga9lrfwezWo5n8hGu9amYYu1g==", + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/ecmarkup/-/ecmarkup-19.0.0.tgz", + "integrity": "sha512-ncn5LXs46jPqcQSO/XdJCOOsdAvC8xT/Yebxted4qgpYWLisY4AEdOdZ4OXKgmPXGgWBqAgCSoV0obvEBEz8Hg==", "dev": true, + "license": "MIT", "dependencies": { "chalk": "^4.1.2", "command-line-args": "^5.2.0", diff --git a/package.json b/package.json index 99a69bd79c..013ffb2639 100644 --- a/package.json +++ b/package.json @@ -23,10 +23,8 @@ "author": "ECMA TC39", "license": "SEE LICENSE IN https://tc39.es/ecma262/#sec-copyright-and-software-license", "homepage": "https://tc39.es/ecma262/", - "dependencies": { - }, "devDependencies": { - "ecmarkup": "^18.3.1", + "ecmarkup": "^19.0.0", "glob": "^7.1.6", "jsdom": "^15.0.0", "pagedjs": "^0.4.3", From 3a2efec16f392294bcc5576b3b3bb695cf3c6d58 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 1 Jul 2024 14:22:43 -0500 Subject: [PATCH 16/49] Editorial: Convert @@ notation to %% notation for well-known Symbols (#1314) - this avoids a conceptual conflict with decorators, when they land --- img/figure-2.svg | 50 +++--- spec.html | 449 ++++++++++++++++++++++++----------------------- 2 files changed, 250 insertions(+), 249 deletions(-) diff --git a/img/figure-2.svg b/img/figure-2.svg index fe1ac95e65..ef20a19c0f 100644 --- a/img/figure-2.svg +++ b/img/figure-2.svg @@ -83,14 +83,14 @@ - - - + + + - Function.prototype + Function.prototype - @@hasInstance() + %Symbol.hasInstance%() apply() bind() call() @@ -104,7 +104,7 @@ %GeneratorFunction.prototype% - @@toStringTag = + %Symbol.toStringTag% = "GeneratorFunction" @@ -127,26 +127,26 @@ - - - + + + - %IteratorPrototype% + %IteratorPrototype% - @@iterator() : object + %Symbol.iterator%() : object - - - - + + + + - %GeneratorPrototype% + %GeneratorPrototype% - @@toStringTag = "Generator" + %Symbol.toStringTag% = "Generator" next() : object @@ -189,7 +189,7 @@ - + %GeneratorFunction.prototype% @@ -242,12 +242,12 @@ - - - + + + - - + + @@ -272,8 +272,8 @@ constructor prototype - - constructor + + constructor prototype diff --git a/spec.html b/spec.html index 25bf97edec..4243466322 100644 --- a/spec.html +++ b/spec.html @@ -1207,7 +1207,8 @@

        The Symbol Type

        Well-Known Symbols

        Well-known symbols are built-in Symbol values that are explicitly referenced by algorithms of this specification. They are typically used as the keys of properties whose values serve as extension points of a specification algorithm. Unless otherwise specified, well-known symbols values are shared by all realms ().

        -

        Within this specification a well-known symbol is referred to by using a notation of the form @@name, where “name” is one of the values listed in .

        +

        Within this specification a well-known symbol is referred to using the standard intrinsic notation where the intrinsic is one of the values listed in .

        + Previous editions of this specification used a notation of the form @@name, where the current edition would use `%Symbol.name%`. In particular, the following names were used: @@asyncIterator, @@hasInstance, @@isConcatSpreadable, @@iterator, @@match, @@matchAll, @@replace, @@search, @@species, @@split, @@toPrimitive, @@toStringTag, and @@unscopables. @@ -1225,7 +1226,7 @@

        Well-Known Symbols

        - + @@ -46377,8 +46378,8 @@

        The %IteratorPrototype% Object

        Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))
        - -

        %IteratorPrototype% [ @@iterator ] ( )

        + +

        %IteratorPrototype% [ %Symbol.iterator% ] ( )

        This function performs the following steps when called:

        1. Return the *this* value. @@ -46398,8 +46399,8 @@

        The %AsyncIteratorPrototype% Object

        All objects defined in this specification that implement the AsyncIterator interface also inherit from %AsyncIteratorPrototype%. ECMAScript code may also define objects that inherit from %AsyncIteratorPrototype%. The %AsyncIteratorPrototype% object provides a place where additional methods that are applicable to all async iterator objects may be added.

        - -

        %AsyncIteratorPrototype% [ @@asyncIterator ] ( )

        + +

        %AsyncIteratorPrototype% [ %Symbol.asyncIterator% ] ( )

        This function performs the following steps when called:

        1. Return the *this* value. @@ -47472,15 +47473,15 @@

        Promise.withResolvers ( )

        - -

        get Promise [ @@species ]

        -

        `Promise[@@species]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

        + +

        get Promise [ %Symbol.species% ]

        +

        `Promise[%Symbol.species%]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

        1. Return the *this* value.

        The value of the *"name"* property of this function is *"get [Symbol.species]"*.

        -

        Promise prototype methods normally use their *this* value's constructor to create a derived object. However, a subclass constructor may over-ride that default behaviour by redefining its @@species property.

        +

        Promise prototype methods normally use their *this* value's constructor to create a derived object. However, a subclass constructor may over-ride that default behaviour by redefining its %Symbol.species% property.

        @@ -47601,9 +47602,9 @@

        - -

        Promise.prototype [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"Promise"*.

        + +

        Promise.prototype [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"Promise"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -47758,9 +47759,9 @@

        GeneratorFunction.prototype.prototype

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        - -

        GeneratorFunction.prototype [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"GeneratorFunction"*.

        + +

        GeneratorFunction.prototype [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"GeneratorFunction"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -47860,9 +47861,9 @@

        AsyncGeneratorFunction.prototype.prototype

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        - -

        AsyncGeneratorFunction.prototype [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"AsyncGeneratorFunction"*.

        + +

        AsyncGeneratorFunction.prototype [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"AsyncGeneratorFunction"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -47943,9 +47944,9 @@

        %GeneratorPrototype%.throw ( _exception_ )

        - -

        %GeneratorPrototype% [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"Generator"*.

        + +

        %GeneratorPrototype% [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"Generator"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -48296,9 +48297,9 @@

        %AsyncGeneratorPrototype%.throw ( _exception_ )

        - -

        %AsyncGeneratorPrototype% [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"AsyncGenerator"*.

        + +

        %AsyncGeneratorPrototype% [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"AsyncGenerator"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -48719,10 +48720,10 @@

        AsyncFunction.prototype.constructor

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        - -

        AsyncFunction.prototype [ @@toStringTag ]

        + +

        AsyncFunction.prototype [ %Symbol.toStringTag% ]

        -

        The initial value of the @@toStringTag property is the String value *"AsyncFunction"*.

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"AsyncFunction"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -48991,9 +48992,9 @@

        Reflect.setPrototypeOf ( _target_, _proto_ )

        - -

        Reflect [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"Reflect"*.

        + +

        Reflect [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"Reflect"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -49061,9 +49062,9 @@

        Module Namespace Objects

        A Module Namespace Object is a module namespace exotic object that provides runtime property-based access to a module's exported bindings. There is no constructor function for Module Namespace Objects. Instead, such an object is created for each module that is imported by an |ImportDeclaration| that contains a |NameSpaceImport|.

        In addition to the properties specified in each Module Namespace Object has the following own property:

        - -

        @@toStringTag

        -

        The initial value of the @@toStringTag property is the String value *"Module"*.

        + +

        %Symbol.toStringTag%

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"Module"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        @@ -51367,7 +51368,7 @@

        Corrections and Clarifications in ECMAScript 2015 with Possible Compatibilit

        : If the year cannot be represented using the Date Time String Format specified in a RangeError exception is thrown. Previous editions did not specify the behaviour for that case.

        : Previous editions did not specify the value returned by `Date.prototype.toString` when the time value is *NaN*. ECMAScript 2015 specifies the result to be the String value *"Invalid Date"*.

        , : Any LineTerminator code points in the value of the *"source"* property of a RegExp instance must be expressed using an escape sequence. Edition 5.1 only required the escaping of `/`.

        -

        , : In previous editions, the specifications for `String.prototype.match` and `String.prototype.replace` was incorrect for cases where the pattern argument was a RegExp value whose `global` flag is set. The previous specifications stated that for each attempt to match the pattern, if `lastIndex` did not change, it should be incremented by 1. The correct behaviour is that `lastIndex` should be incremented by 1 only if the pattern matched the empty String.

        +

        , : In previous editions, the specifications for `String.prototype.match` and `String.prototype.replace` was incorrect for cases where the pattern argument was a RegExp value whose `global` flag is set. The previous specifications stated that for each attempt to match the pattern, if `lastIndex` did not change, it should be incremented by 1. The correct behaviour is that `lastIndex` should be incremented by 1 only if the pattern matched the empty String.

        : Previous editions did not specify how a *NaN* value returned by a _comparefn_ was interpreted by `Array.prototype.sort`. ECMAScript 2015 specifies that such as value is treated as if *+0*𝔽 was returned from the _comparefn_. ECMAScript 2015 also specifies that ToNumber is applied to the result returned by a _comparefn_. In previous editions, the effect of a _comparefn_ result that is not a Number value was implementation-defined. In practice, implementations call ToNumber.

        From e3692a9326018a5933c3ed6da414d32ac9b9e099 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Tue, 2 Jul 2024 15:47:36 -0500 Subject: [PATCH 17/49] Meta: check IPR form script: use a long SHA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit local git‘s short SHA was shorter than github‘s short SHA, breaking the API call --- scripts/check-form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/check-form.js b/scripts/check-form.js index 2282f62540..2c1dd9c2ac 100644 --- a/scripts/check-form.js +++ b/scripts/check-form.js @@ -28,7 +28,7 @@ if (typeof all !== 'undefined' && all !== '--all') { throw '`all` arg, if provided, must be `--all`' } -const sha = String(execSync(`git rev-parse --short ${branch}`)).trim(); +const sha = String(execSync(`git rev-parse ${branch}`)).trim(); const request = async (url, method = 'GET', postData) => { // adapted from https://medium.com/@gevorggalstyan/how-to-promisify-node-js-http-https-requests-76a5a58ed90c From 7d0b1999d175ae52e8cbc0c3119db3d603f76fef Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Tue, 9 Jul 2024 14:59:29 -0700 Subject: [PATCH 18/49] Editorial: remove some unnecessary "the result of" phrasing (#3346) --- spec.html | 55 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/spec.html b/spec.html index 4243466322..61bf21b9b1 100644 --- a/spec.html +++ b/spec.html @@ -1867,7 +1867,7 @@

        1. If _x_ is *NaN*, return *NaN*. - 1. Return the result of negating _x_; that is, compute a Number with the same magnitude but opposite sign. + 1. Return the negation of _x_; that is, compute a Number with the same magnitude but opposite sign. @@ -1881,7 +1881,7 @@

        1. Let _oldValue_ be ! ToInt32(_x_). - 1. Return the result of applying bitwise complement to _oldValue_. The mathematical value of the result is exactly representable as a 32-bit two's complement bit string. + 1. Return the bitwise complement of _oldValue_. The mathematical value of the result is exactly representable as a 32-bit two's complement bit string. @@ -5620,7 +5620,7 @@

        description
        -
        If _argument_ is either *"-0"* or exactly matches the result of ToString(_n_) for some Number value _n_, it returns the respective Number value. Otherwise, it returns *undefined*.
        +
        If _argument_ is either *"-0"* or exactly matches ToString(_n_) for some Number value _n_, it returns the respective Number value. Otherwise, it returns *undefined*.
        1. If _argument_ is *"-0"*, return *-0*𝔽. @@ -31833,7 +31833,7 @@

        Math.acos ( _x_ )

        1. Let _n_ be ? ToNumber(_x_). 1. If _n_ is *NaN*, _n_ > *1*𝔽, or _n_ < *-1*𝔽, return *NaN*. 1. If _n_ is *1*𝔽, return *+0*𝔽. - 1. Return an implementation-approximated Number value representing the result of the inverse cosine of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the inverse cosine of ℝ(_n_).
        @@ -31846,7 +31846,7 @@

        Math.acosh ( _x_ )

        1. If _n_ is either *NaN* or *+∞*𝔽, return _n_. 1. If _n_ is *1*𝔽, return *+0*𝔽. 1. If _n_ < *1*𝔽, return *NaN*. - 1. Return an implementation-approximated Number value representing the result of the inverse hyperbolic cosine of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the inverse hyperbolic cosine of ℝ(_n_). @@ -31858,7 +31858,7 @@

        Math.asin ( _x_ )

        1. Let _n_ be ? ToNumber(_x_). 1. If _n_ is one of *NaN*, *+0*𝔽, or *-0*𝔽, return _n_. 1. If _n_ > *1*𝔽 or _n_ < *-1*𝔽, return *NaN*. - 1. Return an implementation-approximated Number value representing the result of the inverse sine of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the inverse sine of ℝ(_n_). @@ -31869,7 +31869,7 @@

        Math.asinh ( _x_ )

        1. Let _n_ be ? ToNumber(_x_). 1. If _n_ is not finite or _n_ is either *+0*𝔽 or *-0*𝔽, return _n_. - 1. Return an implementation-approximated Number value representing the result of the inverse hyperbolic sine of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the inverse hyperbolic sine of ℝ(_n_). @@ -31882,7 +31882,7 @@

        Math.atan ( _x_ )

        1. If _n_ is one of *NaN*, *+0*𝔽, or *-0*𝔽, return _n_. 1. If _n_ is *+∞*𝔽, return an implementation-approximated Number value representing π / 2. 1. If _n_ is *-∞*𝔽, return an implementation-approximated Number value representing -π / 2. - 1. Return an implementation-approximated Number value representing the result of the inverse tangent of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the inverse tangent of ℝ(_n_). @@ -31896,7 +31896,7 @@

        Math.atanh ( _x_ )

        1. If _n_ > *1*𝔽 or _n_ < *-1*𝔽, return *NaN*. 1. If _n_ is *1*𝔽, return *+∞*𝔽. 1. If _n_ is *-1*𝔽, return *-∞*𝔽. - 1. Return an implementation-approximated Number value representing the result of the inverse hyperbolic tangent of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the inverse hyperbolic tangent of ℝ(_n_). @@ -31949,7 +31949,7 @@

        Math.cbrt ( _x_ )

        1. Let _n_ be ? ToNumber(_x_). 1. If _n_ is not finite or _n_ is either *+0*𝔽 or *-0*𝔽, return _n_. - 1. Return an implementation-approximated Number value representing the result of the cube root of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the cube root of ℝ(_n_). @@ -31990,7 +31990,7 @@

        Math.cos ( _x_ )

        1. Let _n_ be ? ToNumber(_x_). 1. If _n_ is not finite, return *NaN*. 1. If _n_ is either *+0*𝔽 or *-0*𝔽, return *1*𝔽. - 1. Return an implementation-approximated Number value representing the result of the cosine of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the cosine of ℝ(_n_). @@ -32003,7 +32003,7 @@

        Math.cosh ( _x_ )

        1. If _n_ is *NaN*, return *NaN*. 1. If _n_ is either *+∞*𝔽 or *-∞*𝔽, return *+∞*𝔽. 1. If _n_ is either *+0*𝔽 or *-0*𝔽, return *1*𝔽. - 1. Return an implementation-approximated Number value representing the result of the hyperbolic cosine of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the hyperbolic cosine of ℝ(_n_).

        The value of `Math.cosh(x)` is the same as the value of `(Math.exp(x) + Math.exp(-x)) / 2`.

        @@ -32019,7 +32019,7 @@

        Math.exp ( _x_ )

        1. If _n_ is either *NaN* or *+∞*𝔽, return _n_. 1. If _n_ is either *+0*𝔽 or *-0*𝔽, return *1*𝔽. 1. If _n_ is *-∞*𝔽, return *+0*𝔽. - 1. Return an implementation-approximated Number value representing the result of the exponential function of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the exponential function of ℝ(_n_). @@ -32031,7 +32031,8 @@

        Math.expm1 ( _x_ )

        1. Let _n_ be ? ToNumber(_x_). 1. If _n_ is one of *NaN*, *+0*𝔽, *-0*𝔽, or *+∞*𝔽, return _n_. 1. If _n_ is *-∞*𝔽, return *-1*𝔽. - 1. Return an implementation-approximated Number value representing the result of subtracting 1 from the exponential function of ℝ(_n_). + 1. Let _exp_ be the exponential function of ℝ(_n_). + 1. Return an implementation-approximated Number value representing _exp_ - 1. @@ -32109,7 +32110,7 @@

        Math.log ( _x_ )

        1. If _n_ is *1*𝔽, return *+0*𝔽. 1. If _n_ is either *+0*𝔽 or *-0*𝔽, return *-∞*𝔽. 1. If _n_ < *-0*𝔽, return *NaN*. - 1. Return an implementation-approximated Number value representing the result of the natural logarithm of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the natural logarithm of ℝ(_n_). @@ -32122,7 +32123,7 @@

        Math.log1p ( _x_ )

        1. If _n_ is one of *NaN*, *+0*𝔽, *-0*𝔽, or *+∞*𝔽, return _n_. 1. If _n_ is *-1*𝔽, return *-∞*𝔽. 1. If _n_ < *-1*𝔽, return *NaN*. - 1. Return an implementation-approximated Number value representing the result of the natural logarithm of 1 + ℝ(_n_). + 1. Return an implementation-approximated Number value representing the natural logarithm of 1 + ℝ(_n_). @@ -32136,7 +32137,7 @@

        Math.log10 ( _x_ )

        1. If _n_ is *1*𝔽, return *+0*𝔽. 1. If _n_ is either *+0*𝔽 or *-0*𝔽, return *-∞*𝔽. 1. If _n_ < *-0*𝔽, return *NaN*. - 1. Return an implementation-approximated Number value representing the result of the base 10 logarithm of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the base 10 logarithm of ℝ(_n_). @@ -32150,7 +32151,7 @@

        Math.log2 ( _x_ )

        1. If _n_ is *1*𝔽, return *+0*𝔽. 1. If _n_ is either *+0*𝔽 or *-0*𝔽, return *-∞*𝔽. 1. If _n_ < *-0*𝔽, return *NaN*. - 1. Return an implementation-approximated Number value representing the result of the base 2 logarithm of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the base 2 logarithm of ℝ(_n_). @@ -32253,7 +32254,7 @@

        Math.sin ( _x_ )

        1. Let _n_ be ? ToNumber(_x_). 1. If _n_ is one of *NaN*, *+0*𝔽, or *-0*𝔽, return _n_. 1. If _n_ is either *+∞*𝔽 or *-∞*𝔽, return *NaN*. - 1. Return an implementation-approximated Number value representing the result of the sine of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the sine of ℝ(_n_). @@ -32264,7 +32265,7 @@

        Math.sinh ( _x_ )

        1. Let _n_ be ? ToNumber(_x_). 1. If _n_ is not finite or _n_ is either *+0*𝔽 or *-0*𝔽, return _n_. - 1. Return an implementation-approximated Number value representing the result of the hyperbolic sine of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the hyperbolic sine of ℝ(_n_).

        The value of `Math.sinh(x)` is the same as the value of `(Math.exp(x) - Math.exp(-x)) / 2`.

        @@ -32279,7 +32280,7 @@

        Math.sqrt ( _x_ )

        1. Let _n_ be ? ToNumber(_x_). 1. If _n_ is one of *NaN*, *+0*𝔽, *-0*𝔽, or *+∞*𝔽, return _n_. 1. If _n_ < *-0*𝔽, return *NaN*. - 1. Return an implementation-approximated Number value representing the result of the square root of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the square root of ℝ(_n_). @@ -32291,7 +32292,7 @@

        Math.tan ( _x_ )

        1. Let _n_ be ? ToNumber(_x_). 1. If _n_ is one of *NaN*, *+0*𝔽, or *-0*𝔽, return _n_. 1. If _n_ is either *+∞*𝔽 or *-∞*𝔽, return *NaN*. - 1. Return an implementation-approximated Number value representing the result of the tangent of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the tangent of ℝ(_n_). @@ -32304,7 +32305,7 @@

        Math.tanh ( _x_ )

        1. If _n_ is one of *NaN*, *+0*𝔽, or *-0*𝔽, return _n_. 1. If _n_ is *+∞*𝔽, return *1*𝔽. 1. If _n_ is *-∞*𝔽, return *-1*𝔽. - 1. Return an implementation-approximated Number value representing the result of the hyperbolic tangent of ℝ(_n_). + 1. Return an implementation-approximated Number value representing the hyperbolic tangent of ℝ(_n_).

        The value of `Math.tanh(x)` is the same as the value of `(Math.exp(x) - Math.exp(-x)) / (Math.exp(x) + Math.exp(-x))`.

        @@ -35267,7 +35268,7 @@

        String.prototype.toLowerCase ( )

        1. Let _O_ be ? RequireObjectCoercible(*this* value). 1. Let _S_ be ? ToString(_O_). 1. Let _sText_ be StringToCodePoints(_S_). - 1. Let _lowerText_ be the result of toLowercase(_sText_), according to the Unicode Default Case Conversion algorithm. + 1. Let _lowerText_ be toLowercase(_sText_), according to the Unicode Default Case Conversion algorithm. 1. Let _L_ be CodePointsToString(_lowerText_). 1. Return _L_. @@ -37100,7 +37101,7 @@

        1. If _rer_.[[IgnoreCase]] is *false*, return _ch_. 1. Assert: _ch_ is a UTF-16 code unit. 1. Let _cp_ be the code point whose numeric value is the numeric value of _ch_. - 1. Let _u_ be the result of toUppercase(« _cp_ »), according to the Unicode Default Case Conversion algorithm. + 1. Let _u_ be toUppercase(« _cp_ »), according to the Unicode Default Case Conversion algorithm. 1. Let _uStr_ be CodePointsToString(_u_). 1. If the length of _uStr_ ≠ 1, return _ch_. 1. Let _cu_ be _uStr_'s single code unit element. @@ -39473,7 +39474,7 @@

        Array.prototype.reduceRight ( _callbackfn_ [ , _initialValue_ ] )

        Array.prototype.reverse ( )

        -

        This method rearranges the elements of the array so as to reverse their order. It returns the object as the result of the call.

        +

        This method rearranges the elements of the array so as to reverse their order. It returns the reversed array.

        This method performs the following steps when called:

        @@ -45080,7 +45081,7 @@

        description
        -
        _op_ takes two List of byte values arguments and returns a List of byte values. This operation atomically loads a value, combines it with another value, and stores the result of the combination. It returns the loaded value.
        +
        _op_ takes two List of byte values arguments and returns a List of byte values. This operation atomically loads a value, combines it with another value, and stores the combination. It returns the loaded value.
        1. Let _byteIndexInBuffer_ be ? ValidateAtomicAccessOnIntegerTypedArray(_typedArray_, _index_). From efd583da434bdb662cca408d1781974c9761828c Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Wed, 10 Jul 2024 22:31:01 -0700 Subject: [PATCH 19/49] Editorial: create and assign [[PrivateElements]] slot in MakeBasicObject (#3365) --- spec.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec.html b/spec.html index 61bf21b9b1..68b2888f10 100644 --- a/spec.html +++ b/spec.html @@ -6055,7 +6055,9 @@

        + 1. Set _internalSlotsList_ to the list-concatenation of _internalSlotsList_ and « [[PrivateElements]] ». 1. Let _obj_ be a newly created object with an internal slot for each name in _internalSlotsList_. + 1. Set _obj_.[[PrivateElements]] to a new empty List. 1. Set _obj_'s essential internal methods to the default ordinary object definitions specified in . 1. Assert: If the caller will not be overriding both _obj_'s [[GetPrototypeOf]] and [[SetPrototypeOf]] essential internal methods, then _internalSlotsList_ contains [[Prototype]]. 1. Assert: If the caller will not be overriding all of _obj_'s [[SetPrototypeOf]], [[IsExtensible]], and [[PreventExtensions]] essential internal methods, then _internalSlotsList_ contains [[Extensible]]. From 7a23e0e83597e4c8cfbbc1856a77cf8fc102e846 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Wed, 10 Jul 2024 22:35:02 -0700 Subject: [PATCH 20/49] Markup: unlink Invoke in the Jobs section (#3369) --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index 68b2888f10..e96f6b8795 100644 --- a/spec.html +++ b/spec.html @@ -11921,7 +11921,7 @@

        Jobs and Host Operations to Enqueue Jobs

      • At some future point in time, when there is no running context in the agent for which the job is scheduled and that agent's execution context stack is empty, the implementation must:
        1. Perform any host-defined preparation steps.
        2. -
        3. Invoke the Job Abstract Closure.
        4. +
        5. Invoke the Job Abstract Closure.
        6. Perform any host-defined cleanup steps, after which the execution context stack must be empty.
      • From e7f1e5d729f92dacbbae19be46591ccee22807f6 Mon Sep 17 00:00:00 2001 From: Justin Grant Date: Wed, 17 Jul 2024 10:33:45 -0700 Subject: [PATCH 21/49] Normative: Revert U+2212 in timezone offsets (#3334) Following ISO-8601, #2781 introduced U+2212 (Unicode minus) as an alias for the regular ASCII minus sign for use in time zone offsets. There's two new data that lead me to believe that this was a mistake, and that we should revert this change. The first is that the newly-released RFC 9557 (the string format standard that Temporal uses) disallows non-ASCII characters. Its predecessor RFC 3339 also disallows non-ASCII characters. So strings that follow the current (since 2022) ECMAScript spec could be rejected by RFC 9557 clients. The second new data is feedback from implementers of a Rust version of Temporal that this single obscure character in the grammar will incur a performance cost because they must now use Rust strings instead of plain U8 ASCII data. See https://github.com/tc39/proposal-temporal/issues/2843#issuecomment-2119724671 This performance issue doesn't seem to be limited to Rust. Any native implementation would likely benefit from being able to know that valid date/time input (both Date and Temporal) is always ASCII-only. I don't know whether all engines have actually implemented this 2022 grammar change. But it's also a safe bet that real-world usage of this Unicode character is likely minimal. So the web-compat risk seems small. If this PR is accepted, then we'll follow up with a normative Temporal PR to remove this character from Temporal as well. --- spec.html | 47 ++++++----------------------------------------- 1 file changed, 6 insertions(+), 41 deletions(-) diff --git a/spec.html b/spec.html index e96f6b8795..83cf72e8f7 100644 --- a/spec.html +++ b/spec.html @@ -33183,48 +33183,14 @@

        Time Zone Offset String Format

        ECMAScript defines a string interchange format for UTC offsets, derived from ISO 8601. The format is described by the following grammar. - The usage of Unicode code points in this grammar is listed in .

        - -

        - @@asyncIterator + %Symbol.asyncIterator% *"Symbol.asyncIterator"* @@ -1236,7 +1237,7 @@

        Well-Known Symbols

        - @@hasInstance + %Symbol.hasInstance% *"Symbol.hasInstance"* @@ -1247,7 +1248,7 @@

        Well-Known Symbols

        - @@isConcatSpreadable + %Symbol.isConcatSpreadable% *"Symbol.isConcatSpreadable"* @@ -1258,7 +1259,7 @@

        Well-Known Symbols

        - @@iterator + %Symbol.iterator% *"Symbol.iterator"* @@ -1269,7 +1270,7 @@

        Well-Known Symbols

        - @@match + %Symbol.match% *"Symbol.match"* @@ -1280,7 +1281,7 @@

        Well-Known Symbols

        - @@matchAll + %Symbol.matchAll% *"Symbol.matchAll"* @@ -1291,7 +1292,7 @@

        Well-Known Symbols

        - @@replace + %Symbol.replace% *"Symbol.replace"* @@ -1302,7 +1303,7 @@

        Well-Known Symbols

        - @@search + %Symbol.search% *"Symbol.search"* @@ -1313,7 +1314,7 @@

        Well-Known Symbols

        - @@species + %Symbol.species% *"Symbol.species"* @@ -1324,7 +1325,7 @@

        Well-Known Symbols

        - @@split + %Symbol.split% *"Symbol.split"* @@ -1335,7 +1336,7 @@

        Well-Known Symbols

        - @@toPrimitive + %Symbol.toPrimitive% *"Symbol.toPrimitive"* @@ -1346,7 +1347,7 @@

        Well-Known Symbols

        - @@toStringTag + %Symbol.toStringTag% *"Symbol.toStringTag"* @@ -1357,7 +1358,7 @@

        Well-Known Symbols

        - @@unscopables + %Symbol.unscopables% *"Symbol.unscopables"* @@ -4836,7 +4837,7 @@

        1. If _input_ is an Object, then - 1. Let _exoticToPrim_ be ? GetMethod(_input_, @@toPrimitive). + 1. Let _exoticToPrim_ be ? GetMethod(_input_, %Symbol.toPrimitive%). 1. If _exoticToPrim_ is not *undefined*, then 1. If _preferredType_ is not present, then 1. Let _hint_ be *"default"*. @@ -4853,7 +4854,7 @@

        1. Return _input_. -

        When ToPrimitive is called without a hint, then it generally behaves as if the hint were ~number~. However, objects may over-ride this behaviour by defining a @@toPrimitive method. Of the objects defined in this specification only Dates (see ) and Symbol objects (see ) over-ride the default ToPrimitive behaviour. Dates treat the absence of a hint as if the hint were ~string~.

        +

        When ToPrimitive is called without a hint, then it generally behaves as if the hint were ~number~. However, objects may over-ride this behaviour by defining a %Symbol.toPrimitive% method. Of the objects defined in this specification only Dates (see ) and Symbol objects (see ) over-ride the default ToPrimitive behaviour. Dates treat the absence of a hint as if the hint were ~string~.

        @@ -5819,7 +5820,7 @@

        1. If _argument_ is not an Object, return *false*. - 1. Let _matcher_ be ? Get(_argument_, @@match). + 1. Let _matcher_ be ? Get(_argument_, %Symbol.match%). 1. If _matcher_ is not *undefined*, return ToBoolean(_matcher_). 1. If _argument_ has a [[RegExpMatcher]] internal slot, return *true*. 1. Return *false*. @@ -6499,13 +6500,13 @@

        description
        -
        It is used to retrieve the constructor that should be used to create new objects that are derived from _O_. _defaultConstructor_ is the constructor to use if a constructor @@species property cannot be found starting from _O_.
        +
        It is used to retrieve the constructor that should be used to create new objects that are derived from _O_. _defaultConstructor_ is the constructor to use if a constructor %Symbol.species% property cannot be found starting from _O_.
        1. Let _C_ be ? Get(_O_, *"constructor"*). 1. If _C_ is *undefined*, return _defaultConstructor_. 1. If _C_ is not an Object, throw a *TypeError* exception. - 1. Let _S_ be ? Get(_C_, @@species). + 1. Let _S_ be ? Get(_C_, %Symbol.species%). 1. If _S_ is either *undefined* or *null*, return _defaultConstructor_. 1. If IsConstructor(_S_) is *true*, return _S_. 1. Throw a *TypeError* exception. @@ -6917,14 +6918,14 @@

        1. If _kind_ is ~async~, then - 1. Let _method_ be ? GetMethod(_obj_, @@asyncIterator). + 1. Let _method_ be ? GetMethod(_obj_, %Symbol.asyncIterator%). 1. If _method_ is *undefined*, then - 1. Let _syncMethod_ be ? GetMethod(_obj_, @@iterator). + 1. Let _syncMethod_ be ? GetMethod(_obj_, %Symbol.iterator%). 1. If _syncMethod_ is *undefined*, throw a *TypeError* exception. 1. Let _syncIteratorRecord_ be ? GetIteratorFromMethod(_obj_, _syncMethod_). 1. Return CreateAsyncFromSyncIterator(_syncIteratorRecord_). 1. Else, - 1. Let _method_ be ? GetMethod(_obj_, @@iterator). + 1. Let _method_ be ? GetMethod(_obj_, %Symbol.iterator%). 1. If _method_ is *undefined*, throw a *TypeError* exception. 1. Return ? GetIteratorFromMethod(_obj_, _method_). @@ -10321,7 +10322,7 @@

        1. Let _foundBinding_ be ? HasProperty(_bindingObject_, _N_). 1. If _foundBinding_ is *false*, return *false*. 1. If _envRec_.[[IsWithEnvironment]] is *false*, return *true*. - 1. Let _unscopables_ be ? Get(_bindingObject_, @@unscopables). + 1. Let _unscopables_ be ? Get(_bindingObject_, %Symbol.unscopables%). 1. If _unscopables_ is an Object, then 1. Let _blocked_ be ToBoolean(? Get(_unscopables_, _N_)). 1. If _blocked_ is *true*, return *false*. @@ -14113,7 +14114,7 @@

        1. If _thisRealm_ and _realmC_ are not the same Realm Record, then 1. If SameValue(_C_, _realmC_.[[Intrinsics]].[[%Array%]]) is *true*, set _C_ to *undefined*. 1. If _C_ is an Object, then - 1. Set _C_ to ? Get(_C_, @@species). + 1. Set _C_ to ? Get(_C_, %Symbol.species%). 1. If _C_ is *null*, set _C_ to *undefined*. 1. If _C_ is *undefined*, return ? ArrayCreate(_length_). 1. If IsConstructor(_C_) is *false*, throw a *TypeError* exception. @@ -14457,7 +14458,7 @@

        1. Let _val_ be _argumentsList_[_index_]. 1. Perform ! CreateDataPropertyOrThrow(_obj_, ! ToString(𝔽(_index_)), _val_). 1. Set _index_ to _index_ + 1. - 1. Perform ! DefinePropertyOrThrow(_obj_, @@iterator, PropertyDescriptor { [[Value]]: %Array.prototype.values%, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). + 1. Perform ! DefinePropertyOrThrow(_obj_, %Symbol.iterator%, PropertyDescriptor { [[Value]]: %Array.prototype.values%, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). 1. Perform ! DefinePropertyOrThrow(_obj_, *"callee"*, PropertyDescriptor { [[Get]]: %ThrowTypeError%, [[Set]]: %ThrowTypeError%, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Return _obj_. @@ -14505,7 +14506,7 @@

        1. Let _p_ be MakeArgSetter(_name_, _env_). 1. Perform ! _map_.[[DefineOwnProperty]](! ToString(𝔽(_index_)), PropertyDescriptor { [[Set]]: _p_, [[Get]]: _g_, [[Enumerable]]: *false*, [[Configurable]]: *true* }). 1. Set _index_ to _index_ - 1. - 1. Perform ! DefinePropertyOrThrow(_obj_, @@iterator, PropertyDescriptor { [[Value]]: %Array.prototype.values%, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). + 1. Perform ! DefinePropertyOrThrow(_obj_, %Symbol.iterator%, PropertyDescriptor { [[Value]]: %Array.prototype.values%, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). 1. Perform ! DefinePropertyOrThrow(_obj_, *"callee"*, PropertyDescriptor { [[Value]]: _func_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). 1. Return _obj_. @@ -20237,18 +20238,18 @@

        description
        -
        It implements the generic algorithm for determining if _V_ is an instance of _target_ either by consulting _target_'s @@hasInstance method or, if absent, determining whether the value of _target_'s *"prototype"* property is present in _V_'s prototype chain.
        +
        It implements the generic algorithm for determining if _V_ is an instance of _target_ either by consulting _target_'s %Symbol.hasInstance% method or, if absent, determining whether the value of _target_'s *"prototype"* property is present in _V_'s prototype chain.
        1. If _target_ is not an Object, throw a *TypeError* exception. - 1. Let _instOfHandler_ be ? GetMethod(_target_, @@hasInstance). + 1. Let _instOfHandler_ be ? GetMethod(_target_, %Symbol.hasInstance%). 1. If _instOfHandler_ is not *undefined*, then 1. Return ToBoolean(? Call(_instOfHandler_, _target_, « _V_ »)). 1. [id="step-instanceof-check-function"] If IsCallable(_target_) is *false*, throw a *TypeError* exception. 1. [id="step-instanceof-fallback"] Return ? OrdinaryHasInstance(_target_, _V_). -

        Steps and provide compatibility with previous editions of ECMAScript that did not use a @@hasInstance method to define the `instanceof` operator semantics. If an object does not define or inherit @@hasInstance it uses the default `instanceof` semantics.

        +

        Steps and provide compatibility with previous editions of ECMAScript that did not use a %Symbol.hasInstance% method to define the `instanceof` operator semantics. If an object does not define or inherit %Symbol.hasInstance% it uses the default `instanceof` semantics.

        @@ -24905,7 +24906,7 @@

        1. If NewTarget is *undefined*, throw a *TypeError* exception. 1. Let _F_ be the active function object. 1. If _F_.[[ConstructorKind]] is ~derived~, then - 1. NOTE: This branch behaves similarly to `constructor(...args) { super(...args); }`. The most notable distinction is that while the aforementioned ECMAScript source text observably calls the @@iterator method on `%Array.prototype%`, this function does not. + 1. NOTE: This branch behaves similarly to `constructor(...args) { super(...args); }`. The most notable distinction is that while the aforementioned ECMAScript source text observably calls the %Symbol.iterator% method on `%Array.prototype%`, this function does not. 1. Let _func_ be ! _F_.[[GetPrototypeOf]](). 1. If IsConstructor(_func_) is *false*, throw a *TypeError* exception. 1. Let _result_ be ? Construct(_func_, _args_, NewTarget). @@ -30044,12 +30045,12 @@

        Object.prototype.toString ( )

        1. Else if _O_ has a [[DateValue]] internal slot, let _builtinTag_ be *"Date"*. 1. Else if _O_ has a [[RegExpMatcher]] internal slot, let _builtinTag_ be *"RegExp"*. 1. Else, let _builtinTag_ be *"Object"*. - 1. Let _tag_ be ? Get(_O_, @@toStringTag). + 1. Let _tag_ be ? Get(_O_, %Symbol.toStringTag%). 1. If _tag_ is not a String, set _tag_ to _builtinTag_. 1. Return the string-concatenation of *"[object "*, _tag_, and *"]"*.
        -

        Historically, this method was occasionally used to access the String value of the [[Class]] internal slot that was used in previous editions of this specification as a nominal type tag for various built-in objects. The above definition of `toString` preserves compatibility for legacy code that uses `toString` as a test for those specific kinds of built-in objects. It does not provide a reliable type testing mechanism for other kinds of built-in or program defined objects. In addition, programs can use @@toStringTag in ways that will invalidate the reliability of such legacy type tests.

        +

        Historically, this method was occasionally used to access the String value of the [[Class]] internal slot that was used in previous editions of this specification as a nominal type tag for various built-in objects. The above definition of `toString` preserves compatibility for legacy code that uses `toString` as a test for those specific kinds of built-in objects. It does not provide a reliable type testing mechanism for other kinds of built-in or program defined objects. In addition, programs can use %Symbol.toStringTag% in ways that will invalidate the reliability of such legacy type tests.

        @@ -30412,8 +30413,8 @@

        Function.prototype.toString ( )

        - -

        Function.prototype [ @@hasInstance ] ( _V_ )

        + +

        Function.prototype [ %Symbol.hasInstance% ] ( _V_ )

        This method performs the following steps when called:

        1. Let _F_ be the *this* value. @@ -30421,15 +30422,15 @@

        Function.prototype [ @@hasInstance ] ( _V_ )

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        -

        This is the default implementation of `@@hasInstance` that most functions inherit. `@@hasInstance` is called by the `instanceof` operator to determine whether a value is an instance of a specific constructor. An expression such as

        +

        This is the default implementation of `%Symbol.hasInstance%` that most functions inherit. `%Symbol.hasInstance%` is called by the `instanceof` operator to determine whether a value is an instance of a specific constructor. An expression such as

        
                     v instanceof F
                   

        evaluates as

        
        -            F[@@hasInstance](v)
        +            F[%Symbol.hasInstance%](v)
                   
        -

        A constructor function can control which objects are recognized as its instances by `instanceof` by exposing a different `@@hasInstance` method on the function.

        +

        A constructor function can control which objects are recognized as its instances by `instanceof` by exposing a different `%Symbol.hasInstance%` method on the function.

        This property is non-writable and non-configurable to prevent tampering that could be used to globally expose the target function of a bound function.

        The value of the *"name"* property of this method is *"[Symbol.hasInstance]"*.

        @@ -30616,7 +30617,7 @@

        Properties of the Symbol Constructor

        Symbol.asyncIterator

        -

        The initial value of `Symbol.asyncIterator` is the well-known symbol @@asyncIterator ().

        +

        The initial value of `Symbol.asyncIterator` is the well-known symbol %Symbol.asyncIterator% ().

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        @@ -30676,19 +30677,19 @@

        Symbol.for ( _key_ )

        Symbol.hasInstance

        -

        The initial value of `Symbol.hasInstance` is the well-known symbol @@hasInstance ().

        +

        The initial value of `Symbol.hasInstance` is the well-known symbol %Symbol.hasInstance% ().

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        Symbol.isConcatSpreadable

        -

        The initial value of `Symbol.isConcatSpreadable` is the well-known symbol @@isConcatSpreadable ().

        +

        The initial value of `Symbol.isConcatSpreadable` is the well-known symbol %Symbol.isConcatSpreadable% ().

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        Symbol.iterator

        -

        The initial value of `Symbol.iterator` is the well-known symbol @@iterator ().

        +

        The initial value of `Symbol.iterator` is the well-known symbol %Symbol.iterator% ().

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        @@ -30703,13 +30704,13 @@

        Symbol.keyFor ( _sym_ )

        Symbol.match

        -

        The initial value of `Symbol.match` is the well-known symbol @@match ().

        +

        The initial value of `Symbol.match` is the well-known symbol %Symbol.match% ().

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        Symbol.matchAll

        -

        The initial value of `Symbol.matchAll` is the well-known symbol @@matchAll ().

        +

        The initial value of `Symbol.matchAll` is the well-known symbol %Symbol.matchAll% ().

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        @@ -30721,43 +30722,43 @@

        Symbol.prototype

        Symbol.replace

        -

        The initial value of `Symbol.replace` is the well-known symbol @@replace ().

        +

        The initial value of `Symbol.replace` is the well-known symbol %Symbol.replace% ().

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        Symbol.search

        -

        The initial value of `Symbol.search` is the well-known symbol @@search ().

        +

        The initial value of `Symbol.search` is the well-known symbol %Symbol.search% ().

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        Symbol.species

        -

        The initial value of `Symbol.species` is the well-known symbol @@species ().

        +

        The initial value of `Symbol.species` is the well-known symbol %Symbol.species% ().

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        Symbol.split

        -

        The initial value of `Symbol.split` is the well-known symbol @@split ().

        +

        The initial value of `Symbol.split` is the well-known symbol %Symbol.split% ().

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        Symbol.toPrimitive

        -

        The initial value of `Symbol.toPrimitive` is the well-known symbol @@toPrimitive ().

        +

        The initial value of `Symbol.toPrimitive` is the well-known symbol %Symbol.toPrimitive% ().

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        Symbol.toStringTag

        -

        The initial value of `Symbol.toStringTag` is the well-known symbol @@toStringTag ().

        +

        The initial value of `Symbol.toStringTag` is the well-known symbol %Symbol.toStringTag% ().

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        Symbol.unscopables

        -

        The initial value of `Symbol.unscopables` is the well-known symbol @@unscopables ().

        +

        The initial value of `Symbol.unscopables` is the well-known symbol %Symbol.unscopables% ().

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        @@ -30838,8 +30839,8 @@

        - -

        Symbol.prototype [ @@toPrimitive ] ( _hint_ )

        + +

        Symbol.prototype [ %Symbol.toPrimitive% ] ( _hint_ )

        This method is called by ECMAScript language operators to convert a Symbol object to a primitive value.

        It performs the following steps when called:

        @@ -30852,9 +30853,9 @@

        Symbol.prototype [ @@toPrimitive ] ( _hint_ )

        The value of the *"name"* property of this method is *"[Symbol.toPrimitive]"*.

        - -

        Symbol.prototype [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"Symbol"*.

        + +

        Symbol.prototype [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"Symbol"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -31707,9 +31708,9 @@

        - -

        BigInt.prototype [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"BigInt"*.

        + +

        BigInt.prototype [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"BigInt"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -31796,9 +31797,9 @@

        Math.SQRT2

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        - -

        Math [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"Math"*.

        + +

        Math [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"Math"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -34367,8 +34368,8 @@

        Date.prototype.valueOf ( )

        - -

        Date.prototype [ @@toPrimitive ] ( _hint_ )

        + +

        Date.prototype [ %Symbol.toPrimitive% ] ( _hint_ )

        This method is called by ECMAScript language operators to convert a Date to a primitive value. The allowed values for _hint_ are *"default"*, *"number"*, and *"string"*. Dates are unique among built-in ECMAScript object in that they treat *"default"* as being equivalent to *"string"*, All other built-in ECMAScript objects treat *"default"* as being equivalent to *"number"*.

        It performs the following steps when called:

        @@ -34782,12 +34783,12 @@

        String.prototype.match ( _regexp_ )

        1. Let _O_ be ? RequireObjectCoercible(*this* value). 1. If _regexp_ is neither *undefined* nor *null*, then - 1. Let _matcher_ be ? GetMethod(_regexp_, @@match). + 1. Let _matcher_ be ? GetMethod(_regexp_, %Symbol.match%). 1. If _matcher_ is not *undefined*, then 1. Return ? Call(_matcher_, _regexp_, « _O_ »). 1. Let _S_ be ? ToString(_O_). 1. Let _rx_ be ? RegExpCreate(_regexp_, *undefined*). - 1. Return ? Invoke(_rx_, @@match, « _S_ »). + 1. Return ? Invoke(_rx_, %Symbol.match%, « _S_ »).

        This method is intentionally generic; it does not require that its *this* value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

        @@ -34807,12 +34808,12 @@

        String.prototype.matchAll ( _regexp_ )

        1. Let _flags_ be ? Get(_regexp_, *"flags"*). 1. Perform ? RequireObjectCoercible(_flags_). 1. If ? ToString(_flags_) does not contain *"g"*, throw a *TypeError* exception. - 1. Let _matcher_ be ? GetMethod(_regexp_, @@matchAll). + 1. Let _matcher_ be ? GetMethod(_regexp_, %Symbol.matchAll%). 1. If _matcher_ is not *undefined*, then 1. Return ? Call(_matcher_, _regexp_, « _O_ »). 1. Let _S_ be ? ToString(_O_). 1. Let _rx_ be ? RegExpCreate(_regexp_, *"g"*). - 1. Return ? Invoke(_rx_, @@matchAll, « _S_ »). + 1. Return ? Invoke(_rx_, %Symbol.matchAll%, « _S_ »).
        This method is intentionally generic, it does not require that its *this* value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method. Similarly to `String.prototype.split`, `String.prototype.matchAll` is designed to typically act without mutating its inputs. @@ -34943,7 +34944,7 @@

        String.prototype.replace ( _searchValue_, _replaceValue_ )

        1. Let _O_ be ? RequireObjectCoercible(*this* value). 1. If _searchValue_ is neither *undefined* nor *null*, then - 1. Let _replacer_ be ? GetMethod(_searchValue_, @@replace). + 1. Let _replacer_ be ? GetMethod(_searchValue_, %Symbol.replace%). 1. If _replacer_ is not *undefined*, then 1. Return ? Call(_replacer_, _searchValue_, « _O_, _replaceValue_ »). 1. Let _string_ be ? ToString(_O_). @@ -35004,7 +35005,7 @@

        1. Let _matchLength_ be the length of _matched_. 1. Let _tailPos_ be _position_ + _matchLength_. 1. Let _refReplacement_ be the substring of _str_ from min(_tailPos_, _stringLength_). - 1. NOTE: _tailPos_ can exceed _stringLength_ only if this abstract operation was invoked by a call to the intrinsic @@replace method of %RegExp.prototype% on an object whose *"exec"* property is not the intrinsic %RegExp.prototype.exec%. + 1. NOTE: _tailPos_ can exceed _stringLength_ only if this abstract operation was invoked by a call to the intrinsic %Symbol.replace% method of %RegExp.prototype% on an object whose *"exec"* property is not the intrinsic %RegExp.prototype.exec%. 1. Else if _templateRemainder_ starts with *"$"* followed by 1 or more decimal digits, then 1. If _templateRemainder_ starts with *"$"* followed by 2 or more decimal digits, let _digitCount_ be 2. Otherwise, let _digitCount_ be 1. 1. Let _digits_ be the substring of _templateRemainder_ from 1 to 1 + _digitCount_. @@ -35061,7 +35062,7 @@

        String.prototype.replaceAll ( _searchValue_, _replaceValue_ )

        1. Let _flags_ be ? Get(_searchValue_, *"flags"*). 1. Perform ? RequireObjectCoercible(_flags_). 1. If ? ToString(_flags_) does not contain *"g"*, throw a *TypeError* exception. - 1. Let _replacer_ be ? GetMethod(_searchValue_, @@replace). + 1. Let _replacer_ be ? GetMethod(_searchValue_, %Symbol.replace%). 1. If _replacer_ is not *undefined*, then 1. Return ? Call(_replacer_, _searchValue_, « _O_, _replaceValue_ »). 1. Let _string_ be ? ToString(_O_). @@ -35100,12 +35101,12 @@

        String.prototype.search ( _regexp_ )

        1. Let _O_ be ? RequireObjectCoercible(*this* value). 1. If _regexp_ is neither *undefined* nor *null*, then - 1. Let _searcher_ be ? GetMethod(_regexp_, @@search). + 1. Let _searcher_ be ? GetMethod(_regexp_, %Symbol.search%). 1. If _searcher_ is not *undefined*, then 1. Return ? Call(_searcher_, _regexp_, « _O_ »). 1. Let _string_ be ? ToString(_O_). 1. Let _rx_ be ? RegExpCreate(_regexp_, *undefined*). - 1. Return ? Invoke(_rx_, @@search, « _string_ »). + 1. Return ? Invoke(_rx_, %Symbol.search%, « _string_ »).

        This method is intentionally generic; it does not require that its *this* value be a String object. Therefore, it can be transferred to other kinds of objects for use as a method.

        @@ -35138,12 +35139,12 @@

        String.prototype.slice ( _start_, _end_ )

        String.prototype.split ( _separator_, _limit_ )

        -

        This method returns an Array into which substrings of the result of converting this object to a String have been stored. The substrings are determined by searching from left to right for occurrences of _separator_; these occurrences are not part of any String in the returned array, but serve to divide up the String value. The value of _separator_ may be a String of any length or it may be an object, such as a RegExp, that has a @@split method.

        +

        This method returns an Array into which substrings of the result of converting this object to a String have been stored. The substrings are determined by searching from left to right for occurrences of _separator_; these occurrences are not part of any String in the returned array, but serve to divide up the String value. The value of _separator_ may be a String of any length or it may be an object, such as a RegExp, that has a %Symbol.split% method.

        It performs the following steps when called:

        1. Let _O_ be ? RequireObjectCoercible(*this* value). 1. If _separator_ is neither *undefined* nor *null*, then - 1. Let _splitter_ be ? GetMethod(_separator_, @@split). + 1. Let _splitter_ be ? GetMethod(_separator_, %Symbol.split%). 1. If _splitter_ is not *undefined*, then 1. Return ? Call(_splitter_, _separator_, « _O_, _limit_ »). 1. Let _S_ be ? ToString(_O_). @@ -35411,8 +35412,8 @@

        - -

        String.prototype [ @@iterator ] ( )

        + +

        String.prototype [ %Symbol.iterator% ] ( )

        This method returns an Iterator object () that iterates over the code points of a String value, returning each code point as a String value.

        It performs the following steps when called:

        @@ -35467,9 +35468,9 @@

        %StringIteratorPrototype%.next ( )

        - -

        %StringIteratorPrototype% [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"String Iterator"*.

        + +

        %StringIteratorPrototype% [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"String Iterator"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -37760,15 +37761,15 @@

        RegExp.prototype

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        - -

        get RegExp [ @@species ]

        -

        `RegExp[@@species]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

        + +

        get RegExp [ %Symbol.species% ]

        +

        `RegExp[%Symbol.species%]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

        1. Return the *this* value.

        The value of the *"name"* property of this function is *"get [Symbol.species]"*.

        -

        RegExp prototype methods normally use their *this* value's constructor to create a derived object. However, a subclass constructor may over-ride that default behaviour by redefining its @@species property.

        +

        RegExp prototype methods normally use their *this* value's constructor to create a derived object. However, a subclass constructor may over-ride that default behaviour by redefining its %Symbol.species% property.

        @@ -37890,8 +37891,8 @@

        get RegExp.prototype.ignoreCase

        - -

        RegExp.prototype [ @@match ] ( _string_ )

        + +

        RegExp.prototype [ %Symbol.match% ] ( _string_ )

        This method performs the following steps when called:

        1. Let _rx_ be the *this* value. @@ -37921,12 +37922,12 @@

        RegExp.prototype [ @@match ] ( _string_ )

        The value of the *"name"* property of this method is *"[Symbol.match]"*.

        -

        The @@match property is used by the IsRegExp abstract operation to identify objects that have the basic behaviour of regular expressions. The absence of a @@match property or the existence of such a property whose value does not Boolean coerce to *true* indicates that the object is not intended to be used as a regular expression object.

        +

        The %Symbol.match% property is used by the IsRegExp abstract operation to identify objects that have the basic behaviour of regular expressions. The absence of a %Symbol.match% property or the existence of such a property whose value does not Boolean coerce to *true* indicates that the object is not intended to be used as a regular expression object.

        - -

        RegExp.prototype [ @@matchAll ] ( _string_ )

        + +

        RegExp.prototype [ %Symbol.matchAll% ] ( _string_ )

        This method performs the following steps when called:

        1. Let _R_ be the *this* value. @@ -37956,8 +37957,8 @@

        get RegExp.prototype.multiline

        - -

        RegExp.prototype [ @@replace ] ( _string_, _replaceValue_ )

        + +

        RegExp.prototype [ %Symbol.replace% ] ( _string_, _replaceValue_ )

        This method performs the following steps when called:

        1. Let _rx_ be the *this* value. @@ -38027,8 +38028,8 @@

        RegExp.prototype [ @@replace ] ( _string_, _replaceValue_ )

        The value of the *"name"* property of this method is *"[Symbol.replace]"*.

        - -

        RegExp.prototype [ @@search ] ( _string_ )

        + +

        RegExp.prototype [ %Symbol.search% ] ( _string_ )

        This method performs the following steps when called:

        1. Let _rx_ be the *this* value. @@ -38088,8 +38089,8 @@

        - -

        RegExp.prototype [ @@split ] ( _string_, _limit_ )

        + +

        RegExp.prototype [ %Symbol.split% ] ( _string_, _limit_ )

        This method returns an Array into which substrings of the result of converting _string_ to a String have been stored. The substrings are determined by searching from left to right for matches of the *this* value regular expression; these occurrences are not part of any String in the returned array, but serve to divide up the String value.

        The *this* value may be an empty regular expression or a regular expression that can match an empty String. In this case, the regular expression does not match the empty substring at the beginning or end of the input String, nor does it match the empty substring at the end of the previous separator match. (For example, if the regular expression matches the empty String, the String is split up into individual code unit elements; the length of the result array equals the length of the String, and each substring contains one code unit.) Only the first match at a given index of the String is considered, even if backtracking could yield a non-empty substring match at that index. (For example, `/a*?/[Symbol.split]("ab")` evaluates to the array `["a", "b"]`, while `/a*/[Symbol.split]("ab")` evaluates to the array `["","b"]`.)

        @@ -38536,9 +38537,9 @@

        %RegExpStringIteratorPrototype%.next ( )

        - -

        %RegExpStringIteratorPrototype% [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"RegExp String Iterator"*.

        + +

        %RegExpStringIteratorPrototype% [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"RegExp String Iterator"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -38619,7 +38620,7 @@

        Array.from ( _items_ [ , _mapfn_ [ , _thisArg_ ] ] )

        1. Else, 1. If IsCallable(_mapfn_) is *false*, throw a *TypeError* exception. 1. Let _mapping_ be *true*. - 1. Let _usingIterator_ be ? GetMethod(_items_, @@iterator). + 1. Let _usingIterator_ be ? GetMethod(_items_, %Symbol.iterator%). 1. If _usingIterator_ is not *undefined*, then 1. If IsConstructor(_C_) is *true*, then 1. Let _A_ be ? Construct(_C_). @@ -38708,15 +38709,15 @@

        Array.prototype

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        - -

        get Array [ @@species ]

        -

        `Array[@@species]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

        + +

        get Array [ %Symbol.species% ]

        +

        `Array[%Symbol.species%]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

        1. Return the *this* value.

        The value of the *"name"* property of this function is *"get [Symbol.species]"*.

        -

        Array prototype methods normally use their *this* value's constructor to create a derived object. However, a subclass constructor may over-ride that default behaviour by redefining its @@species property.

        +

        Array prototype methods normally use their *this* value's constructor to create a derived object. However, a subclass constructor may over-ride that default behaviour by redefining its %Symbol.species% property.

        @@ -38798,7 +38799,7 @@

        1. If _O_ is not an Object, return *false*. - 1. Let _spreadable_ be ? Get(_O_, @@isConcatSpreadable). + 1. Let _spreadable_ be ? Get(_O_, %Symbol.isConcatSpreadable%). 1. If _spreadable_ is not *undefined*, return ToBoolean(_spreadable_). 1. Return ? IsArray(_O_). @@ -40001,14 +40002,14 @@

        Array.prototype.with ( _index_, _value_ )

        - -

        Array.prototype [ @@iterator ] ( )

        -

        The initial value of the @@iterator property is %Array.prototype.values%, defined in .

        + +

        Array.prototype [ %Symbol.iterator% ] ( )

        +

        The initial value of the %Symbol.iterator% property is %Array.prototype.values%, defined in .

        - -

        Array.prototype [ @@unscopables ]

        -

        The initial value of the @@unscopables data property is an object created by the following steps:

        + +

        Array.prototype [ %Symbol.unscopables% ]

        +

        The initial value of the %Symbol.unscopables% data property is an object created by the following steps:

        1. Let _unscopableList_ be OrdinaryObjectCreate(*null*). 1. Perform ! CreateDataPropertyOrThrow(_unscopableList_, *"at"*, *true*). @@ -40112,9 +40113,9 @@

        %ArrayIteratorPrototype%.next ( )

        - -

        %ArrayIteratorPrototype% [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"Array Iterator"*.

        + +

        %ArrayIteratorPrototype% [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"Array Iterator"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -40386,7 +40387,7 @@

        %TypedArray%.from ( _source_ [ , _mapfn_ [ , _thisArg_ ] ] )

        1. Else, 1. If IsCallable(_mapfn_) is *false*, throw a *TypeError* exception. 1. Let _mapping_ be *true*. - 1. Let _usingIterator_ be ? GetMethod(_source_, @@iterator). + 1. Let _usingIterator_ be ? GetMethod(_source_, %Symbol.iterator%). 1. If _usingIterator_ is not *undefined*, then 1. Let _values_ be ? IteratorToList(? GetIteratorFromMethod(_source_, _usingIterator_)). 1. Let _len_ be the number of elements in _values_. @@ -40446,15 +40447,15 @@

        %TypedArray%.prototype

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        - -

        get %TypedArray% [ @@species ]

        -

        %TypedArray%`[@@species]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

        + +

        get %TypedArray% [ %Symbol.species% ]

        +

        %TypedArray%`[%Symbol.species%]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

        1. Return the *this* value.

        The value of the *"name"* property of this function is *"get [Symbol.species]"*.

        -

        %TypedArray.prototype% methods normally use their *this* value's constructor to create a derived object. However, a subclass constructor may over-ride that default behaviour by redefining its @@species property.

        +

        %TypedArray.prototype% methods normally use their *this* value's constructor to create a derived object. However, a subclass constructor may over-ride that default behaviour by redefining its %Symbol.species% property.

        @@ -41311,14 +41312,14 @@

        %TypedArray%.prototype.with ( _index_, _value_ )

        - -

        %TypedArray%.prototype [ @@iterator ] ( )

        -

        The initial value of the @@iterator property is %TypedArray.prototype.values%, defined in .

        + +

        %TypedArray%.prototype [ %Symbol.iterator% ] ( )

        +

        The initial value of the %Symbol.iterator% property is %TypedArray.prototype.values%, defined in .

        - -

        get %TypedArray%.prototype [ @@toStringTag ]

        -

        %TypedArray%`.prototype[@@toStringTag]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

        + +

        get %TypedArray%.prototype [ %Symbol.toStringTag% ]

        +

        %TypedArray%`.prototype[%Symbol.toStringTag%]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

        1. Let _O_ be the *this* value. 1. If _O_ is not an Object, return *undefined*. @@ -41344,7 +41345,7 @@

        description
        -
        It is used to specify the creation of a new TypedArray using a constructor function that is derived from _exemplar_. Unlike ArraySpeciesCreate, which can create non-Array objects through the use of @@species, this operation enforces that the constructor function creates an actual TypedArray.
        +
        It is used to specify the creation of a new TypedArray using a constructor function that is derived from _exemplar_. Unlike ArraySpeciesCreate, which can create non-Array objects through the use of %Symbol.species%, this operation enforces that the constructor function creates an actual TypedArray.
        1. Let _defaultConstructor_ be the intrinsic object associated with the constructor name _exemplar_.[[TypedArrayName]] in . @@ -41387,7 +41388,7 @@

        description
        -
        It is used to specify the creation of a new TypedArray using a constructor function that is derived from _exemplar_. Unlike TypedArraySpeciesCreate, which can construct custom TypedArray subclasses through the use of @@species, this operation always uses one of the built-in TypedArray constructors.
        +
        It is used to specify the creation of a new TypedArray using a constructor function that is derived from _exemplar_. Unlike TypedArraySpeciesCreate, which can construct custom TypedArray subclasses through the use of %Symbol.species%, this operation always uses one of the built-in TypedArray constructors.
        1. Let _constructor_ be the intrinsic object associated with the constructor name _exemplar_.[[TypedArrayName]] in . @@ -41505,7 +41506,7 @@

        _TypedArray_ ( ..._args_ )

        1. Perform ? InitializeTypedArrayFromArrayBuffer(_O_, _firstArgument_, _byteOffset_, _length_). 1. Else, 1. Assert: _firstArgument_ is an Object and _firstArgument_ does not have either a [[TypedArrayName]] or an [[ArrayBufferData]] internal slot. - 1. Let _usingIterator_ be ? GetMethod(_firstArgument_, @@iterator). + 1. Let _usingIterator_ be ? GetMethod(_firstArgument_, %Symbol.iterator%). 1. If _usingIterator_ is not *undefined*, then 1. Let _values_ be ? IteratorToList(? GetIteratorFromMethod(_firstArgument_, _usingIterator_)). 1. Perform ? InitializeTypedArrayFromList(_O_, _values_). @@ -41786,7 +41787,7 @@

        Map ( [ _iterable_ ] )

        1. Return ? AddEntriesFromIterable(_map_, _iterable_, _adder_).
        -

        If the parameter _iterable_ is present, it is expected to be an object that implements an @@iterator method that returns an iterator object that produces a two element array-like object whose first element is a value that will be used as a Map key and whose second element is the value to associate with that key.

        +

        If the parameter _iterable_ is present, it is expected to be an object that implements an %Symbol.iterator% method that returns an iterator object that produces a two element array-like object whose first element is a value that will be used as a Map key and whose second element is the value to associate with that key.

        @@ -41818,7 +41819,7 @@

        1. IfAbruptCloseIterator(_status_, _iteratorRecord_). -

        The parameter _iterable_ is expected to be an object that implements an @@iterator method that returns an iterator object that produces a two element array-like object whose first element is a value that will be used as a Map key and whose second element is the value to associate with that key.

        +

        The parameter _iterable_ is expected to be an object that implements an %Symbol.iterator% method that returns an iterator object that produces a two element array-like object whose first element is a value that will be used as a Map key and whose second element is the value to associate with that key.

        @@ -41856,15 +41857,15 @@

        Map.prototype

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        - -

        get Map [ @@species ]

        -

        `Map[@@species]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

        + +

        get Map [ %Symbol.species% ]

        +

        `Map[%Symbol.species%]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

        1. Return the *this* value.

        The value of the *"name"* property of this function is *"get [Symbol.species]"*.

        -

        Methods that create derived collection objects should call @@species to determine the constructor to use to create the derived objects. Subclass constructor may over-ride @@species to change the default constructor assignment.

        +

        Methods that create derived collection objects should call %Symbol.species% to determine the constructor to use to create the derived objects. Subclass constructor may over-ride %Symbol.species% to change the default constructor assignment.

        @@ -42029,14 +42030,14 @@

        Map.prototype.values ( )

        - -

        Map.prototype [ @@iterator ] ( )

        -

        The initial value of the @@iterator property is %Map.prototype.entries%, defined in .

        + +

        Map.prototype [ %Symbol.iterator% ] ( )

        +

        The initial value of the %Symbol.iterator% property is %Map.prototype.entries%, defined in .

        - -

        Map.prototype [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"Map"*.

        + +

        Map.prototype [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"Map"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -42103,9 +42104,9 @@

        %MapIteratorPrototype%.next ( )

        - -

        %MapIteratorPrototype% [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"Map Iterator"*.

        + +

        %MapIteratorPrototype% [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"Map Iterator"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -42308,15 +42309,15 @@

        Set.prototype

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        - -

        get Set [ @@species ]

        -

        `Set[@@species]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

        + +

        get Set [ %Symbol.species% ]

        +

        `Set[%Symbol.species%]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

        1. Return the *this* value.

        The value of the *"name"* property of this function is *"get [Symbol.species]"*.

        -

        Methods that create derived collection objects should call @@species to determine the constructor to use to create the derived objects. Subclass constructor may over-ride @@species to change the default constructor assignment.

        +

        Methods that create derived collection objects should call %Symbol.species% to determine the constructor to use to create the derived objects. Subclass constructor may over-ride %Symbol.species% to change the default constructor assignment.

        @@ -42661,14 +42662,14 @@

        Set.prototype.values ( )

        - -

        Set.prototype [ @@iterator ] ( )

        -

        The initial value of the @@iterator property is %Set.prototype.values%, defined in .

        + +

        Set.prototype [ %Symbol.iterator% ] ( )

        +

        The initial value of the %Symbol.iterator% property is %Set.prototype.values%, defined in .

        - -

        Set.prototype [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"Set"*.

        + +

        Set.prototype [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"Set"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -42733,9 +42734,9 @@

        %SetIteratorPrototype%.next ( )

        - -

        %SetIteratorPrototype% [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"Set Iterator"*.

        + +

        %SetIteratorPrototype% [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"Set Iterator"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -42777,7 +42778,7 @@

        WeakMap ( [ _iterable_ ] )

        1. Return ? AddEntriesFromIterable(_map_, _iterable_, _adder_).
        -

        If the parameter _iterable_ is present, it is expected to be an object that implements an @@iterator method that returns an iterator object that produces a two element array-like object whose first element is a value that will be used as a WeakMap key and whose second element is the value to associate with that key.

        +

        If the parameter _iterable_ is present, it is expected to be an object that implements an %Symbol.iterator% method that returns an iterator object that produces a two element array-like object whose first element is a value that will be used as a WeakMap key and whose second element is the value to associate with that key.

        @@ -42874,9 +42875,9 @@

        WeakMap.prototype.set ( _key_, _value_ )

        - -

        WeakMap.prototype [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"WeakMap"*.

        + +

        WeakMap.prototype [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"WeakMap"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -43003,9 +43004,9 @@

        WeakSet.prototype.has ( _value_ )

        - -

        WeakSet.prototype [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"WeakSet"*.

        + +

        WeakSet.prototype [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"WeakSet"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -43557,15 +43558,15 @@

        ArrayBuffer.prototype

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        - -

        get ArrayBuffer [ @@species ]

        -

        `ArrayBuffer[@@species]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

        + +

        get ArrayBuffer [ %Symbol.species% ]

        +

        `ArrayBuffer[%Symbol.species%]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

        1. Return the *this* value.

        The value of the *"name"* property of this function is *"get [Symbol.species]"*.

        -

        normally uses its *this* value's constructor to create a derived object. However, a subclass constructor may over-ride that default behaviour for the method by redefining its @@species property.

        +

        normally uses its *this* value's constructor to create a derived object. However, a subclass constructor may over-ride that default behaviour for the method by redefining its %Symbol.species% property.

        @@ -43714,9 +43715,9 @@

        ArrayBuffer.prototype.transferToFixedLength ( [ _newLength_ ] )

        - -

        ArrayBuffer.prototype [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"ArrayBuffer"*.

        + +

        ArrayBuffer.prototype [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"ArrayBuffer"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -43883,9 +43884,9 @@

        SharedArrayBuffer.prototype

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.

        - -

        get SharedArrayBuffer [ @@species ]

        -

        `SharedArrayBuffer[@@species]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

        + +

        get SharedArrayBuffer [ %Symbol.species% ]

        +

        `SharedArrayBuffer[%Symbol.species%]` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:

        1. Return the *this* value. @@ -44008,9 +44009,9 @@

        SharedArrayBuffer.prototype.slice ( _start_, _end_ )

        - -

        SharedArrayBuffer.prototype [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"SharedArrayBuffer"*.

        + +

        SharedArrayBuffer.prototype [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"SharedArrayBuffer"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -44530,9 +44531,9 @@

        DataView.prototype.setUint32 ( _byteOffset_, _value_ [ , _littleEndian_ ] )< - -

        DataView.prototype [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"DataView"*.

        + +

        DataView.prototype [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"DataView"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -45344,9 +45345,9 @@

        Atomics.xor ( _typedArray_, _index_, _value_ )

        - -

        Atomics [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"Atomics"*.

        + +

        Atomics [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"Atomics"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -45842,9 +45843,9 @@

        - -

        JSON [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"JSON"*.

        + +

        JSON [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"JSON"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -45954,9 +45955,9 @@

        WeakRef.prototype.deref ( )

        - -

        WeakRef.prototype [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"WeakRef"*.

        + +

        WeakRef.prototype [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"WeakRef"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -46103,9 +46104,9 @@

        FinalizationRegistry.prototype.unregister ( _unregisterToken_ )

        - -

        FinalizationRegistry.prototype [ @@toStringTag ]

        -

        The initial value of the @@toStringTag property is the String value *"FinalizationRegistry"*.

        + +

        FinalizationRegistry.prototype [ %Symbol.toStringTag% ]

        +

        The initial value of the %Symbol.toStringTag% property is the String value *"FinalizationRegistry"*.

        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        @@ -46147,7 +46148,7 @@

        The Iterable Interface

        - `@@iterator` + `%Symbol.iterator%` a function that returns an Iterator object @@ -46251,7 +46252,7 @@

        The AsyncIterable Interface

        `@@asyncIterator``%Symbol.asyncIterator%` a function that returns an AsyncIterator object The returned object must conform to the AsyncIterator interface.
        - - - - - - - - - - - - -
        - Code Point - - Unicode Name - - Abbreviation -
        - `U+2212` - - MINUS SIGN - - <MINUS> -
        -
        -

        Syntax

        UTCOffset ::: - TemporalSign Hour - TemporalSign Hour HourSubcomponents[+Extended] - TemporalSign Hour HourSubcomponents[~Extended] - - TemporalSign ::: - ASCIISign - <MINUS> + ASCIISign Hour + ASCIISign Hour HourSubcomponents[+Extended] + ASCIISign Hour HourSubcomponents[~Extended] ASCIISign ::: one of `+` `-` @@ -33298,9 +33264,9 @@

        1. Let _parseResult_ be ParseText(_offsetString_, |UTCOffset|). 1. Assert: _parseResult_ is not a List of errors. - 1. Assert: _parseResult_ contains a |TemporalSign| Parse Node. - 1. Let _parsedSign_ be the source text matched by the |TemporalSign| Parse Node contained within _parseResult_. - 1. If _parsedSign_ is the single code point U+002D (HYPHEN-MINUS) or U+2212 (MINUS SIGN), then + 1. Assert: _parseResult_ contains a |ASCIISign| Parse Node. + 1. Let _parsedSign_ be the source text matched by the |ASCIISign| Parse Node contained within _parseResult_. + 1. If _parsedSign_ is the single code point U+002D (HYPHEN-MINUS), then 1. Let _sign_ be -1. 1. Else, 1. Let _sign_ be 1. @@ -50091,7 +50057,6 @@

        Number Conversions

        Time Zone Offset String Format

        - From e0c40064f099f4cbaaf5204fba7e7d4ad17cff2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aki=20=F0=9F=8C=B9?= Date: Wed, 17 Jul 2024 10:50:04 -0700 Subject: [PATCH 22/49] Editorial: Pivots the tables within clause 16.2.1.5.4 (#3342) This provides improved readability while maintaining the same information. --- spec.html | 403 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 253 insertions(+), 150 deletions(-) diff --git a/spec.html b/spec.html index 83cf72e8f7..7dc61554e7 100644 --- a/spec.html +++ b/spec.html @@ -26,6 +26,29 @@ width: 100%; font-size: 80%; } + + .corner-cell { + position: relative; + height: 2lh; + } + .corner-cell .slash { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: linear-gradient(to bottom left, transparent calc(50% - 1px), gray, transparent calc(50% + 1px)); + } + .corner-cell > .column { + position: absolute; + bottom: 0.4em; + left: 1em; + } + .corner-cell > .row { + position: absolute; + top: 0.4em; + right: 1em; + }

        `|=` `|`
        - 1. Let _r_ be ? ApplyStringOrNumericBinaryOperator(_lval_, _opText_, _rval_). - 1. [id="step-assignmentexpression-evaluation-compound-putvalue"] Perform ? PutValue(_lref_, _r_). + 1. Let _r_ be ? ApplyStringOrNumericBinaryOperator(_lVal_, _opText_, _rVal_). + 1. [id="step-assignmentexpression-evaluation-compound-putvalue"] Perform ? PutValue(_lRef_, _r_). 1. Return _r_. AssignmentExpression : LeftHandSideExpression `&&=` AssignmentExpression - 1. Let _lref_ be ? Evaluation of |LeftHandSideExpression|. - 1. [id="step-assignmentexpression-evaluation-lgcl-and-getvalue"] Let _lval_ be ? GetValue(_lref_). - 1. Let _lbool_ be ToBoolean(_lval_). - 1. If _lbool_ is *false*, return _lval_. + 1. Let _lRef_ be ? Evaluation of |LeftHandSideExpression|. + 1. [id="step-assignmentexpression-evaluation-lgcl-and-getvalue"] Let _lVal_ be ? GetValue(_lRef_). + 1. If ToBoolean(_lVal_) is *false*, return _lVal_. 1. If IsAnonymousFunctionDefinition(|AssignmentExpression|) is *true* and IsIdentifierRef of |LeftHandSideExpression| is *true*, then 1. Let _lhs_ be the StringValue of |LeftHandSideExpression|. - 1. Let _rval_ be ? NamedEvaluation of |AssignmentExpression| with argument _lhs_. + 1. Let _rVal_ be ? NamedEvaluation of |AssignmentExpression| with argument _lhs_. 1. Else, - 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. [id="step-assignmentexpression-evaluation-lgcl-and-putvalue"] Perform ? PutValue(_lref_, _rval_). - 1. Return _rval_. + 1. Let _rRef_ be ? Evaluation of |AssignmentExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. [id="step-assignmentexpression-evaluation-lgcl-and-putvalue"] Perform ? PutValue(_lRef_, _rVal_). + 1. Return _rVal_. AssignmentExpression : LeftHandSideExpression `||=` AssignmentExpression - 1. Let _lref_ be ? Evaluation of |LeftHandSideExpression|. - 1. [id="step-assignmentexpression-evaluation-lgcl-or-getvalue"] Let _lval_ be ? GetValue(_lref_). - 1. Let _lbool_ be ToBoolean(_lval_). - 1. If _lbool_ is *true*, return _lval_. + 1. Let _lRef_ be ? Evaluation of |LeftHandSideExpression|. + 1. [id="step-assignmentexpression-evaluation-lgcl-or-getvalue"] Let _lVal_ be ? GetValue(_lRef_). + 1. If ToBoolean(_lVal_) is *true*, return _lVal_. 1. If IsAnonymousFunctionDefinition(|AssignmentExpression|) is *true* and IsIdentifierRef of |LeftHandSideExpression| is *true*, then 1. Let _lhs_ be the StringValue of |LeftHandSideExpression|. - 1. Let _rval_ be ? NamedEvaluation of |AssignmentExpression| with argument _lhs_. + 1. Let _rVal_ be ? NamedEvaluation of |AssignmentExpression| with argument _lhs_. 1. Else, - 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. [id="step-assignmentexpression-evaluation-lgcl-or-putvalue"] Perform ? PutValue(_lref_, _rval_). - 1. Return _rval_. + 1. Let _rRef_ be ? Evaluation of |AssignmentExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. [id="step-assignmentexpression-evaluation-lgcl-or-putvalue"] Perform ? PutValue(_lRef_, _rVal_). + 1. Return _rVal_. AssignmentExpression : LeftHandSideExpression `??=` AssignmentExpression - 1. Let _lref_ be ? Evaluation of |LeftHandSideExpression|. - 1. [id="step-assignmentexpression-evaluation-lgcl-nullish-getvalue"] Let _lval_ be ? GetValue(_lref_). - 1. If _lval_ is neither *undefined* nor *null*, return _lval_. + 1. Let _lRef_ be ? Evaluation of |LeftHandSideExpression|. + 1. [id="step-assignmentexpression-evaluation-lgcl-nullish-getvalue"] Let _lVal_ be ? GetValue(_lRef_). + 1. If _lVal_ is neither *undefined* nor *null*, return _lVal_. 1. If IsAnonymousFunctionDefinition(|AssignmentExpression|) is *true* and IsIdentifierRef of |LeftHandSideExpression| is *true*, then 1. Let _lhs_ be the StringValue of |LeftHandSideExpression|. - 1. Let _rval_ be ? NamedEvaluation of |AssignmentExpression| with argument _lhs_. + 1. Let _rVal_ be ? NamedEvaluation of |AssignmentExpression| with argument _lhs_. 1. Else, - 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. [id="step-assignmentexpression-evaluation-lgcl-nullish-putvalue"] Perform ? PutValue(_lref_, _rval_). - 1. Return _rval_. + 1. Let _rRef_ be ? Evaluation of |AssignmentExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. [id="step-assignmentexpression-evaluation-lgcl-nullish-putvalue"] Perform ? PutValue(_lRef_, _rVal_). + 1. Return _rVal_. -

        When this expression occurs within strict mode code, it is a runtime error if _lref_ in step , , , , is an unresolvable reference. If it is, a *ReferenceError* exception is thrown. Additionally, it is a runtime error if the _lref_ in step , , , is a reference to a data property with the attribute value { [[Writable]]: *false* }, to an accessor property with the attribute value { [[Set]]: *undefined* }, or to a non-existent property of an object for which the IsExtensible predicate returns the value *false*. In these cases a *TypeError* exception is thrown.

        +

        When this expression occurs within strict mode code, it is a runtime error if _lRef_ in step , , , , is an unresolvable reference. If it is, a *ReferenceError* exception is thrown. Additionally, it is a runtime error if the _lRef_ in step , , , is a reference to a data property with the attribute value { [[Writable]]: *false* }, to an accessor property with the attribute value { [[Set]]: *undefined* }, or to a non-existent property of an object for which the IsExtensible predicate returns the value *false*. In these cases a *TypeError* exception is thrown.

        ApplyStringOrNumericBinaryOperator ( - _lval_: an ECMAScript language value, + _lVal_: an ECMAScript language value, _opText_: `**`, `*`, `/`, `%`, `+`, `-`, `<<`, `>>`, `>>>`, `&`, `^`, or `|`, - _rval_: an ECMAScript language value, + _rVal_: an ECMAScript language value, ): either a normal completion containing either a String, a BigInt, or a Number, or a throw completion

        1. If _opText_ is `+`, then - 1. [id="step-binary-op-toprimitive-lval"] Let _lprim_ be ? ToPrimitive(_lval_). - 1. [id="step-binary-op-toprimitive-rval"] Let _rprim_ be ? ToPrimitive(_rval_). - 1. [id="step-binary-op-string-check"] If _lprim_ is a String or _rprim_ is a String, then - 1. Let _lstr_ be ? ToString(_lprim_). - 1. Let _rstr_ be ? ToString(_rprim_). - 1. Return the string-concatenation of _lstr_ and _rstr_. - 1. Set _lval_ to _lprim_. - 1. Set _rval_ to _rprim_. + 1. [id="step-binary-op-toprimitive-lval"] Let _lPrim_ be ? ToPrimitive(_lVal_). + 1. [id="step-binary-op-toprimitive-rval"] Let _rPrim_ be ? ToPrimitive(_rVal_). + 1. [id="step-binary-op-string-check"] If _lPrim_ is a String or _rPrim_ is a String, then + 1. Let _lStr_ be ? ToString(_lPrim_). + 1. Let _rStr_ be ? ToString(_rPrim_). + 1. Return the string-concatenation of _lStr_ and _rStr_. + 1. Set _lVal_ to _lPrim_. + 1. Set _rVal_ to _rPrim_. 1. NOTE: At this point, it must be a numeric operation. - 1. Let _lnum_ be ? ToNumeric(_lval_). - 1. Let _rnum_ be ? ToNumeric(_rval_). - 1. If Type(_lnum_) is not Type(_rnum_), throw a *TypeError* exception. - 1. If _lnum_ is a BigInt, then - 1. If _opText_ is `**`, return ? BigInt::exponentiate(_lnum_, _rnum_). - 1. If _opText_ is `/`, return ? BigInt::divide(_lnum_, _rnum_). - 1. If _opText_ is `%`, return ? BigInt::remainder(_lnum_, _rnum_). - 1. If _opText_ is `>>>`, return ? BigInt::unsignedRightShift(_lnum_, _rnum_). - 1. Let _operation_ be the abstract operation associated with _opText_ and Type(_lnum_) in the following table: + 1. Let _lNum_ be ? ToNumeric(_lVal_). + 1. Let _rNum_ be ? ToNumeric(_rVal_). + 1. If Type(_lNum_) is not Type(_rNum_), throw a *TypeError* exception. + 1. If _lNum_ is a BigInt, then + 1. If _opText_ is `**`, return ? BigInt::exponentiate(_lNum_, _rNum_). + 1. If _opText_ is `/`, return ? BigInt::divide(_lNum_, _rNum_). + 1. If _opText_ is `%`, return ? BigInt::remainder(_lNum_, _rNum_). + 1. If _opText_ is `>>>`, return ? BigInt::unsignedRightShift(_lNum_, _rNum_). + 1. Let _operation_ be the abstract operation associated with _opText_ and Type(_lNum_) in the following table:
        - + @@ -20698,7 +20694,7 @@

        _opText_ Type(_lnum_) _operation_
        _opText_ Type(_lNum_) _operation_
        `**` Number Number::exponentiate
        `*` Number Number::multiply
        `|` BigInt BigInt::bitwiseOR
        - 1. Return _operation_(_lnum_, _rnum_). + 1. Return _operation_(_lNum_, _rNum_).

        No hint is provided in the calls to ToPrimitive in steps and . All standard objects except Dates handle the absence of a hint as if ~number~ were given; Dates handle the absence of a hint as if ~string~ were given. Exotic objects may handle the absence of a hint in some other manner.

        @@ -20719,11 +20715,11 @@

        - 1. Let _lref_ be ? Evaluation of _leftOperand_. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of _rightOperand_. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Return ? ApplyStringOrNumericBinaryOperator(_lval_, _opText_, _rval_). + 1. Let _lRef_ be ? Evaluation of _leftOperand_. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of _rightOperand_. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Return ? ApplyStringOrNumericBinaryOperator(_lVal_, _opText_, _rVal_). @@ -20909,7 +20905,7 @@

        AssignmentProperty : IdentifierReference Initializer? 1. Let _P_ be the StringValue of |IdentifierReference|. - 1. Let _lref_ be ? ResolveBinding(_P_). + 1. Let _lRef_ be ? ResolveBinding(_P_). 1. Let _v_ be ? GetV(_value_, _P_). 1. If |Initializer| is present and _v_ is *undefined*, then 1. If IsAnonymousFunctionDefinition(|Initializer|) is *true*, then @@ -20917,7 +20913,7 @@

        1. Else, 1. Let _defaultValue_ be ? Evaluation of |Initializer|. 1. Set _v_ to ? GetValue(_defaultValue_). - 1. Perform ? PutValue(_lref_, _v_). + 1. Perform ? PutValue(_lRef_, _v_). 1. Return « _P_ ». @@ -20940,10 +20936,10 @@

        AssignmentRestProperty : `...` DestructuringAssignmentTarget - 1. Let _lref_ be ? Evaluation of |DestructuringAssignmentTarget|. + 1. Let _lRef_ be ? Evaluation of |DestructuringAssignmentTarget|. 1. Let _restObj_ be OrdinaryObjectCreate(%Object.prototype%). 1. Perform ? CopyDataProperties(_restObj_, _value_, _excludedNames_). - 1. Return ? PutValue(_lref_, _restObj_). + 1. Return ? PutValue(_lRef_, _restObj_). @@ -20989,7 +20985,7 @@

        AssignmentElement : DestructuringAssignmentTarget Initializer? 1. If |DestructuringAssignmentTarget| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then - 1. Let _lref_ be ? Evaluation of |DestructuringAssignmentTarget|. + 1. Let _lRef_ be ? Evaluation of |DestructuringAssignmentTarget|. 1. Let _value_ be *undefined*. 1. If _iteratorRecord_.[[Done]] is *false*, then 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_). @@ -21007,7 +21003,7 @@

        1. If |DestructuringAssignmentTarget| is either an |ObjectLiteral| or an |ArrayLiteral|, then 1. Let _nestedAssignmentPattern_ be the |AssignmentPattern| that is covered by |DestructuringAssignmentTarget|. 1. Return ? DestructuringAssignmentEvaluation of _nestedAssignmentPattern_ with argument _v_. - 1. Return ? PutValue(_lref_, _v_). + 1. Return ? PutValue(_lRef_, _v_).

        Left to right evaluation order is maintained by evaluating a |DestructuringAssignmentTarget| that is not a destructuring pattern prior to accessing the iterator or evaluating the |Initializer|.

        @@ -21015,7 +21011,7 @@

        AssignmentRestElement : `...` DestructuringAssignmentTarget 1. If |DestructuringAssignmentTarget| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then - 1. Let _lref_ be ? Evaluation of |DestructuringAssignmentTarget|. + 1. Let _lRef_ be ? Evaluation of |DestructuringAssignmentTarget|. 1. Let _A_ be ! ArrayCreate(0). 1. Let _n_ be 0. 1. Repeat, while _iteratorRecord_.[[Done]] is *false*, @@ -21024,7 +21020,7 @@

        1. Perform ! CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_n_)), _next_). 1. Set _n_ to _n_ + 1. 1. If |DestructuringAssignmentTarget| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then - 1. Return ? PutValue(_lref_, _A_). + 1. Return ? PutValue(_lRef_, _A_). 1. Let _nestedAssignmentPattern_ be the |AssignmentPattern| that is covered by |DestructuringAssignmentTarget|. 1. Return ? DestructuringAssignmentEvaluation of _nestedAssignmentPattern_ with argument _A_. @@ -21042,7 +21038,7 @@

        AssignmentElement : DestructuringAssignmentTarget Initializer? 1. If |DestructuringAssignmentTarget| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then - 1. Let _lref_ be ? Evaluation of |DestructuringAssignmentTarget|. + 1. Let _lRef_ be ? Evaluation of |DestructuringAssignmentTarget|. 1. Let _v_ be ? GetV(_value_, _propertyName_). 1. If |Initializer| is present and _v_ is *undefined*, then 1. If IsAnonymousFunctionDefinition(|Initializer|) is *true* and IsIdentifierRef of |DestructuringAssignmentTarget| is *true*, then @@ -21056,7 +21052,7 @@

        1. If |DestructuringAssignmentTarget| is either an |ObjectLiteral| or an |ArrayLiteral|, then 1. Let _assignmentPattern_ be the |AssignmentPattern| that is covered by |DestructuringAssignmentTarget|. 1. Return ? DestructuringAssignmentEvaluation of _assignmentPattern_ with argument _rhsValue_. - 1. Return ? PutValue(_lref_, _rhsValue_). + 1. Return ? PutValue(_lRef_, _rhsValue_). @@ -21075,10 +21071,10 @@

        Syntax

        Runtime Semantics: Evaluation

        Expression : Expression `,` AssignmentExpression - 1. Let _lref_ be ? Evaluation of |Expression|. - 1. Perform ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. - 1. Return ? GetValue(_rref_). + 1. Let _lRef_ be ? Evaluation of |Expression|. + 1. Perform ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |AssignmentExpression|. + 1. Return ? GetValue(_rRef_).

        GetValue must be called even though its value is not used because it may have observable side-effects.

        @@ -21401,8 +21397,8 @@

        Runtime Semantics: Evaluation

        VariableDeclaration : BindingPattern Initializer 1. Let _rhs_ be ? Evaluation of |Initializer|. - 1. Let _rval_ be ? GetValue(_rhs_). - 1. Return ? BindingInitialization of |BindingPattern| with arguments _rval_ and *undefined*. + 1. Let _rVal_ be ? GetValue(_rhs_). + 1. Return ? BindingInitialization of |BindingPattern| with arguments _rVal_ and *undefined*. @@ -22388,11 +22384,11 @@

        %ForInIteratorPrototype%.next ( )

        1. Let _desc_ be ? _object_.[[GetOwnProperty]](_r_). 1. If _desc_ is not *undefined*, then 1. Append _r_ to _O_.[[VisitedKeys]]. - 1. If _desc_.[[Enumerable]] is *true*, return CreateIterResultObject(_r_, *false*). + 1. If _desc_.[[Enumerable]] is *true*, return CreateIteratorResultObject(_r_, *false*). 1. Set _object_ to ? _object_.[[GetPrototypeOf]](). 1. Set _O_.[[Object]] to _object_. 1. Set _O_.[[ObjectWasVisited]] to *false*. - 1. If _object_ is *null*, return CreateIterResultObject(*undefined*, *true*). + 1. If _object_ is *null*, return CreateIteratorResultObject(*undefined*, *true*).
        @@ -23553,7 +23549,7 @@

        Syntax

        ArrowParameters[Yield, Await] : BindingIdentifier[?Yield, ?Await] - CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] #parencover + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] #parenCover ConciseBody[In] : [lookahead != `{`] ExpressionBody[?In, ~Await] @@ -25223,9 +25219,9 @@

        1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). - 1. Let _declResult_ be Completion(FunctionDeclarationInstantiation(_functionObject_, _argumentsList_)). - 1. If _declResult_ is an abrupt completion, then - 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _declResult_.[[Value]] »). + 1. Let _completion_ be Completion(FunctionDeclarationInstantiation(_functionObject_, _argumentsList_)). + 1. If _completion_ is an abrupt completion, then + 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _completion_.[[Value]] »). 1. Else, 1. Perform AsyncFunctionStart(_promiseCapability_, |FunctionBody|). 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _promiseCapability_.[[Promise]], [[Target]]: ~empty~ }. @@ -25258,7 +25254,7 @@

        Syntax

        AsyncArrowFunction[In, Yield, Await] : `async` [no LineTerminator here] AsyncArrowBindingIdentifier[?Yield] [no LineTerminator here] `=>` AsyncConciseBody[?In] - CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] [no LineTerminator here] `=>` AsyncConciseBody[?In] #callcover + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] [no LineTerminator here] `=>` AsyncConciseBody[?In] #callCover AsyncConciseBody[In] : [lookahead != `{`] ExpressionBody[?In, +Await] @@ -25330,9 +25326,9 @@

        1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). - 1. Let _declResult_ be Completion(FunctionDeclarationInstantiation(_functionObject_, _argumentsList_)). - 1. If _declResult_ is an abrupt completion, then - 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _declResult_.[[Value]] »). + 1. Let _completion_ be Completion(FunctionDeclarationInstantiation(_functionObject_, _argumentsList_)). + 1. If _completion_ is an abrupt completion, then + 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _completion_.[[Value]] »). 1. Else, 1. Perform AsyncFunctionStart(_promiseCapability_, |ExpressionBody|). 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _promiseCapability_.[[Promise]], [[Target]]: ~empty~ }. @@ -26991,7 +26987,7 @@

        Example Cyclic Module Record Graphs

        • Evaluation must be only performed once, as it can cause side effects; it is thus important to remember whether evaluation has already been performed, even if unsuccessfully. (In the error case, it makes sense to also remember the exception because otherwise subsequent Evaluate() calls would have to synthesize a new one.)
        • Linking, on the other hand, is side-effect-free, and thus even if it fails, it can be retried at a later time with no issues.
        • -
        • Loading closely interacts with the host, and it may be desiderable for some of them to allow users to retry failed loads (for example, if the failure is caused by temporarily bad network conditions).
        • +
        • Loading closely interacts with the host, and it may be desirable for some of them to allow users to retry failed loads (for example, if the failure is caused by temporarily bad network conditions).

        Now, consider a module graph with a cycle:

        @@ -27008,7 +27004,7 @@

        Example Cyclic Module Record Graphs

        Now consider a case where _A_ has a linking error; for example, it tries to import a binding from _C_ that does not exist. In that case, the above steps still occur, including the early return from the second call to InnerModuleLinking on _A_. However, once we unwind back to the original InnerModuleLinking on _A_, it fails during InitializeEnvironment, namely right after _C_.ResolveExport(). The thrown *SyntaxError* exception propagates up to _A_.Link, which resets all modules that are currently on its _stack_ (these are always exactly the modules that are still ~linking~). Hence both _A_ and _B_ become ~unlinked~. Note that _C_ is left as ~linked~.

        -

        Alternatively, consider a case where _A_ has an evaluation error; for example, its source code throws an exception. In that case, the evaluation-time analog of the above steps still occurs, including the early return from the second call to InnerModuleEvaluation on _A_. However, once we unwind back to the original InnerModuleEvaluation on _A_, it fails by assumption. The exception thrown propagates up to _A_.Evaluate(), which records the error in all modules that are currently on its _stack_ (i.e., the modules that are still ~evaluating~) as well as via [[AsyncParentModules]], which form a chain for modules which contain or depend on top-level `await` through the whole dependency graph through the AsyncModuleExecutionRejected algorithm. Hence both _A_ and _B_ become ~evaluated~ and the exception is recorded in both _A_ and _B_'s [[EvaluationError]] fields, while _C_ is left as ~evaluated~ with no [[EvaluationError]].

        +

        Alternatively, consider a case where _A_ has an evaluation error; for example, its source code throws an exception. In that case, the evaluation-time analogue of the above steps still occurs, including the early return from the second call to InnerModuleEvaluation on _A_. However, once we unwind back to the original InnerModuleEvaluation on _A_, it fails by assumption. The exception thrown propagates up to _A_.Evaluate(), which records the error in all modules that are currently on its _stack_ (i.e., the modules that are still ~evaluating~) as well as via [[AsyncParentModules]], which form a chain for modules which contain or depend on top-level `await` through the whole dependency graph through the AsyncModuleExecutionRejected algorithm. Hence both _A_ and _B_ become ~evaluated~ and the exception is recorded in both _A_ and _B_'s [[EvaluationError]] fields, while _C_ is left as ~evaluated~ with no [[EvaluationError]].

        Lastly, consider a module graph with a cycle, where all modules complete asynchronously:

        @@ -28957,7 +28953,7 @@

        ECMAScript Standard Built-in Objects

        Each built-in function defined in this specification is created by calling the CreateBuiltinFunction abstract operation (). The values of the _length_ and _name_ parameters are the initial values of the *"length"* and *"name"* properties as discussed below. The values of the _prefix_ parameter are similarly discussed below.

        Every built-in function object, including constructors, has a *"length"* property whose value is a non-negative integral Number. Unless otherwise specified, this value is the number of required parameters shown in the subclause heading for the function description. Optional parameters and rest parameters are not included in the parameter count.

        -

        For example, the function object that is the initial value of the *"map"* property of the Array prototype object is described under the subclause heading «Array.prototype.map (callbackFn [ , thisArg])» which shows the two named arguments callbackFn and thisArg, the latter being optional; therefore the value of the *"length"* property of that function object is *1*𝔽.

        +

        For example, the function object that is the initial value of the *"map"* property of the Array prototype object is described under the subclause heading «Array.prototype.map (callback [ , thisArg])» which shows the two named arguments callback and thisArg, the latter being optional; therefore the value of the *"length"* property of that function object is *1*𝔽.

        Unless otherwise specified, the *"length"* property of a built-in function object has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.

        Every built-in function object, including constructors, has a *"name"* property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification. Functions that are identified as anonymous functions use the empty String as the value of the *"name"* property. For functions that are specified as properties of objects, the name value is the property name string used to access the function. Functions that are specified as get or set accessor functions of built-in properties have *"get"* or *"set"* (respectively) passed to the _prefix_ parameter when calling CreateBuiltinFunction.

        @@ -29930,15 +29926,15 @@

        Object.getPrototypeOf ( _O_ )

        -

        Object.groupBy ( _items_, _callbackfn_ )

        +

        Object.groupBy ( _items_, _callback_ )

        -

        _callbackfn_ should be a function that accepts two arguments. `groupBy` calls _callbackfn_ once for each element in _items_, in ascending order, and constructs a new object. Each value returned by _callbackfn_ is coerced to a property key. For each such property key, the result object has a property whose key is that property key and whose value is an array containing all the elements for which the _callbackfn_ return value coerced to that key.

        -

        _callbackfn_ is called with two arguments: the value of the element and the index of the element.

        +

        _callback_ should be a function that accepts two arguments. `groupBy` calls _callback_ once for each element in _items_, in ascending order, and constructs a new object. Each value returned by _callback_ is coerced to a property key. For each such property key, the result object has a property whose key is that property key and whose value is an array containing all the elements for which the _callback_ return value coerced to that key.

        +

        _callback_ is called with two arguments: the value of the element and the index of the element.

        The return value of `groupBy` is an object that does not inherit from %Object.prototype%.

        This function performs the following steps when called:

        - 1. Let _groups_ be ? GroupBy(_items_, _callbackfn_, ~property~). + 1. Let _groups_ be ? GroupBy(_items_, _callback_, ~property~). 1. Let _obj_ be OrdinaryObjectCreate(*null*). 1. For each Record { [[Key]], [[Elements]] } _g_ of _groups_, do 1. Let _elements_ be CreateArrayFromList(_g_.[[Elements]]). @@ -30374,7 +30370,7 @@

        1. Perform ! DefinePropertyOrThrow(_F_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Else if _kind_ is ~normal~, then 1. Perform MakeConstructor(_F_). - 1. NOTE: Functions whose _kind_ is ~async~ are not constructible and do not have a [[Construct]] internal method or a *"prototype"* property. + 1. NOTE: Functions whose _kind_ is ~async~ are not constructable and do not have a [[Construct]] internal method or a *"prototype"* property. 1. Return _F_. @@ -31144,14 +31140,14 @@

        _NativeError_ ( _message_ [ , _options_ ] )

        Each _NativeError_ function performs the following steps when called:

        1. If NewTarget is *undefined*, let _newTarget_ be the active function object; else let _newTarget_ be NewTarget. - 1. [id="step-nativerror-ordinarycreatefromconstructor"] Let _O_ be ? OrdinaryCreateFromConstructor(_newTarget_, "%NativeError.prototype%", « [[ErrorData]] »). + 1. [id="step-nativeerror-ordinarycreatefromconstructor"] Let _O_ be ? OrdinaryCreateFromConstructor(_newTarget_, "%NativeError.prototype%", « [[ErrorData]] »). 1. If _message_ is not *undefined*, then 1. Let _msg_ be ? ToString(_message_). 1. Perform CreateNonEnumerableDataPropertyOrThrow(_O_, *"message"*, _msg_). 1. Perform ? InstallErrorCause(_O_, _options_). 1. Return _O_. -

        The actual value of the string passed in step is either *"%EvalError.prototype%"*, *"%RangeError.prototype%"*, *"%ReferenceError.prototype%"*, *"%SyntaxError.prototype%"*, *"%TypeError.prototype%"*, or *"%URIError.prototype%"* corresponding to which _NativeError_ constructor is being defined.

        +

        The actual value of the string passed in step is either *"%EvalError.prototype%"*, *"%RangeError.prototype%"*, *"%ReferenceError.prototype%"*, *"%SyntaxError.prototype%"*, *"%TypeError.prototype%"*, or *"%URIError.prototype%"* corresponding to which _NativeError_ constructor is being defined.

        @@ -35499,7 +35495,7 @@

        String.prototype [ %Symbol.iterator% ] ( )

        1. Let _nextIndex_ be _position_ + _cp_.[[CodeUnitCount]]. 1. Let _resultString_ be the substring of _s_ from _position_ to _nextIndex_. 1. Set _position_ to _nextIndex_. - 1. Perform ? GeneratorYield(CreateIterResultObject(_resultString_, *false*)). + 1. Perform ? GeneratorYield(CreateIteratorResultObject(_resultString_, *false*)). 1. Return *undefined*. 1. Return CreateIteratorFromClosure(_closure_, *"%StringIteratorPrototype%"*, %StringIteratorPrototype%). @@ -38084,15 +38080,15 @@

        RegExp.prototype [ %Symbol.replace% ] ( _string_, _replaceValue_ )

        1. Let _replacerArgs_ be the list-concatenation of « _matched_ », _captures_, and « 𝔽(_position_), _S_ ». 1. If _namedCaptures_ is not *undefined*, then 1. Append _namedCaptures_ to _replacerArgs_. - 1. Let _replValue_ be ? Call(_replaceValue_, *undefined*, _replacerArgs_). - 1. Let _replacement_ be ? ToString(_replValue_). + 1. Let _replacementValue_ be ? Call(_replaceValue_, *undefined*, _replacerArgs_). + 1. Let _replacementString_ be ? ToString(_replacementValue_). 1. Else, 1. If _namedCaptures_ is not *undefined*, then 1. Set _namedCaptures_ to ? ToObject(_namedCaptures_). - 1. Let _replacement_ be ? GetSubstitution(_matched_, _S_, _position_, _captures_, _namedCaptures_, _replaceValue_). + 1. Let _replacementString_ be ? GetSubstitution(_matched_, _S_, _position_, _captures_, _namedCaptures_, _replaceValue_). 1. If _position_ ≥ _nextSourcePosition_, then 1. NOTE: _position_ should not normally move backwards. If it does, it is an indication of an ill-behaving RegExp subclass or use of an access triggered side-effect to change the global flag or other characteristics of _rx_. In such cases, the corresponding substitution is ignored. - 1. Set _accumulatedResult_ to the string-concatenation of _accumulatedResult_, the substring of _S_ from _nextSourcePosition_ to _position_, and _replacement_. + 1. Set _accumulatedResult_ to the string-concatenation of _accumulatedResult_, the substring of _S_ from _nextSourcePosition_ to _position_, and _replacementString_. 1. Set _nextSourcePosition_ to _position_ + _matchLength_. 1. If _nextSourcePosition_ ≥ _lengthS_, return _accumulatedResult_. 1. Return the string-concatenation of _accumulatedResult_ and the substring of _S_ from _nextSourcePosition_. @@ -38580,14 +38576,14 @@

        1. Let _match_ be ? RegExpExec(_R_, _S_). 1. If _match_ is *null*, return *undefined*. 1. If _global_ is *false*, then - 1. Perform ? GeneratorYield(CreateIterResultObject(_match_, *false*)). + 1. Perform ? GeneratorYield(CreateIteratorResultObject(_match_, *false*)). 1. Return *undefined*. 1. Let _matchStr_ be ? ToString(? Get(_match_, *"0"*)). 1. If _matchStr_ is the empty String, then 1. Let _thisIndex_ be ℝ(? ToLength(? Get(_R_, *"lastIndex"*))). 1. Let _nextIndex_ be AdvanceStringIndex(_S_, _thisIndex_, _fullUnicode_). 1. Perform ? Set(_R_, *"lastIndex"*, 𝔽(_nextIndex_), *true*). - 1. Perform ? GeneratorYield(CreateIterResultObject(_match_, *false*)). + 1. Perform ? GeneratorYield(CreateIteratorResultObject(_match_, *false*)). 1. Return CreateIteratorFromClosure(_closure_, *"%RegExpStringIteratorPrototype%"*, %RegExpStringIteratorPrototype%). @@ -38683,14 +38679,14 @@

        Properties of the Array Constructor

        -

        Array.from ( _items_ [ , _mapfn_ [ , _thisArg_ ] ] )

        +

        Array.from ( _items_ [ , _mapper_ [ , _thisArg_ ] ] )

        This method performs the following steps when called:

        1. Let _C_ be the *this* value. - 1. If _mapfn_ is *undefined*, then + 1. If _mapper_ is *undefined*, then 1. Let _mapping_ be *false*. 1. Else, - 1. If IsCallable(_mapfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_mapper_) is *false*, throw a *TypeError* exception. 1. Let _mapping_ be *true*. 1. Let _usingIterator_ be ? GetMethod(_items_, %Symbol.iterator%). 1. If _usingIterator_ is not *undefined*, then @@ -38710,7 +38706,7 @@

        Array.from ( _items_ [ , _mapfn_ [ , _thisArg_ ] ] )

        1. Perform ? Set(_A_, *"length"*, 𝔽(_k_), *true*). 1. Return _A_. 1. If _mapping_ is *true*, then - 1. Let _mappedValue_ be Completion(Call(_mapfn_, _thisArg_, « _next_, 𝔽(_k_) »)). + 1. Let _mappedValue_ be Completion(Call(_mapper_, _thisArg_, « _next_, 𝔽(_k_) »)). 1. IfAbruptCloseIterator(_mappedValue_, _iteratorRecord_). 1. Else, 1. Let _mappedValue_ be _next_. @@ -38729,7 +38725,7 @@

        Array.from ( _items_ [ , _mapfn_ [ , _thisArg_ ] ] )

        1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kValue_ be ? Get(_arrayLike_, _Pk_). 1. If _mapping_ is *true*, then - 1. Let _mappedValue_ be ? Call(_mapfn_, _thisArg_, « _kValue_, 𝔽(_k_) »). + 1. Let _mappedValue_ be ? Call(_mapper_, _thisArg_, « _kValue_, 𝔽(_k_) »). 1. Else, 1. Let _mappedValue_ be _kValue_. 1. Perform ? CreateDataPropertyOrThrow(_A_, _Pk_, _mappedValue_). @@ -38944,26 +38940,26 @@

        Array.prototype.entries ( )

        -

        Array.prototype.every ( _callbackfn_ [ , _thisArg_ ] )

        +

        Array.prototype.every ( _callback_ [ , _thisArg_ ] )

        -

        _callbackfn_ should be a function that accepts three arguments and returns a value that is coercible to a Boolean value. `every` calls _callbackfn_ once for each element present in the array, in ascending order, until it finds one where _callbackfn_ returns *false*. If such an element is found, `every` immediately returns *false*. Otherwise, `every` returns *true*. _callbackfn_ is called only for elements of the array which actually exist; it is not called for missing elements of the array.

        -

        If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callbackfn_. If it is not provided, *undefined* is used instead.

        -

        _callbackfn_ is called with three arguments: the value of the element, the index of the element, and the object being traversed.

        -

        `every` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callbackfn_.

        -

        The range of elements processed by `every` is set before the first call to _callbackfn_. Elements which are appended to the array after the call to `every` begins will not be visited by _callbackfn_. If existing elements of the array are changed, their value as passed to _callbackfn_ will be the value at the time `every` visits them; elements that are deleted after the call to `every` begins and before being visited are not visited. `every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns *true*.

        +

        _callback_ should be a function that accepts three arguments and returns a value that is coercible to a Boolean value. `every` calls _callback_ once for each element present in the array, in ascending order, until it finds one where _callback_ returns *false*. If such an element is found, `every` immediately returns *false*. Otherwise, `every` returns *true*. _callback_ is called only for elements of the array which actually exist; it is not called for missing elements of the array.

        +

        If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callback_. If it is not provided, *undefined* is used instead.

        +

        _callback_ is called with three arguments: the value of the element, the index of the element, and the object being traversed.

        +

        `every` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callback_.

        +

        The range of elements processed by `every` is set before the first call to _callback_. Elements which are appended to the array after the call to `every` begins will not be visited by _callback_. If existing elements of the array are changed, their value as passed to _callback_ will be the value at the time `every` visits them; elements that are deleted after the call to `every` begins and before being visited are not visited. `every` acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns *true*.

        This method performs the following steps when called:

        1. Let _O_ be ? ToObject(*this* value). 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _k_ be 0. 1. Repeat, while _k_ < _len_, 1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kPresent_ be ? HasProperty(_O_, _Pk_). 1. If _kPresent_ is *true*, then 1. Let _kValue_ be ? Get(_O_, _Pk_). - 1. Let _testResult_ be ToBoolean(? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). + 1. Let _testResult_ be ToBoolean(? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). 1. If _testResult_ is *false*, return *false*. 1. Set _k_ to _k_ + 1. 1. Return *true*. @@ -39006,19 +39002,19 @@

        Array.prototype.fill ( _value_ [ , _start_ [ , _end_ ] ] )

        -

        Array.prototype.filter ( _callbackfn_ [ , _thisArg_ ] )

        +

        Array.prototype.filter ( _callback_ [ , _thisArg_ ] )

        -

        _callbackfn_ should be a function that accepts three arguments and returns a value that is coercible to a Boolean value. `filter` calls _callbackfn_ once for each element in the array, in ascending order, and constructs a new array of all the values for which _callbackfn_ returns *true*. _callbackfn_ is called only for elements of the array which actually exist; it is not called for missing elements of the array.

        -

        If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callbackfn_. If it is not provided, *undefined* is used instead.

        -

        _callbackfn_ is called with three arguments: the value of the element, the index of the element, and the object being traversed.

        -

        `filter` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callbackfn_.

        -

        The range of elements processed by `filter` is set before the first call to _callbackfn_. Elements which are appended to the array after the call to `filter` begins will not be visited by _callbackfn_. If existing elements of the array are changed their value as passed to _callbackfn_ will be the value at the time `filter` visits them; elements that are deleted after the call to `filter` begins and before being visited are not visited.

        +

        _callback_ should be a function that accepts three arguments and returns a value that is coercible to a Boolean value. `filter` calls _callback_ once for each element in the array, in ascending order, and constructs a new array of all the values for which _callback_ returns *true*. _callback_ is called only for elements of the array which actually exist; it is not called for missing elements of the array.

        +

        If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callback_. If it is not provided, *undefined* is used instead.

        +

        _callback_ is called with three arguments: the value of the element, the index of the element, and the object being traversed.

        +

        `filter` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callback_.

        +

        The range of elements processed by `filter` is set before the first call to _callback_. Elements which are appended to the array after the call to `filter` begins will not be visited by _callback_. If existing elements of the array are changed their value as passed to _callback_ will be the value at the time `filter` visits them; elements that are deleted after the call to `filter` begins and before being visited are not visited.

        This method performs the following steps when called:

        1. Let _O_ be ? ToObject(*this* value). 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _A_ be ? ArraySpeciesCreate(_O_, 0). 1. Let _k_ be 0. 1. Let _to_ be 0. @@ -39027,7 +39023,7 @@

        Array.prototype.filter ( _callbackfn_ [ , _thisArg_ ] )

        1. Let _kPresent_ be ? HasProperty(_O_, _Pk_). 1. If _kPresent_ is *true*, then 1. Let _kValue_ be ? Get(_O_, _Pk_). - 1. Let _selected_ be ToBoolean(? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). + 1. Let _selected_ be ToBoolean(? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). 1. If _selected_ is *true*, then 1. Perform ? CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_to_)), _kValue_). 1. Set _to_ to _to_ + 1. @@ -39219,26 +39215,26 @@

        Array.prototype.flatMap ( _mapperFunction_ [ , _thisArg_ ] )

        -

        Array.prototype.forEach ( _callbackfn_ [ , _thisArg_ ] )

        +

        Array.prototype.forEach ( _callback_ [ , _thisArg_ ] )

        -

        _callbackfn_ should be a function that accepts three arguments. `forEach` calls _callbackfn_ once for each element present in the array, in ascending order. _callbackfn_ is called only for elements of the array which actually exist; it is not called for missing elements of the array.

        -

        If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callbackfn_. If it is not provided, *undefined* is used instead.

        -

        _callbackfn_ is called with three arguments: the value of the element, the index of the element, and the object being traversed.

        -

        `forEach` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callbackfn_.

        -

        The range of elements processed by `forEach` is set before the first call to _callbackfn_. Elements which are appended to the array after the call to `forEach` begins will not be visited by _callbackfn_. If existing elements of the array are changed, their value as passed to _callbackfn_ will be the value at the time `forEach` visits them; elements that are deleted after the call to `forEach` begins and before being visited are not visited.

        +

        _callback_ should be a function that accepts three arguments. `forEach` calls _callback_ once for each element present in the array, in ascending order. _callback_ is called only for elements of the array which actually exist; it is not called for missing elements of the array.

        +

        If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callback_. If it is not provided, *undefined* is used instead.

        +

        _callback_ is called with three arguments: the value of the element, the index of the element, and the object being traversed.

        +

        `forEach` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callback_.

        +

        The range of elements processed by `forEach` is set before the first call to _callback_. Elements which are appended to the array after the call to `forEach` begins will not be visited by _callback_. If existing elements of the array are changed, their value as passed to _callback_ will be the value at the time `forEach` visits them; elements that are deleted after the call to `forEach` begins and before being visited are not visited.

        This method performs the following steps when called:

        1. Let _O_ be ? ToObject(*this* value). 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _k_ be 0. 1. Repeat, while _k_ < _len_, 1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kPresent_ be ? HasProperty(_O_, _Pk_). 1. If _kPresent_ is *true*, then 1. Let _kValue_ be ? Get(_O_, _Pk_). - 1. Perform ? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »). + 1. Perform ? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »). 1. Set _k_ to _k_ + 1. 1. Return *undefined*. @@ -39381,19 +39377,19 @@

        Array.prototype.lastIndexOf ( _searchElement_ [ , _fromIndex_ ] )

        -

        Array.prototype.map ( _callbackfn_ [ , _thisArg_ ] )

        +

        Array.prototype.map ( _callback_ [ , _thisArg_ ] )

        -

        _callbackfn_ should be a function that accepts three arguments. `map` calls _callbackfn_ once for each element in the array, in ascending order, and constructs a new Array from the results. _callbackfn_ is called only for elements of the array which actually exist; it is not called for missing elements of the array.

        -

        If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callbackfn_. If it is not provided, *undefined* is used instead.

        -

        _callbackfn_ is called with three arguments: the value of the element, the index of the element, and the object being traversed.

        -

        `map` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callbackfn_.

        -

        The range of elements processed by `map` is set before the first call to _callbackfn_. Elements which are appended to the array after the call to `map` begins will not be visited by _callbackfn_. If existing elements of the array are changed, their value as passed to _callbackfn_ will be the value at the time `map` visits them; elements that are deleted after the call to `map` begins and before being visited are not visited.

        +

        _callback_ should be a function that accepts three arguments. `map` calls _callback_ once for each element in the array, in ascending order, and constructs a new Array from the results. _callback_ is called only for elements of the array which actually exist; it is not called for missing elements of the array.

        +

        If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callback_. If it is not provided, *undefined* is used instead.

        +

        _callback_ is called with three arguments: the value of the element, the index of the element, and the object being traversed.

        +

        `map` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callback_.

        +

        The range of elements processed by `map` is set before the first call to _callback_. Elements which are appended to the array after the call to `map` begins will not be visited by _callback_. If existing elements of the array are changed, their value as passed to _callback_ will be the value at the time `map` visits them; elements that are deleted after the call to `map` begins and before being visited are not visited.

        This method performs the following steps when called:

        1. Let _O_ be ? ToObject(*this* value). 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _A_ be ? ArraySpeciesCreate(_O_, _len_). 1. Let _k_ be 0. 1. Repeat, while _k_ < _len_, @@ -39401,7 +39397,7 @@

        Array.prototype.map ( _callbackfn_ [ , _thisArg_ ] )

        1. Let _kPresent_ be ? HasProperty(_O_, _Pk_). 1. If _kPresent_ is *true*, then 1. Let _kValue_ be ? Get(_O_, _Pk_). - 1. Let _mappedValue_ be ? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »). + 1. Let _mappedValue_ be ? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »). 1. Perform ? CreateDataPropertyOrThrow(_A_, _Pk_, _mappedValue_). 1. Set _k_ to _k_ + 1. 1. Return _A_. @@ -39461,18 +39457,18 @@

        Array.prototype.push ( ..._items_ )

        -

        Array.prototype.reduce ( _callbackfn_ [ , _initialValue_ ] )

        +

        Array.prototype.reduce ( _callback_ [ , _initialValue_ ] )

        -

        _callbackfn_ should be a function that takes four arguments. `reduce` calls the callback, as a function, once for each element after the first element present in the array, in ascending order.

        -

        _callbackfn_ is called with four arguments: the _previousValue_ (value from the previous call to _callbackfn_), the _currentValue_ (value of the current element), the _currentIndex_, and the object being traversed. The first time that callback is called, the _previousValue_ and _currentValue_ can be one of two values. If an _initialValue_ was supplied in the call to `reduce`, then _previousValue_ will be _initialValue_ and _currentValue_ will be the first value in the array. If no _initialValue_ was supplied, then _previousValue_ will be the first value in the array and _currentValue_ will be the second. It is a *TypeError* if the array contains no elements and _initialValue_ is not provided.

        -

        `reduce` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callbackfn_.

        -

        The range of elements processed by `reduce` is set before the first call to _callbackfn_. Elements that are appended to the array after the call to `reduce` begins will not be visited by _callbackfn_. If existing elements of the array are changed, their value as passed to _callbackfn_ will be the value at the time `reduce` visits them; elements that are deleted after the call to `reduce` begins and before being visited are not visited.

        +

        _callback_ should be a function that takes four arguments. `reduce` calls the callback, as a function, once for each element after the first element present in the array, in ascending order.

        +

        _callback_ is called with four arguments: the _previousValue_ (value from the previous call to _callback_), the _currentValue_ (value of the current element), the _currentIndex_, and the object being traversed. The first time that callback is called, the _previousValue_ and _currentValue_ can be one of two values. If an _initialValue_ was supplied in the call to `reduce`, then _previousValue_ will be _initialValue_ and _currentValue_ will be the first value in the array. If no _initialValue_ was supplied, then _previousValue_ will be the first value in the array and _currentValue_ will be the second. It is a *TypeError* if the array contains no elements and _initialValue_ is not provided.

        +

        `reduce` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callback_.

        +

        The range of elements processed by `reduce` is set before the first call to _callback_. Elements that are appended to the array after the call to `reduce` begins will not be visited by _callback_. If existing elements of the array are changed, their value as passed to _callback_ will be the value at the time `reduce` visits them; elements that are deleted after the call to `reduce` begins and before being visited are not visited.

        This method performs the following steps when called:

        1. Let _O_ be ? ToObject(*this* value). 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. If _len_ = 0 and _initialValue_ is not present, throw a *TypeError* exception. 1. Let _k_ be 0. 1. Let _accumulator_ be *undefined*. @@ -39492,7 +39488,7 @@

        Array.prototype.reduce ( _callbackfn_ [ , _initialValue_ ] )

        1. Let _kPresent_ be ? HasProperty(_O_, _Pk_). 1. If _kPresent_ is *true*, then 1. Let _kValue_ be ? Get(_O_, _Pk_). - 1. Set _accumulator_ to ? Call(_callbackfn_, *undefined*, « _accumulator_, _kValue_, 𝔽(_k_), _O_ »). + 1. Set _accumulator_ to ? Call(_callback_, *undefined*, « _accumulator_, _kValue_, 𝔽(_k_), _O_ »). 1. Set _k_ to _k_ + 1. 1. Return _accumulator_.
        @@ -39502,18 +39498,18 @@

        Array.prototype.reduce ( _callbackfn_ [ , _initialValue_ ] )

        -

        Array.prototype.reduceRight ( _callbackfn_ [ , _initialValue_ ] )

        +

        Array.prototype.reduceRight ( _callback_ [ , _initialValue_ ] )

        -

        _callbackfn_ should be a function that takes four arguments. `reduceRight` calls the callback, as a function, once for each element after the first element present in the array, in descending order.

        -

        _callbackfn_ is called with four arguments: the _previousValue_ (value from the previous call to _callbackfn_), the _currentValue_ (value of the current element), the _currentIndex_, and the object being traversed. The first time the function is called, the _previousValue_ and _currentValue_ can be one of two values. If an _initialValue_ was supplied in the call to `reduceRight`, then _previousValue_ will be _initialValue_ and _currentValue_ will be the last value in the array. If no _initialValue_ was supplied, then _previousValue_ will be the last value in the array and _currentValue_ will be the second-to-last value. It is a *TypeError* if the array contains no elements and _initialValue_ is not provided.

        -

        `reduceRight` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callbackfn_.

        -

        The range of elements processed by `reduceRight` is set before the first call to _callbackfn_. Elements that are appended to the array after the call to `reduceRight` begins will not be visited by _callbackfn_. If existing elements of the array are changed by _callbackfn_, their value as passed to _callbackfn_ will be the value at the time `reduceRight` visits them; elements that are deleted after the call to `reduceRight` begins and before being visited are not visited.

        +

        _callback_ should be a function that takes four arguments. `reduceRight` calls the callback, as a function, once for each element after the first element present in the array, in descending order.

        +

        _callback_ is called with four arguments: the _previousValue_ (value from the previous call to _callback_), the _currentValue_ (value of the current element), the _currentIndex_, and the object being traversed. The first time the function is called, the _previousValue_ and _currentValue_ can be one of two values. If an _initialValue_ was supplied in the call to `reduceRight`, then _previousValue_ will be _initialValue_ and _currentValue_ will be the last value in the array. If no _initialValue_ was supplied, then _previousValue_ will be the last value in the array and _currentValue_ will be the second-to-last value. It is a *TypeError* if the array contains no elements and _initialValue_ is not provided.

        +

        `reduceRight` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callback_.

        +

        The range of elements processed by `reduceRight` is set before the first call to _callback_. Elements that are appended to the array after the call to `reduceRight` begins will not be visited by _callback_. If existing elements of the array are changed by _callback_, their value as passed to _callback_ will be the value at the time `reduceRight` visits them; elements that are deleted after the call to `reduceRight` begins and before being visited are not visited.

        This method performs the following steps when called:

        1. Let _O_ be ? ToObject(*this* value). 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. If _len_ = 0 and _initialValue_ is not present, throw a *TypeError* exception. 1. Let _k_ be _len_ - 1. 1. Let _accumulator_ be *undefined*. @@ -39533,7 +39529,7 @@

        Array.prototype.reduceRight ( _callbackfn_ [ , _initialValue_ ] )

        1. Let _kPresent_ be ? HasProperty(_O_, _Pk_). 1. If _kPresent_ is *true*, then 1. Let _kValue_ be ? Get(_O_, _Pk_). - 1. Set _accumulator_ to ? Call(_callbackfn_, *undefined*, « _accumulator_, _kValue_, 𝔽(_k_), _O_ »). + 1. Set _accumulator_ to ? Call(_callback_, *undefined*, « _accumulator_, _kValue_, 𝔽(_k_), _O_ »). 1. Set _k_ to _k_ - 1. 1. Return _accumulator_.
        @@ -39653,26 +39649,26 @@

        Array.prototype.slice ( _start_, _end_ )

        -

        Array.prototype.some ( _callbackfn_ [ , _thisArg_ ] )

        +

        Array.prototype.some ( _callback_ [ , _thisArg_ ] )

        -

        _callbackfn_ should be a function that accepts three arguments and returns a value that is coercible to a Boolean value. `some` calls _callbackfn_ once for each element present in the array, in ascending order, until it finds one where _callbackfn_ returns *true*. If such an element is found, `some` immediately returns *true*. Otherwise, `some` returns *false*. _callbackfn_ is called only for elements of the array which actually exist; it is not called for missing elements of the array.

        -

        If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callbackfn_. If it is not provided, *undefined* is used instead.

        -

        _callbackfn_ is called with three arguments: the value of the element, the index of the element, and the object being traversed.

        -

        `some` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callbackfn_.

        -

        The range of elements processed by `some` is set before the first call to _callbackfn_. Elements that are appended to the array after the call to `some` begins will not be visited by _callbackfn_. If existing elements of the array are changed, their value as passed to _callbackfn_ will be the value at the time that `some` visits them; elements that are deleted after the call to `some` begins and before being visited are not visited. `some` acts like the "exists" quantifier in mathematics. In particular, for an empty array, it returns *false*.

        +

        _callback_ should be a function that accepts three arguments and returns a value that is coercible to a Boolean value. `some` calls _callback_ once for each element present in the array, in ascending order, until it finds one where _callback_ returns *true*. If such an element is found, `some` immediately returns *true*. Otherwise, `some` returns *false*. _callback_ is called only for elements of the array which actually exist; it is not called for missing elements of the array.

        +

        If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callback_. If it is not provided, *undefined* is used instead.

        +

        _callback_ is called with three arguments: the value of the element, the index of the element, and the object being traversed.

        +

        `some` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callback_.

        +

        The range of elements processed by `some` is set before the first call to _callback_. Elements that are appended to the array after the call to `some` begins will not be visited by _callback_. If existing elements of the array are changed, their value as passed to _callback_ will be the value at the time that `some` visits them; elements that are deleted after the call to `some` begins and before being visited are not visited. `some` acts like the "exists" quantifier in mathematics. In particular, for an empty array, it returns *false*.

        This method performs the following steps when called:

        1. Let _O_ be ? ToObject(*this* value). 1. Let _len_ be ? LengthOfArrayLike(_O_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _k_ be 0. 1. Repeat, while _k_ < _len_, 1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kPresent_ be ? HasProperty(_O_, _Pk_). 1. If _kPresent_ is *true*, then 1. Let _kValue_ be ? Get(_O_, _Pk_). - 1. Let _testResult_ be ToBoolean(? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). + 1. Let _testResult_ be ToBoolean(? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). 1. If _testResult_ is *true*, return *true*. 1. Set _k_ to _k_ + 1. 1. Return *false*. @@ -39683,15 +39679,15 @@

        Array.prototype.some ( _callbackfn_ [ , _thisArg_ ] )

        -

        Array.prototype.sort ( _comparefn_ )

        -

        This method sorts the elements of this array. The sort must be stable (that is, elements that compare equal must remain in their original order). If _comparefn_ is not *undefined*, it should be a function that accepts two arguments _x_ and _y_ and returns a negative Number if _x_ < _y_, a positive Number if _x_ > _y_, or a zero otherwise.

        +

        Array.prototype.sort ( _comparator_ )

        +

        This method sorts the elements of this array. The sort must be stable (that is, elements that compare equal must remain in their original order). If _comparator_ is not *undefined*, it should be a function that accepts two arguments _x_ and _y_ and returns a negative Number if _x_ < _y_, a positive Number if _x_ > _y_, or a zero otherwise.

        It performs the following steps when called:

        - 1. [id="step-array-sort-comparefn"] If _comparefn_ is not *undefined* and IsCallable(_comparefn_) is *false*, throw a *TypeError* exception. + 1. [id="step-array-sort-comparefn"] If _comparator_ is not *undefined* and IsCallable(_comparator_) is *false*, throw a *TypeError* exception. 1. Let _obj_ be ? ToObject(*this* value). 1. [id="step-array-sort-len"] Let _len_ be ? LengthOfArrayLike(_obj_). - 1. Let _SortCompare_ be a new Abstract Closure with parameters (_x_, _y_) that captures _comparefn_ and performs the following steps when called: - 1. Return ? CompareArrayElements(_x_, _y_, _comparefn_). + 1. Let _SortCompare_ be a new Abstract Closure with parameters (_x_, _y_) that captures _comparator_ and performs the following steps when called: + 1. Return ? CompareArrayElements(_x_, _y_, _comparator_). 1. [id="step-array-sortindexedproperties"] Let _sortedList_ be ? SortIndexedProperties(_obj_, _len_, _SortCompare_, ~skip-holes~). 1. Let _itemCount_ be the number of elements in _sortedList_. 1. Let _j_ be 0. @@ -39742,7 +39738,7 @@

        1. [id="step-array-sort"] Sort _items_ using an implementation-defined sequence of calls to _SortCompare_. If any such call returns an abrupt completion, stop before performing any further calls to _SortCompare_ and return that Completion Record. 1. Return _items_. -

        The sort order is the ordering of _items_ after completion of step of the algorithm above. The sort order is implementation-defined if _SortCompare_ is not a consistent comparator for the elements of _items_. When SortIndexedProperties is invoked by Array.prototype.sort, the sort order is also implementation-defined if _comparefn_ is *undefined*, and all applications of ToString, to any specific value passed as an argument to _SortCompare_, do not produce the same result.

        +

        The sort order is the ordering of _items_ after completion of step of the algorithm above. The sort order is implementation-defined if _SortCompare_ is not a consistent comparator for the elements of _items_. When SortIndexedProperties is invoked by Array.prototype.sort, the sort order is also implementation-defined if _comparator_ is *undefined*, and all applications of ToString, to any specific value passed as an argument to _SortCompare_, do not produce the same result.

        Unless the sort order is specified to be implementation-defined, it must satisfy all of the following conditions:

        • @@ -39787,7 +39783,7 @@

          CompareArrayElements ( _x_: an ECMAScript language value, _y_: an ECMAScript language value, - _comparefn_: a function object or *undefined*, + _comparator_: a function object or *undefined*, ): either a normal completion containing a Number or an abrupt completion

          @@ -39796,8 +39792,8 @@

          1. If _x_ and _y_ are both *undefined*, return *+0*𝔽. 1. If _x_ is *undefined*, return *1*𝔽. 1. If _y_ is *undefined*, return *-1*𝔽. - 1. If _comparefn_ is not *undefined*, then - 1. Let _v_ be ? ToNumber(? Call(_comparefn_, *undefined*, « _x_, _y_ »)). + 1. If _comparator_ is not *undefined*, then + 1. Let _v_ be ? ToNumber(? Call(_comparator_, *undefined*, « _x_, _y_ »)). 1. If _v_ is *NaN*, return *+0*𝔽. 1. Return _v_. 1. [id="step-sortcompare-tostring-x"] Let _xString_ be ? ToString(_x_). @@ -39933,15 +39929,15 @@

          Array.prototype.toReversed ( )

          -

          Array.prototype.toSorted ( _comparefn_ )

          +

          Array.prototype.toSorted ( _comparator_ )

          This method performs the following steps when called:

          - 1. If _comparefn_ is not *undefined* and IsCallable(_comparefn_) is *false*, throw a *TypeError* exception. + 1. If _comparator_ is not *undefined* and IsCallable(_comparator_) is *false*, throw a *TypeError* exception. 1. Let _O_ be ? ToObject(*this* value). 1. Let _len_ be ? LengthOfArrayLike(_O_). 1. Let _A_ be ? ArrayCreate(_len_). - 1. Let _SortCompare_ be a new Abstract Closure with parameters (_x_, _y_) that captures _comparefn_ and performs the following steps when called: - 1. Return ? CompareArrayElements(_x_, _y_, _comparefn_). + 1. Let _SortCompare_ be a new Abstract Closure with parameters (_x_, _y_) that captures _comparator_ and performs the following steps when called: + 1. Return ? CompareArrayElements(_x_, _y_, _comparator_). 1. Let _sortedList_ be ? SortIndexedProperties(_O_, _len_, _SortCompare_, ~read-through-holes~). 1. Let _j_ be 0. 1. Repeat, while _j_ < _len_, @@ -40162,7 +40158,7 @@

          1. Else, 1. Assert: _kind_ is ~key+value~. 1. Let _result_ be CreateArrayFromList(« _indexNumber_, _elementValue_ »). - 1. Perform ? GeneratorYield(CreateIterResultObject(_result_, *false*)). + 1. Perform ? GeneratorYield(CreateIteratorResultObject(_result_, *false*)). 1. Set _index_ to _index_ + 1. 1. Return CreateIteratorFromClosure(_closure_, *"%ArrayIteratorPrototype%"*, %ArrayIteratorPrototype%). @@ -40449,15 +40445,15 @@

          Properties of the %TypedArray% Intrinsic Object

        -

        %TypedArray%.from ( _source_ [ , _mapfn_ [ , _thisArg_ ] ] )

        +

        %TypedArray%.from ( _source_ [ , _mapper_ [ , _thisArg_ ] ] )

        This method performs the following steps when called:

        1. Let _C_ be the *this* value. 1. If IsConstructor(_C_) is *false*, throw a *TypeError* exception. - 1. If _mapfn_ is *undefined*, then + 1. If _mapper_ is *undefined*, then 1. Let _mapping_ be *false*. 1. Else, - 1. If IsCallable(_mapfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_mapper_) is *false*, throw a *TypeError* exception. 1. Let _mapping_ be *true*. 1. Let _usingIterator_ be ? GetMethod(_source_, %Symbol.iterator%). 1. If _usingIterator_ is not *undefined*, then @@ -40470,7 +40466,7 @@

        %TypedArray%.from ( _source_ [ , _mapfn_ [ , _thisArg_ ] ] )

        1. Let _kValue_ be the first element of _values_. 1. Remove the first element from _values_. 1. If _mapping_ is *true*, then - 1. Let _mappedValue_ be ? Call(_mapfn_, _thisArg_, « _kValue_, 𝔽(_k_) »). + 1. Let _mappedValue_ be ? Call(_mapper_, _thisArg_, « _kValue_, 𝔽(_k_) »). 1. Else, 1. Let _mappedValue_ be _kValue_. 1. Perform ? Set(_targetObj_, _Pk_, _mappedValue_, *true*). @@ -40486,7 +40482,7 @@

        %TypedArray%.from ( _source_ [ , _mapfn_ [ , _thisArg_ ] ] )

        1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kValue_ be ? Get(_arrayLike_, _Pk_). 1. If _mapping_ is *true*, then - 1. Let _mappedValue_ be ? Call(_mapfn_, _thisArg_, « _kValue_, 𝔽(_k_) »). + 1. Let _mappedValue_ be ? Call(_mapper_, _thisArg_, « _kValue_, 𝔽(_k_) »). 1. Else, 1. Let _mappedValue_ be _kValue_. 1. Perform ? Set(_targetObj_, _Pk_, _mappedValue_, *true*). @@ -40665,19 +40661,19 @@

        %TypedArray%.prototype.entries ( )

        -

        %TypedArray%.prototype.every ( _callbackfn_ [ , _thisArg_ ] )

        +

        %TypedArray%.prototype.every ( _callback_ [ , _thisArg_ ] )

        The interpretation and use of the arguments of this method are the same as for `Array.prototype.every` as defined in .

        This method performs the following steps when called:

        1. Let _O_ be the *this* value. 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _k_ be 0. 1. Repeat, while _k_ < _len_, 1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kValue_ be ! Get(_O_, _Pk_). - 1. Let _testResult_ be ToBoolean(? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). + 1. Let _testResult_ be ToBoolean(? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). 1. If _testResult_ is *false*, return *false*. 1. Set _k_ to _k_ + 1. 1. Return *true*. @@ -40717,21 +40713,21 @@

        %TypedArray%.prototype.fill ( _value_ [ , _start_ [ , _end_ ] ] )

        -

        %TypedArray%.prototype.filter ( _callbackfn_ [ , _thisArg_ ] )

        +

        %TypedArray%.prototype.filter ( _callback_ [ , _thisArg_ ] )

        The interpretation and use of the arguments of this method are the same as for `Array.prototype.filter` as defined in .

        This method performs the following steps when called:

        1. Let _O_ be the *this* value. 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _kept_ be a new empty List. 1. Let _captured_ be 0. 1. Let _k_ be 0. 1. Repeat, while _k_ < _len_, 1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kValue_ be ! Get(_O_, _Pk_). - 1. Let _selected_ be ToBoolean(? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). + 1. Let _selected_ be ToBoolean(? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). 1. If _selected_ is *true*, then 1. Append _kValue_ to _kept_. 1. Set _captured_ to _captured_ + 1. @@ -40803,19 +40799,19 @@

        %TypedArray%.prototype.findLastIndex ( _predicate_ [ , _thisArg_ ] )

        -

        %TypedArray%.prototype.forEach ( _callbackfn_ [ , _thisArg_ ] )

        +

        %TypedArray%.prototype.forEach ( _callback_ [ , _thisArg_ ] )

        The interpretation and use of the arguments of this method are the same as for `Array.prototype.forEach` as defined in .

        This method performs the following steps when called:

        1. Let _O_ be the *this* value. 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _k_ be 0. 1. Repeat, while _k_ < _len_, 1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kValue_ be ! Get(_O_, _Pk_). - 1. Perform ? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »). + 1. Perform ? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »). 1. Set _k_ to _k_ + 1. 1. Return *undefined*. @@ -40954,20 +40950,20 @@

        get %TypedArray%.prototype.length

        -

        %TypedArray%.prototype.map ( _callbackfn_ [ , _thisArg_ ] )

        +

        %TypedArray%.prototype.map ( _callback_ [ , _thisArg_ ] )

        The interpretation and use of the arguments of this method are the same as for `Array.prototype.map` as defined in .

        This method performs the following steps when called:

        1. Let _O_ be the *this* value. 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _A_ be ? TypedArraySpeciesCreate(_O_, « 𝔽(_len_) »). 1. Let _k_ be 0. 1. Repeat, while _k_ < _len_, 1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kValue_ be ! Get(_O_, _Pk_). - 1. Let _mappedValue_ be ? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »). + 1. Let _mappedValue_ be ? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »). 1. Perform ? Set(_A_, _Pk_, _mappedValue_, *true*). 1. Set _k_ to _k_ + 1. 1. Return _A_. @@ -40976,14 +40972,14 @@

        %TypedArray%.prototype.map ( _callbackfn_ [ , _thisArg_ ] )

        -

        %TypedArray%.prototype.reduce ( _callbackfn_ [ , _initialValue_ ] )

        +

        %TypedArray%.prototype.reduce ( _callback_ [ , _initialValue_ ] )

        The interpretation and use of the arguments of this method are the same as for `Array.prototype.reduce` as defined in .

        This method performs the following steps when called:

        1. Let _O_ be the *this* value. 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. If _len_ = 0 and _initialValue_ is not present, throw a *TypeError* exception. 1. Let _k_ be 0. 1. Let _accumulator_ be *undefined*. @@ -40996,7 +40992,7 @@

        %TypedArray%.prototype.reduce ( _callbackfn_ [ , _initialValue_ ] )

        1. Repeat, while _k_ < _len_, 1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kValue_ be ! Get(_O_, _Pk_). - 1. Set _accumulator_ to ? Call(_callbackfn_, *undefined*, « _accumulator_, _kValue_, 𝔽(_k_), _O_ »). + 1. Set _accumulator_ to ? Call(_callback_, *undefined*, « _accumulator_, _kValue_, 𝔽(_k_), _O_ »). 1. Set _k_ to _k_ + 1. 1. Return _accumulator_.
        @@ -41004,14 +41000,14 @@

        %TypedArray%.prototype.reduce ( _callbackfn_ [ , _initialValue_ ] )

        -

        %TypedArray%.prototype.reduceRight ( _callbackfn_ [ , _initialValue_ ] )

        +

        %TypedArray%.prototype.reduceRight ( _callback_ [ , _initialValue_ ] )

        The interpretation and use of the arguments of this method are the same as for `Array.prototype.reduceRight` as defined in .

        This method performs the following steps when called:

        1. Let _O_ be the *this* value. 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. If _len_ = 0 and _initialValue_ is not present, throw a *TypeError* exception. 1. Let _k_ be _len_ - 1. 1. Let _accumulator_ be *undefined*. @@ -41024,7 +41020,7 @@

        %TypedArray%.prototype.reduceRight ( _callbackfn_ [ , _initialValue_ ] )

        @@ -41215,19 +41211,19 @@

        %TypedArray%.prototype.slice ( _start_, _end_ )

        -

        %TypedArray%.prototype.some ( _callbackfn_ [ , _thisArg_ ] )

        +

        %TypedArray%.prototype.some ( _callback_ [ , _thisArg_ ] )

        The interpretation and use of the arguments of this method are the same as for `Array.prototype.some` as defined in .

        This method performs the following steps when called:

        1. Let _O_ be the *this* value. 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). 1. Let _len_ be TypedArrayLength(_taRecord_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _k_ be 0. 1. Repeat, while _k_ < _len_, 1. Let _Pk_ be ! ToString(𝔽(_k_)). 1. Let _kValue_ be ! Get(_O_, _Pk_). - 1. Let _testResult_ be ToBoolean(? Call(_callbackfn_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). + 1. Let _testResult_ be ToBoolean(? Call(_callback_, _thisArg_, « _kValue_, 𝔽(_k_), _O_ »)). 1. If _testResult_ is *true*, return *true*. 1. Set _k_ to _k_ + 1. 1. Return *false*. @@ -41236,18 +41232,18 @@

        %TypedArray%.prototype.some ( _callbackfn_ [ , _thisArg_ ] )

        -

        %TypedArray%.prototype.sort ( _comparefn_ )

        +

        %TypedArray%.prototype.sort ( _comparator_ )

        This is a distinct method that, except as described below, implements the same requirements as those of `Array.prototype.sort` as defined in . The implementation of this method may be optimized with the knowledge that the *this* value is an object that has a fixed length and whose integer-indexed properties are not sparse.

        This method is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.

        It performs the following steps when called:

        - 1. If _comparefn_ is not *undefined* and IsCallable(_comparefn_) is *false*, throw a *TypeError* exception. + 1. If _comparator_ is not *undefined* and IsCallable(_comparator_) is *false*, throw a *TypeError* exception. 1. Let _obj_ be the *this* value. 1. Let _taRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~). 1. Let _len_ be TypedArrayLength(_taRecord_). 1. NOTE: The following closure performs a numeric comparison rather than the string comparison used in . - 1. Let _SortCompare_ be a new Abstract Closure with parameters (_x_, _y_) that captures _comparefn_ and performs the following steps when called: - 1. Return ? CompareTypedArrayElements(_x_, _y_, _comparefn_). + 1. Let _SortCompare_ be a new Abstract Closure with parameters (_x_, _y_) that captures _comparator_ and performs the following steps when called: + 1. Return ? CompareTypedArrayElements(_x_, _y_, _comparator_). 1. Let _sortedList_ be ? SortIndexedProperties(_obj_, _len_, _SortCompare_, ~read-through-holes~). 1. Let _j_ be 0. 1. Repeat, while _j_ < _len_, @@ -41256,7 +41252,7 @@

        %TypedArray%.prototype.sort ( _comparefn_ )

        1. Return _obj_.
        -

        Because *NaN* always compares greater than any other value (see CompareTypedArrayElements), *NaN* property values always sort to the end of the result when _comparefn_ is not provided.

        +

        Because *NaN* always compares greater than any other value (see CompareTypedArrayElements), *NaN* property values always sort to the end of the result when _comparator_ is not provided.

        @@ -41324,17 +41320,17 @@

        %TypedArray%.prototype.toReversed ( )

        -

        %TypedArray%.prototype.toSorted ( _comparefn_ )

        +

        %TypedArray%.prototype.toSorted ( _comparator_ )

        This method performs the following steps when called:

        - 1. If _comparefn_ is not *undefined* and IsCallable(_comparefn_) is *false*, throw a *TypeError* exception. + 1. If _comparator_ is not *undefined* and IsCallable(_comparator_) is *false*, throw a *TypeError* exception. 1. Let _O_ be the *this* value. 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~). 1. Let _len_ be TypedArrayLength(_taRecord_). 1. Let _A_ be ? TypedArrayCreateSameType(_O_, « 𝔽(_len_) »). 1. NOTE: The following closure performs a numeric comparison rather than the string comparison used in . - 1. Let _SortCompare_ be a new Abstract Closure with parameters (_x_, _y_) that captures _comparefn_ and performs the following steps when called: - 1. Return ? CompareTypedArrayElements(_x_, _y_, _comparefn_). + 1. Let _SortCompare_ be a new Abstract Closure with parameters (_x_, _y_) that captures _comparator_ and performs the following steps when called: + 1. Return ? CompareTypedArrayElements(_x_, _y_, _comparator_). 1. Let _sortedList_ be ? SortIndexedProperties(_O_, _len_, _SortCompare_, ~read-through-holes~). 1. Let _j_ be 0. 1. Repeat, while _j_ < _len_, @@ -41520,15 +41516,15 @@

        CompareTypedArrayElements ( _x_: a Number or a BigInt, _y_: a Number or a BigInt, - _comparefn_: a function object or *undefined*, + _comparator_: a function object or *undefined*, ): either a normal completion containing a Number or an abrupt completion

        1. Assert: _x_ is a Number and _y_ is a Number, or _x_ is a BigInt and _y_ is a BigInt. - 1. If _comparefn_ is not *undefined*, then - 1. Let _v_ be ? ToNumber(? Call(_comparefn_, *undefined*, « _x_, _y_ »)). + 1. If _comparator_ is not *undefined*, then + 1. Let _v_ be ? ToNumber(? Call(_comparator_, *undefined*, « _x_, _y_ »)). 1. If _v_ is *NaN*, return *+0*𝔽. 1. Return _v_. 1. If _x_ and _y_ are both *NaN*, return *+0*𝔽. @@ -41905,15 +41901,15 @@

        Properties of the Map Constructor

        -

        Map.groupBy ( _items_, _callbackfn_ )

        +

        Map.groupBy ( _items_, _callback_ )

        -

        _callbackfn_ should be a function that accepts two arguments. `groupBy` calls _callbackfn_ once for each element in _items_, in ascending order, and constructs a new Map. Each value returned by _callbackfn_ is used as a key in the Map. For each such key, the result Map has an entry whose key is that key and whose value is an array containing all the elements for which _callbackfn_ returned that key.

        -

        _callbackfn_ is called with two arguments: the value of the element and the index of the element.

        +

        _callback_ should be a function that accepts two arguments. `groupBy` calls _callback_ once for each element in _items_, in ascending order, and constructs a new Map. Each value returned by _callback_ is used as a key in the Map. For each such key, the result Map has an entry whose key is that key and whose value is an array containing all the elements for which _callback_ returned that key.

        +

        _callback_ is called with two arguments: the value of the element and the index of the element.

        The return value of `groupBy` is a Map.

        This function performs the following steps when called:

        - 1. Let _groups_ be ? GroupBy(_items_, _callbackfn_, ~collection~). + 1. Let _groups_ be ? GroupBy(_items_, _callback_, ~collection~). 1. Let _map_ be ! Construct(%Map%). 1. For each Record { [[Key]], [[Elements]] } _g_ of _groups_, do 1. Let _elements_ be CreateArrayFromList(_g_.[[Elements]]). @@ -42002,12 +41998,12 @@

        Map.prototype.entries ( )

        -

        Map.prototype.forEach ( _callbackfn_ [ , _thisArg_ ] )

        +

        Map.prototype.forEach ( _callback_ [ , _thisArg_ ] )

        This method performs the following steps when called:

        1. Let _M_ be the *this* value. 1. Perform ? RequireInternalSlot(_M_, [[MapData]]). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _entries_ be _M_.[[MapData]]. 1. Let _numEntries_ be the number of elements in _entries_. 1. Let _index_ be 0. @@ -42015,16 +42011,16 @@

        Map.prototype.forEach ( _callbackfn_ [ , _thisArg_ ] )

        1. Let _e_ be _entries_[_index_]. 1. Set _index_ to _index_ + 1. 1. If _e_.[[Key]] is not ~empty~, then - 1. Perform ? Call(_callbackfn_, _thisArg_, « _e_.[[Value]], _e_.[[Key]], _M_ »). - 1. NOTE: The number of elements in _entries_ may have increased during execution of _callbackfn_. + 1. Perform ? Call(_callback_, _thisArg_, « _e_.[[Value]], _e_.[[Key]], _M_ »). + 1. NOTE: The number of elements in _entries_ may have increased during execution of _callback_. 1. Set _numEntries_ to the number of elements in _entries_. 1. Return *undefined*.
        -

        _callbackfn_ should be a function that accepts three arguments. `forEach` calls _callbackfn_ once for each key/value pair present in the Map, in key insertion order. _callbackfn_ is called only for keys of the Map which actually exist; it is not called for keys that have been deleted from the Map.

        -

        If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callbackfn_. If it is not provided, *undefined* is used instead.

        -

        _callbackfn_ is called with three arguments: the value of the item, the key of the item, and the Map being traversed.

        -

        `forEach` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callbackfn_. Each entry of a map's [[MapData]] is only visited once. New keys added after the call to `forEach` begins are visited. A key will be revisited if it is deleted after it has been visited and then re-added before the `forEach` call completes. Keys that are deleted after the call to `forEach` begins and before being visited are not visited unless the key is added again before the `forEach` call completes.

        +

        _callback_ should be a function that accepts three arguments. `forEach` calls _callback_ once for each key/value pair present in the Map, in key insertion order. _callback_ is called only for keys of the Map which actually exist; it is not called for keys that have been deleted from the Map.

        +

        If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callback_. If it is not provided, *undefined* is used instead.

        +

        _callback_ is called with three arguments: the value of the item, the key of the item, and the Map being traversed.

        +

        `forEach` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callback_. Each entry of a map's [[MapData]] is only visited once. New keys added after the call to `forEach` begins are visited. A key will be revisited if it is deleted after it has been visited and then re-added before the `forEach` call completes. Keys that are deleted after the call to `forEach` begins and before being visited are not visited unless the key is added again before the `forEach` call completes.

        @@ -42151,7 +42147,7 @@

        1. Else, 1. Assert: _kind_ is ~key+value~. 1. Let _result_ be CreateArrayFromList(« _e_.[[Key]], _e_.[[Value]] »). - 1. Perform ? GeneratorYield(CreateIterResultObject(_result_, *false*)). + 1. Perform ? GeneratorYield(CreateIteratorResultObject(_result_, *false*)). 1. NOTE: The number of elements in _entries_ may have increased while execution of this abstract operation was paused by Yield. 1. Set _numEntries_ to the number of elements in _entries_. 1. Return *undefined*. @@ -42504,12 +42500,12 @@

        Set.prototype.entries ( )

        -

        Set.prototype.forEach ( _callbackfn_ [ , _thisArg_ ] )

        +

        Set.prototype.forEach ( _callback_ [ , _thisArg_ ] )

        This method performs the following steps when called:

        1. Let _S_ be the *this* value. 1. Perform ? RequireInternalSlot(_S_, [[SetData]]). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) is *false*, throw a *TypeError* exception. 1. Let _entries_ be _S_.[[SetData]]. 1. Let _numEntries_ be the number of elements in _entries_. 1. Let _index_ be 0. @@ -42517,17 +42513,17 @@

        Set.prototype.forEach ( _callbackfn_ [ , _thisArg_ ] )

        1. Let _e_ be _entries_[_index_]. 1. Set _index_ to _index_ + 1. 1. If _e_ is not ~empty~, then - 1. Perform ? Call(_callbackfn_, _thisArg_, « _e_, _e_, _S_ »). - 1. NOTE: The number of elements in _entries_ may have increased during execution of _callbackfn_. + 1. Perform ? Call(_callback_, _thisArg_, « _e_, _e_, _S_ »). + 1. NOTE: The number of elements in _entries_ may have increased during execution of _callback_. 1. Set _numEntries_ to the number of elements in _entries_. 1. Return *undefined*.
        -

        _callbackfn_ should be a function that accepts three arguments. `forEach` calls _callbackfn_ once for each value present in the Set object, in value insertion order. _callbackfn_ is called only for values of the Set which actually exist; it is not called for keys that have been deleted from the set.

        -

        If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callbackfn_. If it is not provided, *undefined* is used instead.

        -

        _callbackfn_ is called with three arguments: the first two arguments are a value contained in the Set. The same value is passed for both arguments. The Set object being traversed is passed as the third argument.

        -

        The _callbackfn_ is called with three arguments to be consistent with the call back functions used by `forEach` methods for Map and Array. For Sets, each item value is considered to be both the key and the value.

        -

        `forEach` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callbackfn_.

        +

        _callback_ should be a function that accepts three arguments. `forEach` calls _callback_ once for each value present in the Set object, in value insertion order. _callback_ is called only for values of the Set which actually exist; it is not called for keys that have been deleted from the set.

        +

        If a _thisArg_ parameter is provided, it will be used as the *this* value for each invocation of _callback_. If it is not provided, *undefined* is used instead.

        +

        _callback_ is called with three arguments: the first two arguments are a value contained in the Set. The same value is passed for both arguments. The Set object being traversed is passed as the third argument.

        +

        The _callback_ is called with three arguments to be consistent with the call back functions used by `forEach` methods for Map and Array. For Sets, each item value is considered to be both the key and the value.

        +

        `forEach` does not directly mutate the object on which it is called but the object may be mutated by the calls to _callback_.

        Each value is normally visited only once. However, a value will be revisited if it is deleted after it has been visited and then re-added before the `forEach` call completes. Values that are deleted after the call to `forEach` begins and before being visited are not visited unless the value is added again before the `forEach` call completes. New values added after the call to `forEach` begins are visited.

        @@ -42778,10 +42774,10 @@

        1. If _e_ is not ~empty~, then 1. If _kind_ is ~key+value~, then 1. Let _result_ be CreateArrayFromList(« _e_, _e_ »). - 1. Perform ? GeneratorYield(CreateIterResultObject(_result_, *false*)). + 1. Perform ? GeneratorYield(CreateIteratorResultObject(_result_, *false*)). 1. Else, 1. Assert: _kind_ is ~value~. - 1. Perform ? GeneratorYield(CreateIterResultObject(_e_, *false*)). + 1. Perform ? GeneratorYield(CreateIteratorResultObject(_e_, *false*)). 1. NOTE: The number of elements in _entries_ may have increased while execution of this abstract operation was paused by Yield. 1. Set _numEntries_ to the number of elements in _entries_. 1. Return *undefined*. @@ -43117,7 +43113,7 @@

        ArrayBuffer Objects

        Notation

        The descriptions below in this section, , and use the read-modify-write modification function internal data structure.

        -

        A read-modify-write modification function is a mathematical function that is notationally represented as an abstract closure that takes two Lists of byte values as arguments and returns a List of byte values. These abstract closures satisfy all of the following properties:

        +

        A read-modify-write modification function is a mathematical function that is represented as an abstract closure that takes two Lists of byte values as arguments and returns a List of byte values. These abstract closures satisfy all of the following properties:

        • They perform all their algorithm steps atomically.
        • Their individual algorithm steps are not observable.
        • @@ -43502,8 +43498,8 @@

          1. Let _rawBytes_ be a List whose elements are the 8 bytes that are the IEEE 754-2019 binary64 format encoding of _value_. The bytes are arranged in little endian order. If _value_ is *NaN*, _rawBytes_ may be set to any implementation chosen IEEE 754-2019 binary64 format Not-a-Number encoding. An implementation must always choose the same encoding for each implementation distinguishable *NaN* value. 1. Else, 1. Let _n_ be the Element Size value specified in for Element Type _type_. - 1. Let _convOp_ be the abstract operation named in the Conversion Operation column in for Element Type _type_. - 1. Let _intValue_ be ℝ(_convOp_(_value_)). + 1. Let _conversionOperation_ be the abstract operation named in the Conversion Operation column in for Element Type _type_. + 1. Let _intValue_ be ℝ(_conversionOperation_(_value_)). 1. If _intValue_ ≥ 0, then 1. Let _rawBytes_ be a List whose elements are the _n_-byte binary encoding of _intValue_. The bytes are ordered in little endian order. 1. Else, @@ -43814,7 +43810,7 @@

          Resizable ArrayBuffer Guidelines

          The following are guidelines for ECMAScript implementers implementing resizable ArrayBuffer.

          Resizable ArrayBuffer can be implemented as copying upon resize, as in-place growth via reserving virtual memory up front, or as a combination of both for different values of the constructor's *"maxByteLength"* option.

          If a host is multi-tenanted (i.e. it runs many ECMAScript applications simultaneously), such as a web browser, and its implementations choose to implement in-place growth by reserving virtual memory, we recommend that both 32-bit and 64-bit implementations throw for values of *"maxByteLength"* ≥ 1GiB to 1.5GiB. This is to reduce the likelihood a single application can exhaust the virtual memory address space and to reduce interoperability risk.

          -

          If a host does not have virtual memory, such as those running on embedded devices without an MMU, or if a host only implements resizing by copying, it may accept any Number value for the *"maxByteLength"* option. However, we recommend a *RangeError* be thrown if a memory block of the requested size can never be allocated. For example, if the requested size is greater than the maximium amount of usable memory on the device.

          +

          If a host does not have virtual memory, such as those running on embedded devices without an MMU, or if a host only implements resizing by copying, it may accept any Number value for the *"maxByteLength"* option. However, we recommend a *RangeError* be thrown if a memory block of the requested size can never be allocated. For example, if the requested size is greater than the maximum amount of usable memory on the device.

          @@ -45837,7 +45833,7 @@

          1. If _state_.[[Stack]] contains _value_, throw a *TypeError* exception because the structure is cyclical. 1. Append _value_ to _state_.[[Stack]]. - 1. Let _stepback_ be _state_.[[Indent]]. + 1. Let _stepBack_ be _state_.[[Indent]]. 1. Set _state_.[[Indent]] to the string-concatenation of _state_.[[Indent]] and _state_.[[Gap]]. 1. If _state_.[[PropertyList]] is not *undefined*, then 1. Let _K_ be _state_.[[PropertyList]]. @@ -45862,9 +45858,9 @@

          1. Else, 1. Let _separator_ be the string-concatenation of the code unit 0x002C (COMMA), the code unit 0x000A (LINE FEED), and _state_.[[Indent]]. 1. Let _properties_ be the String value formed by concatenating all the element Strings of _partial_ with each adjacent pair of Strings separated with _separator_. The _separator_ String is not inserted either before the first String or after the last String. - 1. Let _final_ be the string-concatenation of *"{"*, the code unit 0x000A (LINE FEED), _state_.[[Indent]], _properties_, the code unit 0x000A (LINE FEED), _stepback_, and *"}"*. + 1. Let _final_ be the string-concatenation of *"{"*, the code unit 0x000A (LINE FEED), _state_.[[Indent]], _properties_, the code unit 0x000A (LINE FEED), _stepBack_, and *"}"*. 1. Remove the last element of _state_.[[Stack]]. - 1. Set _state_.[[Indent]] to _stepback_. + 1. Set _state_.[[Indent]] to _stepBack_. 1. Return _final_. @@ -45883,7 +45879,7 @@

          1. If _state_.[[Stack]] contains _value_, throw a *TypeError* exception because the structure is cyclical. 1. Append _value_ to _state_.[[Stack]]. - 1. Let _stepback_ be _state_.[[Indent]]. + 1. Let _stepBack_ be _state_.[[Indent]]. 1. Set _state_.[[Indent]] to the string-concatenation of _state_.[[Indent]] and _state_.[[Gap]]. 1. Let _partial_ be a new empty List. 1. Let _len_ be ? LengthOfArrayLike(_value_). @@ -45904,9 +45900,9 @@

          1. Else, 1. Let _separator_ be the string-concatenation of the code unit 0x002C (COMMA), the code unit 0x000A (LINE FEED), and _state_.[[Indent]]. 1. Let _properties_ be the String value formed by concatenating all the element Strings of _partial_ with each adjacent pair of Strings separated with _separator_. The _separator_ String is not inserted either before the first String or after the last String. - 1. Let _final_ be the string-concatenation of *"["*, the code unit 0x000A (LINE FEED), _state_.[[Indent]], _properties_, the code unit 0x000A (LINE FEED), _stepback_, and *"]"*. + 1. Let _final_ be the string-concatenation of *"["*, the code unit 0x000A (LINE FEED), _state_.[[Indent]], _properties_, the code unit 0x000A (LINE FEED), _stepBack_, and *"]"*. 1. Remove the last element of _state_.[[Stack]]. - 1. Set _state_.[[Indent]] to _stepback_. + 1. Set _state_.[[Indent]] to _stepBack_. 1. Return _final_. @@ -46542,8 +46538,8 @@

          %AsyncFromSyncIteratorPrototype%.return ( [ _value_ ] )

          1. Let _return_ be Completion(GetMethod(_syncIterator_, *"return"*)). 1. IfAbruptRejectPromise(_return_, _promiseCapability_). 1. If _return_ is *undefined*, then - 1. Let _iterResult_ be CreateIterResultObject(_value_, *true*). - 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _iterResult_ »). + 1. Let _iteratorResult_ be CreateIteratorResultObject(_value_, *true*). + 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _iteratorResult_ »). 1. Return _promiseCapability_.[[Promise]]. 1. If _value_ is present, then 1. Let _result_ be Completion(Call(_return_, _syncIterator_, « _value_ »)). @@ -46636,7 +46632,7 @@

          1. Let _valueWrapper_ be Completion(PromiseResolve(%Promise%, _value_)). 1. IfAbruptRejectPromise(_valueWrapper_, _promiseCapability_). 1. Let _unwrap_ be a new Abstract Closure with parameters (_v_) that captures _done_ and performs the following steps when called: - 1. Return CreateIterResultObject(_v_, _done_). + 1. Return CreateIteratorResultObject(_v_, _done_). 1. Let _onFulfilled_ be CreateBuiltinFunction(_unwrap_, 1, *""*, « »). 1. NOTE: _onFulfilled_ is used when processing the *"value"* property of an IteratorResult object in order to wait for its value if it is a promise and re-package the result in a new "unwrapped" IteratorResult object. 1. Perform PerformPromiseThen(_valueWrapper_, _onFulfilled_, *undefined*, _promiseCapability_). @@ -48113,7 +48109,7 @@

          1. Else, 1. Assert: _result_ is a throw completion. 1. Return ? _result_. - 1. Return CreateIterResultObject(_resultValue_, *true*). + 1. Return CreateIteratorResultObject(_resultValue_, *true*). 1. Set the code evaluation state of _genContext_ such that when evaluation is resumed for that execution context, _closure_ will be called with no arguments. 1. Set _generator_.[[GeneratorContext]] to _genContext_. 1. Set _generator_.[[GeneratorState]] to ~suspended-start~. @@ -48153,7 +48149,7 @@

          1. Let _state_ be ? GeneratorValidate(_generator_, _generatorBrand_). - 1. If _state_ is ~completed~, return CreateIterResultObject(*undefined*, *true*). + 1. If _state_ is ~completed~, return CreateIteratorResultObject(*undefined*, *true*). 1. Assert: _state_ is either ~suspended-start~ or ~suspended-yield~. 1. Let _genContext_ be _generator_.[[GeneratorContext]]. 1. Let _methodContext_ be the running execution context. @@ -48184,7 +48180,7 @@

          1. Set _state_ to ~completed~. 1. If _state_ is ~completed~, then 1. If _abruptCompletion_ is a return completion, then - 1. Return CreateIterResultObject(_abruptCompletion_.[[Value]], *true*). + 1. Return CreateIteratorResultObject(_abruptCompletion_.[[Value]], *true*). 1. Return ? _abruptCompletion_. 1. Assert: _state_ is ~suspended-yield~. 1. Let _genContext_ be _generator_.[[GeneratorContext]]. @@ -48214,7 +48210,7 @@

          GetGeneratorKind ( ): ~non-generator~, ~sync~, or ~async~

          GeneratorYield ( - _iterNextObj_: an Object that conforms to the IteratorResult interface, + _iteratorResult_: an Object that conforms to the IteratorResult interface, ): either a normal completion containing an ECMAScript language value or an abrupt completion

          @@ -48227,7 +48223,7 @@

          1. Set _generator_.[[GeneratorState]] to ~suspended-yield~. 1. Remove _genContext_ from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context. 1. Let _callerContext_ be the running execution context. - 1. Resume _callerContext_ passing NormalCompletion(_iterNextObj_). If _genContext_ is ever resumed again, let _resumptionValue_ be the Completion Record with which it is resumed. + 1. Resume _callerContext_ passing NormalCompletion(_iteratorResult_). If _genContext_ is ever resumed again, let _resumptionValue_ be the Completion Record with which it is resumed. 1. Assert: If control reaches here, then _genContext_ is the running execution context again. 1. Return _resumptionValue_. @@ -48244,7 +48240,7 @@

          1. Let _generatorKind_ be GetGeneratorKind(). 1. If _generatorKind_ is ~async~, return ? AsyncGeneratorYield(? Await(_value_)). - 1. Otherwise, return ? GeneratorYield(CreateIterResultObject(_value_, *false*)). + 1. Otherwise, return ? GeneratorYield(CreateIteratorResultObject(_value_, *false*)). @@ -48311,7 +48307,7 @@

          %AsyncGeneratorPrototype%.next ( _value_ )

          1. IfAbruptRejectPromise(_result_, _promiseCapability_). 1. Let _state_ be _generator_.[[AsyncGeneratorState]]. 1. If _state_ is ~completed~, then - 1. Let _iteratorResult_ be CreateIterResultObject(*undefined*, *true*). + 1. Let _iteratorResult_ be CreateIteratorResultObject(*undefined*, *true*). 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _iteratorResult_ »). 1. Return _promiseCapability_.[[Promise]]. 1. Let _completion_ be NormalCompletion(_value_). @@ -48538,10 +48534,10 @@

          1. If _realm_ is present, then 1. Let _oldRealm_ be the running execution context's Realm. 1. Set the running execution context's Realm to _realm_. - 1. Let _iteratorResult_ be CreateIterResultObject(_value_, _done_). + 1. Let _iteratorResult_ be CreateIteratorResultObject(_value_, _done_). 1. Set the running execution context's Realm to _oldRealm_. 1. Else, - 1. Let _iteratorResult_ be CreateIterResultObject(_value_, _done_). + 1. Let _iteratorResult_ be CreateIteratorResultObject(_value_, _done_). 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _iteratorResult_ »). 1. Return ~unused~. @@ -48804,7 +48800,7 @@

          AsyncFunction.prototype [ %Symbol.toStringTag% ]

          AsyncFunction Instances

          -

          Every AsyncFunction instance is an ECMAScript function object and has the internal slots listed in . The value of the [[IsClassConstructor]] internal slot for all such instances is *false*. AsyncFunction instances are not constructors and do not have a [[Construct]] internal method. AsyncFunction instances do not have a prototype property as they are not constructible.

          +

          Every AsyncFunction instance is an ECMAScript function object and has the internal slots listed in . The value of the [[IsClassConstructor]] internal slot for all such instances is *false*. AsyncFunction instances are not constructors and do not have a [[Construct]] internal method. AsyncFunction instances do not have a prototype property as they are not constructable.

          Each AsyncFunction instance has the following own properties:

          @@ -49915,7 +49911,7 @@

          Expressions

          When processing an instance of the production
          -
          +
          the interpretation of |CoverParenthesizedExpressionAndArrowParameterList| is refined using the following grammar:

          @@ -49946,7 +49942,7 @@

          Expressions

          When processing an instance of the production
          -
          +
          the interpretation of |CoverCallExpressionAndAsyncArrowHead| is refined using the following grammar:

          @@ -50072,7 +50068,7 @@

          Functions and Classes

          When processing an instance of the production
          -
          +
          the interpretation of |CoverParenthesizedExpressionAndArrowParameterList| is refined using the following grammar:

          @@ -50083,7 +50079,7 @@

          Functions and Classes

          When processing an instance of the production
          -
          +
          the interpretation of |CoverCallExpressionAndAsyncArrowHead| is refined using the following grammar:

          @@ -50790,11 +50786,11 @@

          String.prototype.fixed ( )

          -

          String.prototype.fontcolor ( _color_ )

          +

          String.prototype.fontcolor ( _colour_ )

          This method performs the following steps when called:

          1. Let _S_ be the *this* value. - 1. Return ? CreateHTML(_S_, *"font"*, *"color"*, _color_). + 1. Return ? CreateHTML(_S_, *"font"*, *"color"*, _colour_).
          @@ -51042,10 +51038,10 @@

          Changes to FunctionDeclarationInstantiation

          1. Perform ! _varEnv_.InitializeBinding(_F_, *undefined*). 1. Append _F_ to _instantiatedVarNames_. 1. When the |FunctionDeclaration| _f_ is evaluated, perform the following steps in place of the |FunctionDeclaration| Evaluation algorithm provided in : - 1. Let _fenv_ be the running execution context's VariableEnvironment. - 1. Let _benv_ be the running execution context's LexicalEnvironment. - 1. Let _fobj_ be ! _benv_.GetBindingValue(_F_, *false*). - 1. Perform ! _fenv_.SetMutableBinding(_F_, _fobj_, *false*). + 1. Let _fEnv_ be the running execution context's VariableEnvironment. + 1. Let _bEnv_ be the running execution context's LexicalEnvironment. + 1. Let _fObj_ be ! _bEnv_.GetBindingValue(_F_, *false*). + 1. Perform ! _fEnv_.SetMutableBinding(_F_, _fObj_, *false*). 1. Return ~unused~. @@ -51069,10 +51065,10 @@

          Changes to GlobalDeclarationInstantiation

          1. Perform ? _env_.CreateGlobalVarBinding(_F_, *false*). 1. Append _F_ to _declaredFunctionOrVarNames_. 1. When the |FunctionDeclaration| _f_ is evaluated, perform the following steps in place of the |FunctionDeclaration| Evaluation algorithm provided in : - 1. Let _genv_ be the running execution context's VariableEnvironment. - 1. Let _benv_ be the running execution context's LexicalEnvironment. - 1. Let _fobj_ be ! _benv_.GetBindingValue(_F_, *false*). - 1. Perform ? _genv_.SetMutableBinding(_F_, _fobj_, *false*). + 1. Let _gEnv_ be the running execution context's VariableEnvironment. + 1. Let _bEnv_ be the running execution context's LexicalEnvironment. + 1. Let _fObj_ be ! _bEnv_.GetBindingValue(_F_, *false*). + 1. Perform ? _gEnv_.SetMutableBinding(_F_, _fObj_, *false*). 1. Return ~unused~. @@ -51112,10 +51108,10 @@

          Changes to EvalDeclarationInstantiation

          1. Perform ! _varEnv_.InitializeBinding(_F_, *undefined*). 1. Append _F_ to _declaredFunctionOrVarNames_. 1. When the |FunctionDeclaration| _f_ is evaluated, perform the following steps in place of the |FunctionDeclaration| Evaluation algorithm provided in : - 1. Let _genv_ be the running execution context's VariableEnvironment. - 1. Let _benv_ be the running execution context's LexicalEnvironment. - 1. Let _fobj_ be ! _benv_.GetBindingValue(_F_, *false*). - 1. Perform ? _genv_.SetMutableBinding(_F_, _fobj_, *false*). + 1. Let _gEnv_ be the running execution context's VariableEnvironment. + 1. Let _bEnv_ be the running execution context's LexicalEnvironment. + 1. Let _fObj_ be ! _bEnv_.GetBindingValue(_F_, *false*). + 1. Perform ? _gEnv_.SetMutableBinding(_F_, _fObj_, *false*). 1. Return ~unused~. @@ -51440,7 +51436,7 @@

          Corrections and Clarifications in ECMAScript 2015 with Possible Compatibilit

          : Previous editions did not specify the value returned by `Date.prototype.toString` when the time value is *NaN*. ECMAScript 2015 specifies the result to be the String value *"Invalid Date"*.

          , : Any LineTerminator code points in the value of the *"source"* property of a RegExp instance must be expressed using an escape sequence. Edition 5.1 only required the escaping of `/`.

          , : In previous editions, the specifications for `String.prototype.match` and `String.prototype.replace` was incorrect for cases where the pattern argument was a RegExp value whose `global` flag is set. The previous specifications stated that for each attempt to match the pattern, if `lastIndex` did not change, it should be incremented by 1. The correct behaviour is that `lastIndex` should be incremented by 1 only if the pattern matched the empty String.

          -

          : Previous editions did not specify how a *NaN* value returned by a _comparefn_ was interpreted by `Array.prototype.sort`. ECMAScript 2015 specifies that such as value is treated as if *+0*𝔽 was returned from the _comparefn_. ECMAScript 2015 also specifies that ToNumber is applied to the result returned by a _comparefn_. In previous editions, the effect of a _comparefn_ result that is not a Number value was implementation-defined. In practice, implementations call ToNumber.

          +

          : Previous editions did not specify how a *NaN* value returned by a _comparator_ was interpreted by `Array.prototype.sort`. ECMAScript 2015 specifies that such as value is treated as if *+0*𝔽 was returned from the _comparator_. ECMAScript 2015 also specifies that ToNumber is applied to the result returned by a _comparator_. In previous editions, the effect of a _comparator_ result that is not a Number value was implementation-defined. In practice, implementations call ToNumber.

          From 32fe924d97f504194c96d71217e73da2bcdb2d91 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Fri, 9 Aug 2024 14:10:34 +1200 Subject: [PATCH 27/49] Editorial: rename IDs that were embedded in emu-grammar elements back (#3384) --- spec.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/spec.html b/spec.html index 403969eca0..458ef5985a 100644 --- a/spec.html +++ b/spec.html @@ -17851,7 +17851,7 @@

          Rules of Automatic Semicolon Insertion

          AsyncArrowFunction[In, Yield, Await] : `async` [no LineTerminator here] AsyncArrowBindingIdentifier[?Yield] [no LineTerminator here] `=>` AsyncConciseBody[?In] - CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] [no LineTerminator here] `=>` AsyncConciseBody[?In] #callCover + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] [no LineTerminator here] `=>` AsyncConciseBody[?In] #callcover AsyncArrowHead : `async` [no LineTerminator here] ArrowFormalParameters[~Yield, +Await] @@ -18209,7 +18209,7 @@

          Syntax

          AsyncGeneratorExpression RegularExpressionLiteral TemplateLiteral[?Yield, ?Await, ~Tagged] - CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] #parenCover + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] #parencover CoverParenthesizedExpressionAndArrowParameterList[Yield, Await] : `(` Expression[+In, ?Yield, ?Await] `)` @@ -18998,7 +18998,7 @@

          Syntax

          `new` NewExpression[?Yield, ?Await] CallExpression[Yield, Await] : - CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] #callCover + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] #callcover SuperCall[?Yield, ?Await] ImportCall[?Yield, ?Await] CallExpression[?Yield, ?Await] Arguments[?Yield, ?Await] @@ -23549,7 +23549,7 @@

          Syntax

          ArrowParameters[Yield, Await] : BindingIdentifier[?Yield, ?Await] - CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] #parenCover + CoverParenthesizedExpressionAndArrowParameterList[?Yield, ?Await] #parencover ConciseBody[In] : [lookahead != `{`] ExpressionBody[?In, ~Await] @@ -25254,7 +25254,7 @@

          Syntax

          AsyncArrowFunction[In, Yield, Await] : `async` [no LineTerminator here] AsyncArrowBindingIdentifier[?Yield] [no LineTerminator here] `=>` AsyncConciseBody[?In] - CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] [no LineTerminator here] `=>` AsyncConciseBody[?In] #callCover + CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await] [no LineTerminator here] `=>` AsyncConciseBody[?In] #callcover AsyncConciseBody[In] : [lookahead != `{`] ExpressionBody[?In, +Await] @@ -49911,7 +49911,7 @@

          Expressions

          When processing an instance of the production
          -
          +
          the interpretation of |CoverParenthesizedExpressionAndArrowParameterList| is refined using the following grammar:

          @@ -49942,7 +49942,7 @@

          Expressions

          When processing an instance of the production
          -
          +
          the interpretation of |CoverCallExpressionAndAsyncArrowHead| is refined using the following grammar:

          @@ -50068,7 +50068,7 @@

          Functions and Classes

          When processing an instance of the production
          -
          +
          the interpretation of |CoverParenthesizedExpressionAndArrowParameterList| is refined using the following grammar:

          @@ -50079,7 +50079,7 @@

          Functions and Classes

          When processing an instance of the production
          -
          +
          the interpretation of |CoverCallExpressionAndAsyncArrowHead| is refined using the following grammar:

          From 9df72d55abb582df31e9afa4be02b953c2813bde Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Wed, 12 Jun 2024 15:11:12 -0700 Subject: [PATCH 28/49] Editorial: mark various side-effecting Promise resolutions --- spec.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec.html b/spec.html index 458ef5985a..fc38d90d3d 100644 --- a/spec.html +++ b/spec.html @@ -19612,7 +19612,7 @@

          1. Let _evaluatePromise_ be _module_.Evaluate(). 1. Let _fulfilledClosure_ be a new Abstract Closure with no parameters that captures _module_ and _promiseCapability_ and performs the following steps when called: 1. Let _namespace_ be GetModuleNamespace(_module_). - 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _namespace_ »). + 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _namespace_ »). 1. Return ~unused~. 1. Let _onFulfilled_ be CreateBuiltinFunction(_fulfilledClosure_, 0, *""*, « »). 1. Perform PerformPromiseThen(_evaluatePromise_, _onFulfilled_, _onRejected_). @@ -46539,7 +46539,7 @@

          %AsyncFromSyncIteratorPrototype%.return ( [ _value_ ] )

          1. IfAbruptRejectPromise(_return_, _promiseCapability_). 1. If _return_ is *undefined*, then 1. Let _iteratorResult_ be CreateIteratorResultObject(_value_, *true*). - 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _iteratorResult_ »). + 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _iteratorResult_ »). 1. Return _promiseCapability_.[[Promise]]. 1. If _value_ is present, then 1. Let _result_ be Completion(Call(_return_, _syncIterator_, « _value_ »)). @@ -48308,7 +48308,7 @@

          %AsyncGeneratorPrototype%.next ( _value_ )

          1. Let _state_ be _generator_.[[AsyncGeneratorState]]. 1. If _state_ is ~completed~, then 1. Let _iteratorResult_ be CreateIteratorResultObject(*undefined*, *true*). - 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _iteratorResult_ »). + 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _iteratorResult_ »). 1. Return _promiseCapability_.[[Promise]]. 1. Let _completion_ be NormalCompletion(_value_). 1. Perform AsyncGeneratorEnqueue(_generator_, _completion_, _promiseCapability_). @@ -48538,7 +48538,7 @@

          1. Set the running execution context's Realm to _oldRealm_. 1. Else, 1. Let _iteratorResult_ be CreateIteratorResultObject(_value_, _done_). - 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _iteratorResult_ »). + 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _iteratorResult_ »). 1. Return ~unused~. @@ -48855,7 +48855,7 @@

          1. If _result_ is a normal completion, then 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « *undefined* »). 1. Else if _result_ is a return completion, then - 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _result_.[[Value]] »). + 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _result_.[[Value]] »). 1. Else, 1. Assert: _result_ is a throw completion. 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _result_.[[Value]] »). From bf2e2fee67f0236daa19a3c3182f09b4a96e582c Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Wed, 12 Jun 2024 15:11:55 -0700 Subject: [PATCH 29/49] Editorial: more precise type for EnqueueResolveInAgentJob --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index fc38d90d3d..244c7ceb22 100644 --- a/spec.html +++ b/spec.html @@ -44993,7 +44993,7 @@

          EnqueueResolveInAgentJob ( _agentSignifier_: an agent signifier, _promiseCapability_: a PromiseCapability Record, - _resolution_: an ECMAScript language value, + _resolution_: *"ok"* or *"timed-out"*, ): ~unused~

          From 4cb5a6980e20be76c648f113c4cc762342172df3 Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Wed, 12 Jun 2024 15:12:14 -0700 Subject: [PATCH 30/49] Normative: guard against reentrancy in AsyncGenerator.prototype.return --- spec.html | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/spec.html b/spec.html index 244c7ceb22..4c3a8852d7 100644 --- a/spec.html +++ b/spec.html @@ -48461,7 +48461,7 @@

          1. Let _result_ be Completion(_generatorBody_()). 1. Assert: If we return here, the async generator either threw an exception or performed either an implicit or explicit return. 1. Remove _acGenContext_ from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context. - 1. Set _acGenerator_.[[AsyncGeneratorState]] to ~completed~. + 1. Set _acGenerator_.[[AsyncGeneratorState]] to ~awaiting-return~. 1. If _result_ is a normal completion, set _result_ to NormalCompletion(*undefined*). 1. If _result_ is a return completion, set _result_ to NormalCompletion(_result_.[[Value]]). 1. Perform AsyncGeneratorCompleteStep(_acGenerator_, _result_, *true*). @@ -48626,6 +48626,7 @@

          + 1. Assert: _generator_.[[AsyncGeneratorState]] is ~awaiting-return~. 1. Let _queue_ be _generator_.[[AsyncGeneratorQueue]]. 1. Assert: _queue_ is not empty. 1. Let _next_ be the first element of _queue_. @@ -48633,21 +48634,20 @@

          1. Assert: _completion_ is a return completion. 1. Let _promiseCompletion_ be Completion(PromiseResolve(%Promise%, _completion_.[[Value]])). 1. If _promiseCompletion_ is an abrupt completion, then - 1. Set _generator_.[[AsyncGeneratorState]] to ~completed~. 1. Perform AsyncGeneratorCompleteStep(_generator_, _promiseCompletion_, *true*). 1. Perform AsyncGeneratorDrainQueue(_generator_). 1. Return ~unused~. 1. Assert: _promiseCompletion_ is a normal completion. 1. Let _promise_ be _promiseCompletion_.[[Value]]. 1. Let _fulfilledClosure_ be a new Abstract Closure with parameters (_value_) that captures _generator_ and performs the following steps when called: - 1. Set _generator_.[[AsyncGeneratorState]] to ~completed~. + 1. Assert: _generator_.[[AsyncGeneratorState]] is ~awaiting-return~. 1. Let _result_ be NormalCompletion(_value_). 1. Perform AsyncGeneratorCompleteStep(_generator_, _result_, *true*). 1. Perform AsyncGeneratorDrainQueue(_generator_). 1. Return *undefined*. 1. Let _onFulfilled_ be CreateBuiltinFunction(_fulfilledClosure_, 1, *""*, « »). 1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_reason_) that captures _generator_ and performs the following steps when called: - 1. Set _generator_.[[AsyncGeneratorState]] to ~completed~. + 1. Assert: _generator_.[[AsyncGeneratorState]] is ~awaiting-return~. 1. Let _result_ be ThrowCompletion(_reason_). 1. Perform AsyncGeneratorCompleteStep(_generator_, _result_, *true*). 1. Perform AsyncGeneratorDrainQueue(_generator_). @@ -48669,22 +48669,25 @@

          It drains the generator's AsyncGeneratorQueue until it encounters an AsyncGeneratorRequest which holds a return completion.

          - 1. Assert: _generator_.[[AsyncGeneratorState]] is ~completed~. + 1. Assert: _generator_.[[AsyncGeneratorState]] is ~awaiting-return~. 1. Let _queue_ be _generator_.[[AsyncGeneratorQueue]]. - 1. If _queue_ is empty, return ~unused~. + 1. If _queue_ is empty, then + 1. Set _generator_.[[AsyncGeneratorState]] to ~completed~. + 1. Return ~unused~. 1. Let _done_ be *false*. 1. Repeat, while _done_ is *false*, 1. Let _next_ be the first element of _queue_. 1. Let _completion_ be Completion(_next_.[[Completion]]). 1. If _completion_ is a return completion, then - 1. Set _generator_.[[AsyncGeneratorState]] to ~awaiting-return~. 1. Perform AsyncGeneratorAwaitReturn(_generator_). 1. Set _done_ to *true*. 1. Else, 1. If _completion_ is a normal completion, then 1. Set _completion_ to NormalCompletion(*undefined*). 1. Perform AsyncGeneratorCompleteStep(_generator_, _completion_, *true*). - 1. If _queue_ is empty, set _done_ to *true*. + 1. If _queue_ is empty, then + 1. Set _generator_.[[AsyncGeneratorState]] to ~completed~. + 1. Set _done_ to *true*. 1. Return ~unused~. From f439eccd5adaac04e5f29bb926aefd7899855b3e Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Fri, 9 Aug 2024 16:08:48 -0700 Subject: [PATCH 31/49] Editorial: rename ~awaiting-return~ state to ~draining-queue~ --- spec.html | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/spec.html b/spec.html index 4c3a8852d7..0c5c642734 100644 --- a/spec.html +++ b/spec.html @@ -48315,7 +48315,7 @@

          %AsyncGeneratorPrototype%.next ( _value_ )

          1. If _state_ is either ~suspended-start~ or ~suspended-yield~, then 1. Perform AsyncGeneratorResume(_generator_, _completion_). 1. Else, - 1. Assert: _state_ is either ~executing~ or ~awaiting-return~. + 1. Assert: _state_ is either ~executing~ or ~draining-queue~. 1. Return _promiseCapability_.[[Promise]]. @@ -48331,12 +48331,12 @@

          %AsyncGeneratorPrototype%.return ( _value_ )

          1. Perform AsyncGeneratorEnqueue(_generator_, _completion_, _promiseCapability_). 1. Let _state_ be _generator_.[[AsyncGeneratorState]]. 1. If _state_ is either ~suspended-start~ or ~completed~, then - 1. Set _generator_.[[AsyncGeneratorState]] to ~awaiting-return~. + 1. Set _generator_.[[AsyncGeneratorState]] to ~draining-queue~. 1. Perform AsyncGeneratorAwaitReturn(_generator_). 1. Else if _state_ is ~suspended-yield~, then 1. Perform AsyncGeneratorResume(_generator_, _completion_). 1. Else, - 1. Assert: _state_ is either ~executing~ or ~awaiting-return~. + 1. Assert: _state_ is either ~executing~ or ~draining-queue~. 1. Return _promiseCapability_.[[Promise]]. @@ -48360,7 +48360,7 @@

          %AsyncGeneratorPrototype%.throw ( _exception_ )

          1. If _state_ is ~suspended-yield~, then 1. Perform AsyncGeneratorResume(_generator_, _completion_). 1. Else, - 1. Assert: _state_ is either ~executing~ or ~awaiting-return~. + 1. Assert: _state_ is either ~executing~ or ~draining-queue~. 1. Return _promiseCapability_.[[Promise]]. @@ -48386,7 +48386,7 @@

          Properties of AsyncGenerator Instances

        [[AsyncGeneratorState]]*undefined*, ~suspended-start~, ~suspended-yield~, ~executing~, ~awaiting-return~, or ~completed~*undefined*, ~suspended-start~, ~suspended-yield~, ~executing~, ~draining-queue~, or ~completed~ The current execution state of the async generator.
        [[AsyncGeneratorQueue]] a List of AsyncGeneratorRequest RecordsRecords which represent requests to resume the async generator. Except during state transitions, it is non-empty if and only if [[AsyncGeneratorState]] is either ~executing~ or ~awaiting-return~.Records which represent requests to resume the async generator. Except during state transitions, it is non-empty if and only if [[AsyncGeneratorState]] is either ~executing~ or ~draining-queue~.
        [[GeneratorBrand]] - *undefined*, ~suspended-start~, ~suspended-yield~, ~executing~, or ~completed~ + ~suspended-start~, ~suspended-yield~, ~executing~, or ~completed~ The current execution state of the generator. @@ -48090,7 +48092,7 @@

        - 1. Assert: The value of _generator_.[[GeneratorState]] is *undefined*. + 1. Assert: The value of _generator_.[[GeneratorState]] is ~suspended-start~. 1. Let _genContext_ be the running execution context. 1. Set the Generator component of _genContext_ to _generator_. 1. Let _closure_ be a new Abstract Closure with no parameters that captures _generatorBody_ and performs the following steps when called: @@ -48115,7 +48117,6 @@

        1. Return CreateIteratorResultObject(_resultValue_, *true*). 1. Set the code evaluation state of _genContext_ such that when evaluation is resumed for that execution context, _closure_ will be called with no arguments. 1. Set _generator_.[[GeneratorContext]] to _genContext_. - 1. Set _generator_.[[GeneratorState]] to ~suspended-start~. 1. Return ~unused~. @@ -48389,7 +48390,7 @@

        Properties of AsyncGenerator Instances

        [[AsyncGeneratorState]]*undefined*, ~suspended-start~, ~suspended-yield~, ~executing~, ~draining-queue~, or ~completed~~suspended-start~, ~suspended-yield~, ~executing~, ~draining-queue~, or ~completed~ The current execution state of the async generator.
        - - - - - - - - - - - - - - - - - - - - - - - -
        _opText_ Type(_lNum_) _operation_
        `**` Number Number::exponentiate
        `*` Number Number::multiply
        `*` BigInt BigInt::multiply
        `/` Number Number::divide
        `%` Number Number::remainder
        `+` Number Number::add
        `+` BigInt BigInt::add
        `-` Number Number::subtract
        `-` BigInt BigInt::subtract
        `<<` Number Number::leftShift
        `<<` BigInt BigInt::leftShift
        `>>` Number Number::signedRightShift
        `>>` BigInt BigInt::signedRightShift
        `>>>` Number Number::unsignedRightShift
        `&` Number Number::bitwiseAND
        `&` BigInt BigInt::bitwiseAND
        `^` Number Number::bitwiseXOR
        `^` BigInt BigInt::bitwiseXOR
        `|` Number Number::bitwiseOR
        `|` BigInt BigInt::bitwiseOR
        - + 1. Let _operation_ be the abstract operation associated with _opText_ in the following table: +
        + + + + + + + + + + + + + + + +
        _opText_ _operation_
        `*` BigInt::multiply
        `+` BigInt::add
        `-` BigInt::subtract
        `<<` BigInt::leftShift
        `>>` BigInt::signedRightShift
        `&` BigInt::bitwiseAND
        `^` BigInt::bitwiseXOR
        `|` BigInt::bitwiseOR
        +
        + 1. Else, + 1. Assert: _lNum_ is a Number. + 1. Let _operation_ be the abstract operation associated with _opText_ in the following table: +
        + + + + + + + + + + + + + + + + + + + +
        _opText_ _operation_
        `**` Number::exponentiate
        `*` Number::multiply
        `/` Number::divide
        `%` Number::remainder
        `+` Number::add
        `-` Number::subtract
        `<<` Number::leftShift
        `>>` Number::signedRightShift
        `>>>` Number::unsignedRightShift
        `&` Number::bitwiseAND
        `^` Number::bitwiseXOR
        `|` Number::bitwiseOR
        +
        1. Return _operation_(_lNum_, _rNum_). From fcd19b5d91581360834467fbbb78b9b6792bfb41 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Fri, 6 Sep 2024 13:08:41 -0700 Subject: [PATCH 47/49] Editorial: remove `Type()` AO-like macro (#3420) --- spec.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spec.html b/spec.html index 7d72456fe8..6fd4400dc0 100644 --- a/spec.html +++ b/spec.html @@ -1118,10 +1118,9 @@

        Identity

        - +

        ECMAScript Data Types and Values

        Algorithms within this specification manipulate values each of which has an associated type. The possible value types are exactly those defined in this clause. Types are further classified into ECMAScript language types and specification types.

        -

        Within this specification, the notation “Type(_x_)” is used as shorthand for “the type of _x_” where “type” refers to the ECMAScript language and specification types defined in this clause.

        ECMAScript Language Types

        From 95b799728955189b9044ec448267a1c2ba9f380a Mon Sep 17 00:00:00 2001 From: Kevin Gibbons Date: Mon, 23 Sep 2024 12:15:38 -0700 Subject: [PATCH 48/49] Meta: bump ecmarkup to 19.1.0 (#3415) --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index c6580787fb..1998122c78 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "SEE LICENSE IN https://tc39.es/ecma262/#sec-copyright-and-software-license", "devDependencies": { - "ecmarkup": "^19.0.0", + "ecmarkup": "^19.1.0", "glob": "^7.1.6", "jsdom": "^15.0.0", "pagedjs": "^0.4.3", @@ -1243,9 +1243,9 @@ } }, "node_modules/ecmarkup": { - "version": "19.0.0", - "resolved": "https://registry.npmjs.org/ecmarkup/-/ecmarkup-19.0.0.tgz", - "integrity": "sha512-ncn5LXs46jPqcQSO/XdJCOOsdAvC8xT/Yebxted4qgpYWLisY4AEdOdZ4OXKgmPXGgWBqAgCSoV0obvEBEz8Hg==", + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/ecmarkup/-/ecmarkup-19.1.0.tgz", + "integrity": "sha512-+mh2vIcRCJtr8poJl64yulZkSSWpd7TQpORj+WVRmFe5omdS33eF94XjPa8QN0TiNz7gaCwJygKUF4COO142mA==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 013ffb2639..e0695f3569 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "license": "SEE LICENSE IN https://tc39.es/ecma262/#sec-copyright-and-software-license", "homepage": "https://tc39.es/ecma262/", "devDependencies": { - "ecmarkup": "^19.0.0", + "ecmarkup": "^19.1.0", "glob": "^7.1.6", "jsdom": "^15.0.0", "pagedjs": "^0.4.3", From 7df8f590e9f3c57a2783c5c26eeb631fe211f51b Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Mon, 23 Sep 2024 12:15:46 -0700 Subject: [PATCH 49/49] Editorial: add a ReturnCompletion AO, mirroring Normal/Throw (#3415) --- spec.html | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/spec.html b/spec.html index 6fd4400dc0..2780ca01a1 100644 --- a/spec.html +++ b/spec.html @@ -1028,7 +1028,7 @@

        ReturnIfAbrupt Shorthands

        Implicit Normal Completion

        In algorithms within abstract operations which are declared to return a Completion Record, and within all built-in functions, the returned value is first passed to NormalCompletion, and the result is used instead. This rule does not apply within the Completion algorithm or when the value being returned is clearly marked as a Completion Record in that step; these cases are:

          -
        • when the result of applying Completion, NormalCompletion, or ThrowCompletion is directly returned
        • +
        • when the result of applying Completion, NormalCompletion, ThrowCompletion, or ReturnCompletion is directly returned
        • when the result of constructing a Completion Record is directly returned

        It is an editorial error if a Completion Record is returned from such an abstract operation through any other means. For example, within these abstract operations,

        @@ -4180,6 +4180,19 @@

        + +

        + ReturnCompletion ( + _value_: an ECMAScript language value, + ): a return completion +

        +
        +
        + + 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _value_, [[Target]]: ~empty~ }. + +
        +

        UpdateEmpty ( @@ -13422,7 +13435,7 @@

        1. Else, 1. Let _rhs_ be ? Evaluation of |AssignmentExpression|. 1. Let _value_ be ? GetValue(_rhs_). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _value_, [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_value_).

        Even though field initializers constitute a function boundary, calling FunctionDeclarationInstantiation does not have any observable effect and so is omitted.

        @@ -22586,14 +22599,14 @@

        Syntax

        Runtime Semantics: Evaluation

        ReturnStatement : `return` `;` - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: *undefined*, [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(*undefined*). ReturnStatement : `return` Expression `;` 1. Let _exprRef_ be ? Evaluation of |Expression|. 1. Let _exprValue_ be ? GetValue(_exprRef_). 1. If GetGeneratorKind() is ~async~, set _exprValue_ to ? Await(_exprValue_). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _exprValue_, [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_exprValue_). @@ -23695,7 +23708,7 @@

        Runtime Semantics: Evaluation

        1. Let _exprRef_ be ? Evaluation of |AssignmentExpression|. 1. Let _exprValue_ be ? GetValue(_exprRef_). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _exprValue_, [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_exprValue_). @@ -24020,7 +24033,7 @@

        1. Set _G_.[[GeneratorBrand]] to ~empty~. 1. Set _G_.[[GeneratorState]] to ~suspended-start~. 1. Perform GeneratorStart(_G_, |FunctionBody|). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _G_, [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_G_). @@ -24160,14 +24173,14 @@

        Runtime Semantics: Evaluation

        1. Set _value_ to _received_.[[Value]]. 1. If _generatorKind_ is ~async~, then 1. Set _value_ to ? Await(_value_). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _value_, [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_value_). 1. Let _innerReturnResult_ be ? Call(_return_, _iterator_, « _received_.[[Value]] »). 1. If _generatorKind_ is ~async~, set _innerReturnResult_ to ? Await(_innerReturnResult_). 1. If _innerReturnResult_ is not an Object, throw a *TypeError* exception. 1. Let _done_ be ? IteratorComplete(_innerReturnResult_). 1. If _done_ is *true*, then 1. Set _value_ to ? IteratorValue(_innerReturnResult_). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _value_, [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_value_). 1. If _generatorKind_ is ~async~, set _received_ to Completion(AsyncGeneratorYield(? IteratorValue(_innerReturnResult_))). 1. Else, set _received_ to Completion(GeneratorYield(_innerReturnResult_)). @@ -24248,7 +24261,7 @@

        1. Set _generator_.[[GeneratorBrand]] to ~empty~. 1. Set _generator_.[[AsyncGeneratorState]] to ~suspended-start~. 1. Perform AsyncGeneratorStart(_generator_, |FunctionBody|). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _generator_, [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_generator_). @@ -25264,7 +25277,7 @@

        1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _completion_.[[Value]] »). 1. Else, 1. Perform AsyncFunctionStart(_promiseCapability_, |FunctionBody|). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _promiseCapability_.[[Promise]], [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_promiseCapability_.[[Promise]]). @@ -25371,7 +25384,7 @@

        1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _completion_.[[Value]] »). 1. Else, 1. Perform AsyncFunctionStart(_promiseCapability_, |ExpressionBody|). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _promiseCapability_.[[Promise]], [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_promiseCapability_.[[Promise]]). @@ -48042,7 +48055,7 @@

        %GeneratorPrototype%.return ( _value_ )

        This method performs the following steps when called:

        1. Let _g_ be the *this* value. - 1. Let _C_ be Completion Record { [[Type]]: ~return~, [[Value]]: _value_, [[Target]]: ~empty~ }. + 1. Let _C_ be ReturnCompletion(_value_). 1. Return ? GeneratorResumeAbrupt(_g_, _C_, ~empty~). @@ -48371,7 +48384,7 @@

        %AsyncGeneratorPrototype%.return ( _value_ )

        1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). 1. Let _result_ be Completion(AsyncGeneratorValidate(_generator_, ~empty~)). 1. IfAbruptRejectPromise(_result_, _promiseCapability_). - 1. Let _completion_ be Completion Record { [[Type]]: ~return~, [[Value]]: _value_, [[Target]]: ~empty~ }. + 1. Let _completion_ be ReturnCompletion(_value_). 1. Perform AsyncGeneratorEnqueue(_generator_, _completion_, _promiseCapability_). 1. Let _state_ be _generator_.[[AsyncGeneratorState]]. 1. If _state_ is either ~suspended-start~ or ~completed~, then @@ -48622,7 +48635,7 @@

        1. Let _awaited_ be Completion(Await(_resumptionValue_.[[Value]])). 1. If _awaited_ is a throw completion, return ? _awaited_. 1. Assert: _awaited_ is a normal completion. - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _awaited_.[[Value]], [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_awaited_.[[Value]]).