This Ecma Standard defines the ECMAScript 2024 Language. It is the fifteenth edition of the ECMAScript Language Specification. Since publication of the first edition in 1997, ECMAScript has grown to be one of the world's most widely used general-purpose programming languages. It is best known as the language embedded in web browsers but has also been widely adopted for server and embedded applications.
+
This Ecma Standard defines the ECMAScript 2025 Language. It is the sixteenth edition of the ECMAScript Language Specification. Since publication of the first edition in 1997, ECMAScript has grown to be one of the world's most widely used general-purpose programming languages. It is best known as the language embedded in web browsers but has also been widely adopted for server and embedded applications.
ECMAScript is based on several originating technologies, the most well-known being JavaScript (Netscape) and JScript (Microsoft). The language was invented by Brendan Eich at Netscape and first appeared in that company's Navigator 2.0 browser. It has appeared in all subsequent browsers from Netscape and in all browsers from Microsoft starting with Internet Explorer 3.0.
The development of the ECMAScript Language Specification started in November 1996. The first edition of this Ecma Standard was adopted by the Ecma General Assembly of June 1997.
That Ecma Standard was submitted to ISO/IEC JTC 1 for adoption under the fast-track procedure, and approved as international standard ISO/IEC 16262, in April 1998. The Ecma General Assembly of June 1998 approved the second edition of ECMA-262 to keep it fully aligned with ISO/IEC 16262. Changes between the first and the second edition are editorial in nature.
@@ -109,6 +85,7 @@
Introduction
ECMAScript 2021, the 12th edition, introduced the `replaceAll` method for Strings; `Promise.any`, a Promise combinator that short-circuits when an input value is fulfilled; `AggregateError`, a new Error type to represent multiple errors at once; logical assignment operators (`??=`, `&&=`, `||=`); `WeakRef`, for referring to a target object without preserving it from garbage collection, and `FinalizationRegistry`, to manage registration and unregistration of cleanup operations performed when target objects are garbage collected; separators for numeric literals (`1_000`); and `Array.prototype.sort` was made more precise, reducing the amount of cases that result in an implementation-defined sort order.
ECMAScript 2022, the 13th edition, introduced top-level `await`, allowing the keyword to be used at the top level of modules; new class elements: public and private instance fields, public and private static fields, private instance methods and accessors, and private static methods and accessors; static blocks inside classes, to perform per-class evaluation initialization; the `#x in obj` syntax, to test for presence of private fields on objects; regular expression match indices via the `/d` flag, which provides start and end indices for matched substrings; the `cause` property on `Error` objects, which can be used to record a causation chain in errors; the `at` method for Strings, Arrays, and TypedArrays, which allows relative indexing; and `Object.hasOwn`, a convenient alternative to `Object.prototype.hasOwnProperty`.
ECMAScript 2023, the 14th edition, introduced the `toSorted`, `toReversed`, `with`, `findLast`, and `findLastIndex` methods on `Array.prototype` and `TypedArray.prototype`, as well as the `toSpliced` method on `Array.prototype`; added support for `#!` comments at the beginning of files to better facilitate executable ECMAScript files; and allowed the use of most Symbols as keys in weak collections.
+
ECMAScript 2024, the 15th edition, added facilities for resizing and transferring ArrayBuffers and SharedArrayBuffers; added a new RegExp `/v` flag for creating RegExps with more advanced features for working with sets of strings; and introduced the `Promise.withResolvers` convenience method for constructing Promises, the `Object.groupBy` and `Map.groupBy` methods for aggregating data, the `Atomics.waitAsync` method for asynchronously waiting for a change to shared memory, and the `String.prototype.isWellFormed` and `String.prototype.toWellFormed` methods for checking and ensuring that strings contain only well-formed Unicode.
Dozens of individuals representing many organizations have made very significant contributions within Ecma TC39 to the development of this edition and to the prior editions. In addition, a vibrant community has emerged supporting TC39's ECMAScript efforts. This community has reviewed numerous drafts, filed thousands of bug reports, performed implementation experiments, contributed test suites, and educated the world-wide developer community about ECMAScript. Unfortunately, it is impossible to identify and acknowledge every person and organization who has contributed to this effort.
Allen Wirfs-Brock
@@ -124,21 +101,21 @@
Introduction
Shu-yu Guo
- ECMA-262, Project Editor, 12th through 14th Editions
+ ECMA-262, Project Editor, 12th through 15th Editions
Michael Ficarra
- ECMA-262, Project Editor, 12th through 14th Editions
+ ECMA-262, Project Editor, 12th through 15th Editions
Kevin Gibbons
- ECMA-262, Project Editor, 12th through 14th Editions
+ ECMA-262, Project Editor, 12th through 15th Editions
Scope
-
This Standard defines the ECMAScript 2024 general-purpose programming language.
+
This Standard defines the ECMAScript 2025 general-purpose programming language.
@@ -172,14 +149,19 @@
Example Legacy Normative Optional Clause Heading
Normative References
The following referenced documents are indispensable for the application of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.
-
ISO/IEC 10646 Information Technology — Universal Multiple-Octet Coded Character Set (UCS) plus Amendment 1:2005, Amendment 2:2006, Amendment 3:2008, and Amendment 4:2008, plus additional amendments and corrigenda, or successor
+
IEEE 754-2019, IEEE Standard for Floating-Point Arithmetic.
ISO/IEC 10646, Information Technology — Universal Multiple-Octet Coded Character Set (UCS) plus Amendment 1:2005, Amendment 2:2006, Amendment 3:2008, Amendment 4:2008, and additional amendments and corrigenda, or successor.
Even though ECMAScript includes syntax for class definitions, ECMAScript objects are not fundamentally class-based such as those in C++, Smalltalk, or Java. Instead objects may be created in various ways including via a literal notation or via constructors which create objects and then execute code that initializes all or part of them by assigning initial values to their properties. Each constructor is a function that has a property named *"prototype"* that is used to implement prototype-based inheritance and shared properties. Objects are created by using constructors in new expressions; for example, `new Date(2009, 11)` creates a new Date object. Invoking a constructor without using new has consequences that depend on the constructor. For example, `Date()` produces a string representation of the current date and time rather than an object.
Every object created by a constructor has an implicit reference (called the object's prototype) to the value of its constructor's *"prototype"* property. Furthermore, a prototype may have a non-*null* implicit reference to its prototype, and so on; this is called the prototype chain. When a reference is made to a property in an object, that reference is to the property of that name in the first object in the prototype chain that contains a property of that name. In other words, first the object mentioned directly is examined for such a property; if that object contains the named property, that is the property to which the reference refers; if that object does not contain the named property, the prototype for that object is examined next; and so on.
-
+
In a class-based object-oriented language, in general, state is carried by instances, methods are carried by classes, and inheritance is only of structure and behaviour. In ECMAScript, the state and methods are carried by objects, while structure, behaviour, and state are all inherited.
All objects that do not directly contain a particular property that their prototype contains share that property and its value. Figure 1 illustrates this:
@@ -1068,27 +1050,25 @@
Mathematical Operations
Mathematical values: Arbitrary real numbers, used as the default numeric type.
Extended mathematical values: Mathematical values together with +∞ and -∞.
-
Numbers: IEEE 754-2019 double-precision floating point values.
BigInts: ECMAScript language values representing arbitrary integers in a one-to-one correspondence.
-
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.
-
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.
+
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 …".
-
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.
-
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.
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.
+
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.
The mathematical function min(_x1_, _x2_, … , _xN_) produces the mathematically smallest of _x1_ through _xN_. The mathematical function max(_x1_, _x2_, ..., _xN_) produces the mathematically largest of _x1_ through _xN_. The domain and range of these mathematical functions are the extended mathematical values.
The notation “_x_ modulo _y_” (_y_ must be finite and non-zero) computes a value _k_ of the same sign as _y_ (or zero) such that abs(_k_) < abs(_y_) and _x_ - _k_ = _q_ × _y_ for some integer _q_.
The phrase "the result of clamping _x_ between _lower_ and _upper_" (where _x_ is an extended mathematical value and _lower_ and _upper_ are mathematical values such that _lower_ ≤ _upper_) produces _lower_ if _x_ < _lower_, produces _upper_ if _x_ > _upper_, and otherwise produces _x_.
The mathematical function floor(_x_) produces the largest integer (closest to +∞) that is not larger than _x_.
-
The mathematical function truncate(_x_) removes the fractional part of _x_ by rounding towards zero, producing -floor(-_x_) if _x_ < 0 and otherwise producing floor(_x_).
-
Mathematical functions min, max, abs, floor, and truncate are not defined for Numbers and BigInts, and any usage of those methods that have non-mathematical value arguments would be an editorial error in this specification.
floor(_x_) = _x_ - (_x_ modulo 1).
+
The mathematical function truncate(_x_) removes the fractional part of _x_ by rounding towards zero, producing -floor(-_x_) if _x_ < 0 and otherwise producing floor(_x_).
+
Mathematical functions min, max, abs, floor, and truncate are not defined for Numbers and BigInts, and any usage of those methods that have non-mathematical value arguments would be an editorial error in this specification.
An interval from lower bound _a_ to upper bound _b_ is a possibly-infinite, possibly-empty set of numeric values of the same numeric type. Each bound will be described as either inclusive or exclusive, but not both. There are four kinds of intervals, as follows:
An interval from _a_ (inclusive) to _b_ (inclusive), also called an inclusive interval from _a_ to _b_, includes all values _x_ of the same numeric type such that _a_ ≤ _x_ ≤ _b_, and no others.
@@ -1172,7 +1152,7 @@
_string_: a String,
_searchValue_: a String,
_fromIndex_: a non-negative integer,
- ): an integer
+ ): a non-negative integer or ~not-found~
@@ -1183,13 +1163,37 @@
1. For each integer _i_ such that _fromIndex_ ≤ _i_ ≤ _len_ - _searchLen_, in ascending order, do
1. Let _candidate_ be the substring of _string_ from _i_ to _i_ + _searchLen_.
1. If _candidate_ is _searchValue_, return _i_.
- 1. Return -1.
+ 1. Return ~not-found~.
If _searchValue_ is the empty String and _fromIndex_ ≤ the length of _string_, this algorithm returns _fromIndex_. The empty String is effectively found at every position within a string, including after the last code unit.
-
This algorithm always returns -1 if _fromIndex_ + the length of _searchValue_ > the length of _string_.
+
This algorithm always returns ~not-found~ if _fromIndex_ + the length of _searchValue_ > the length of _string_.
+
+
+
+
+
+ StringLastIndexOf (
+ _string_: a String,
+ _searchValue_: a String,
+ _fromIndex_: a non-negative integer,
+ ): a non-negative integer or ~not-found~
+
+
+
+
+ 1. Let _len_ be the length of _string_.
+ 1. Let _searchLen_ be the length of _searchValue_.
+ 1. Assert: _fromIndex_ + _searchLen_ ≤ _len_.
+ 1. For each integer _i_ such that 0 ≤ _i_ ≤ _fromIndex_, in descending order, do
+ 1. Let _candidate_ be the substring of _string_ from _i_ to _i_ + _searchLen_.
+ 1. If _candidate_ is _searchValue_, return _i_.
+ 1. Return ~not-found~.
+
+
+
If _searchValue_ is the empty String, this algorithm returns _fromIndex_. The empty String is effectively found at every position within a string, including after the last code unit.
@@ -1824,7 +1828,7 @@
Numeric Types
The Number Type
-
The Number type has exactly 18,437,736,874,454,810,627 (that is, 264 - 253 + 3) values, representing the double-precision 64-bit format IEEE 754-2019 values as specified in the IEEE Standard for Binary Floating-Point Arithmetic, except that the 9,007,199,254,740,990 (that is, 253 - 2) distinct “Not-a-Number” values of the IEEE Standard are represented in ECMAScript as a single special *NaN* value. (Note that the *NaN* value is produced by the program expression `NaN`.) In some implementations, external code might be able to detect a difference between various Not-a-Number values, but such behaviour is implementation-defined; to ECMAScript code, all *NaN* values are indistinguishable from each other.
+
The Number type has exactly 18,437,736,874,454,810,627 (that is, 264 - 253 + 3) values, representing the double-precision floating point IEEE 754-2019 binary64 values as specified in the IEEE Standard for Binary Floating-Point Arithmetic, except that the 9,007,199,254,740,990 (that is, 253 - 2) distinct “Not-a-Number” values of the IEEE Standard are represented in ECMAScript as a single special *NaN* value. (Note that the *NaN* value is produced by the program expression `NaN`.) In some implementations, external code might be able to detect a difference between various Not-a-Number values, but such behaviour is implementation-defined; to ECMAScript code, all *NaN* values are indistinguishable from each other.
The bit pattern that might be observed in an ArrayBuffer (see ) or a SharedArrayBuffer (see ) after a Number value has been stored into it is not necessarily the same as the internal representation of that Number value used by the ECMAScript implementation.
@@ -2359,7 +2363,7 @@
- 1. If _x_ is *0*ℤ, return *0*ℤ.
+ 1. If _x_ = *0*ℤ, return *0*ℤ.
1. Return -_x_.
@@ -2390,7 +2394,7 @@
1. If _exponent_ < *0*ℤ, throw a *RangeError* exception.
- 1. If _base_ is *0*ℤ and _exponent_ is *0*ℤ, return *1*ℤ.
+ 1. If _base_ = *0*ℤ and _exponent_ = *0*ℤ, return *1*ℤ.
1. Return _base_ raised to the power _exponent_.
@@ -2420,7 +2424,7 @@
- 1. If _y_ is *0*ℤ, throw a *RangeError* exception.
+ 1. If _y_ = *0*ℤ, throw a *RangeError* exception.
1. Let _quotient_ be ℝ(_x_) / ℝ(_y_).
1. Return ℤ(truncate(_quotient_)).
@@ -2436,8 +2440,8 @@
- 1. If _d_ is *0*ℤ, throw a *RangeError* exception.
- 1. If _n_ is *0*ℤ, return *0*ℤ.
+ 1. If _d_ = *0*ℤ, throw a *RangeError* exception.
+ 1. If _n_ = *0*ℤ, return *0*ℤ.
1. Let _quotient_ be ℝ(_n_) / ℝ(_d_).
1. Let _q_ be ℤ(truncate(_quotient_)).
1. Return _n_ - (_d_ × _q_).
@@ -2706,13 +2710,14 @@
The Object Type
An accessor property associates a key value with one or two accessor functions, and a set of Boolean attributes. The accessor functions are used to store or retrieve an ECMAScript language value that is associated with the property.
-
The properties of an object are uniquely identified using property keys. A property key is either a String or a Symbol. All Strings and Symbols, including the empty String, are valid as property keys. A property name is a property key that is a String.
+
The properties of an object are uniquely identified using property keys. A property key is either a String or a Symbol. All Strings and Symbols, including the empty String, are valid as property keys. A property name is a property key that is a String.
An integer index is a property name _n_ such that CanonicalNumericIndexString(_n_) returns an integral Number in the inclusive interval from *+0*𝔽 to 𝔽(253 - 1). An array index is an integer index _n_ such that CanonicalNumericIndexString(_n_) returns an integral Number in the inclusive interval from *+0*𝔽 to 𝔽(232 - 2).
Every non-negative safe integer has a corresponding integer index. Every 32-bit unsigned integer except 232 - 1 has a corresponding array index. *"-0"* is neither an integer index nor an array index.
Property keys are used to access properties and their values. There are two kinds of access for properties: get and set, corresponding to value retrieval and assignment, respectively. The properties accessible via get and set access includes both own properties that are a direct part of an object and inherited properties which are provided by another associated object via a property inheritance relationship. Inherited properties may be either own or inherited properties of the associated object. Each own property of an object must each have a key value that is distinct from the key values of the other own properties of that object.
All objects are logically collections of properties, but there are multiple forms of objects that differ in their semantics for accessing and manipulating their properties. Please see for definitions of the multiple forms of objects.
+
In addition, some objects are callable; these are referred to as functions or function objects and are described further below. All functions in ECMAScript are members of the Object type.
Property Attributes
@@ -3114,7 +3119,7 @@
[[GetOwnProperty]] ( _P_ )
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.
- If _P_'s attributes other than [[Writable]] may change over time or if the property might be deleted, then _P_'s [[Configurable]] attribute must be *true*.
+ If _P_'s attributes other than [[Writable]] and [[Value]] may change over time, or if the property might be deleted, then _P_'s [[Configurable]] attribute must be *true*.
If the [[Writable]] attribute may change from *false* to *true*, then the [[Configurable]] attribute must be *true*.
@@ -3310,7 +3315,17 @@
Well-Known Intrinsic Objects
- The constructor of async iterator objects ()
+ The constructor of async generator function objects ()
+
+
+
+
+ %AsyncGeneratorPrototype%
+
+
+
+
+ The prototype of async generator objects ()
@@ -3538,7 +3553,17 @@
Well-Known Intrinsic Objects
- The constructor of Generators ()
+ The constructor of generator function objects ()
+
+
+
+
+ %GeneratorPrototype%
+
+
+
+
+ The prototype of generator objects ()
@@ -3987,6 +4012,7 @@
The List and Record Specification Types
When an algorithm iterates over the elements of a List without specifying an order, the order used is the order of the elements in the List.
For notational convenience within this specification, a literal syntax can be used to express a new List value. For example, « 1, 2 » defines a List value that has two elements each of which is initialized to a specific value. A new empty List can be expressed as « ».
In this specification, the phrase "the list-concatenation of _A_, _B_, ..." (where each argument is a possibly empty List) denotes a new List value whose elements are the concatenation of the elements (in order) of each of the arguments (in order).
+
As applied to a List of Strings, the phrase "sorted according to lexicographic code unit order" means sorting by the numeric value of each code unit up to the length of the shorter string, and sorting the shorter string before the longer string if all are equal, as described in the abstract operation IsLessThan.
The Record type is used to describe data aggregations within the algorithms of this specification. A Record type value consists of one or more named fields. The value of each field is an ECMAScript language value or specification value. Field names are always enclosed in double brackets, for example [[Value]].
For notational convenience within this specification, an object literal-like syntax can be used to express a Record value. For example, { [[Field1]]: 42, [[Field2]]: *false*, [[Field3]]: ~empty~ } defines a Record value that has three fields, each of which is initialized to a specific value. Field name order is not significant. Any fields that are not explicitly listed are considered to be absent.
In specification text and algorithms, dot notation may be used to refer to a specific field of a Record value. For example, if R is the record shown in the previous paragraph then R.[[Field2]] is shorthand for “the field of R named [[Field2]]”.
@@ -4127,7 +4153,7 @@
- 1. Assert: If _completionRecord_.[[Type]] is either ~return~ or ~throw~, then _completionRecord_.[[Value]] is not ~empty~.
+ 1. Assert: If _completionRecord_ is either a return completion or a throw completion, then _completionRecord_.[[Value]] is not ~empty~.
1. If _completionRecord_.[[Value]] is not ~empty~, return ? _completionRecord_.
1. Return Completion Record { [[Type]]: _completionRecord_.[[Type]], [[Value]]: _value_, [[Target]]: _completionRecord_.[[Target]] }.
@@ -4489,7 +4515,7 @@
The Environment Record Specification Type
The Abstract Closure Specification Type
The Abstract Closure specification type is used to refer to algorithm steps together with a collection of values. Abstract Closures are meta-values and are invoked using function application style such as _closure_(_arg1_, _arg2_). Like abstract operations, invocations perform the algorithm steps described by the Abstract Closure.
In algorithm steps that create an Abstract Closure, values are captured with the verb "capture" followed by a list of aliases. When an Abstract Closure is created, it captures the value that is associated with each alias at that time. In steps that specify the algorithm to be performed when an Abstract Closure is called, each captured value is referred to by the alias that was used to capture the value.
-
If an Abstract Closure returns a Completion Record, that Completion Record's [[Type]] must be either ~normal~ or ~throw~.
+
If an Abstract Closure returns a Completion Record, that Completion Record must be either a normal completion or a throw completion.
Abstract Closures are created inline as part of other algorithms, shown in the following example.
1. Let _addend_ be 41.
@@ -4954,10 +4980,9 @@
- 1. Let _text_ be StringToCodePoints(_str_).
- 1. Let _literal_ be ParseText(_text_, |StringNumericLiteral|).
+ 1. Let _literal_ be ParseText(_str_, |StringNumericLiteral|).
1. If _literal_ is a List of errors, return *NaN*.
- 1. Return StringNumericValue of _literal_.
+ 1. Return the StringNumericValue of _literal_.
@@ -4974,7 +4999,7 @@
Runtime Semantics: StringNumericValue ( ): a Number
StringNumericLiteral ::: StrWhiteSpace? StrNumericLiteral StrWhiteSpace?
- 1. Return StringNumericValue of |StrNumericLiteral|.
+ 1. Return the StringNumericValue of |StrNumericLiteral|.
StrNumericLiteral ::: NonDecimalIntegerLiteral
@@ -4982,7 +5007,7 @@
Runtime Semantics: StringNumericValue ( ): a Number
StrDecimalLiteral ::: `-` StrUnsignedDecimalLiteral
- 1. Let _a_ be StringNumericValue of |StrUnsignedDecimalLiteral|.
+ 1. Let _a_ be the StringNumericValue of |StrUnsignedDecimalLiteral|.
1. If _a_ is *+0*𝔽, return *-0*𝔽.
1. Return -_a_.
@@ -4992,27 +5017,27 @@
Runtime Semantics: StringNumericValue ( ): a Number
StrUnsignedDecimalLiteral ::: DecimalDigits `.` DecimalDigits? ExponentPart?
- 1. Let _a_ be MV of the first |DecimalDigits|.
+ 1. Let _a_ be the MV of the first |DecimalDigits|.
1. If the second |DecimalDigits| is present, then
- 1. Let _b_ be MV of the second |DecimalDigits|.
+ 1. Let _b_ be the MV of the second |DecimalDigits|.
1. Let _n_ be the number of code points in the second |DecimalDigits|.
1. Else,
1. Let _b_ be 0.
1. Let _n_ be 0.
- 1. If |ExponentPart| is present, let _e_ be MV of |ExponentPart|. Otherwise, let _e_ be 0.
+ 1. If |ExponentPart| is present, let _e_ be the MV of |ExponentPart|. Otherwise, let _e_ be 0.
1. Return RoundMVResult((_a_ + (_b_ × 10-_n_)) × 10_e_).
StrUnsignedDecimalLiteral ::: `.` DecimalDigits ExponentPart?
- 1. Let _b_ be MV of |DecimalDigits|.
- 1. If |ExponentPart| is present, let _e_ be MV of |ExponentPart|. Otherwise, let _e_ be 0.
+ 1. Let _b_ be the MV of |DecimalDigits|.
+ 1. If |ExponentPart| is present, let _e_ be the MV of |ExponentPart|. Otherwise, let _e_ be 0.
1. Let _n_ be the number of code points in |DecimalDigits|.
1. Return RoundMVResult(_b_ × 10_e_ - _n_).
StrUnsignedDecimalLiteral ::: DecimalDigits ExponentPart?
- 1. Let _a_ be MV of |DecimalDigits|.
- 1. If |ExponentPart| is present, let _e_ be MV of |ExponentPart|. Otherwise, let _e_ be 0.
+ 1. Let _a_ be the MV of |DecimalDigits|.
+ 1. If |ExponentPart| is present, let _e_ be the MV of |ExponentPart|. Otherwise, let _e_ be 0.
1. Return RoundMVResult(_a_ × 10_e_).
@@ -5338,8 +5363,7 @@
- 1. Let _text_ be StringToCodePoints(_str_).
- 1. Let _literal_ be ParseText(_text_, |StringIntegerLiteral|).
+ 1. Let _literal_ be ParseText(_str_, |StringIntegerLiteral|).
1. If _literal_ is a List of errors, return *undefined*.
1. Let _mv_ be the MV of _literal_.
1. Assert: _mv_ is an integer.
@@ -5771,23 +5795,6 @@
-
-
- IsPropertyKey (
- _argument_: an ECMAScript language value,
- ): a Boolean
-
-
-
description
-
It determines if _argument_ is a value that may be used as a property key.
-
-
- 1. If _argument_ is a String, return *true*.
- 1. If _argument_ is a Symbol, return *true*.
- 1. Return *false*.
-
-
-
IsRegExp (
@@ -5938,8 +5945,8 @@
1. If _nx_ is *undefined*, return *undefined*.
1. Return BigInt::lessThan(_nx_, _py_).
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. Let _nx_ be ? ToNumeric(_px_).
+ 1. Let _ny_ be ? ToNumeric(_py_).
1. If Type(_nx_) is Type(_ny_), then
1. If _nx_ is a Number, then
1. Return Number::lessThan(_nx_, _ny_).
@@ -6120,29 +6127,6 @@
-
-
- CreateMethodProperty (
- _O_: an Object,
- _P_: a property key,
- _V_: an ECMAScript language value,
- ): ~unused~
-
-
-
description
-
It is used to create a new own property of an ordinary object.
-
-
- 1. Assert: _O_ is an ordinary, extensible object with no non-configurable properties.
- 1. Let _newDesc_ be the PropertyDescriptor { [[Value]]: _V_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
- 1. Perform ! DefinePropertyOrThrow(_O_, _P_, _newDesc_).
- 1. Return ~unused~.
-
-
-
This abstract operation creates a property whose attributes are set to the same defaults used for built-in methods and methods defined using class declaration syntax. Normally, the property will not already exist. If it does exist, DefinePropertyOrThrow is guaranteed to complete normally.
-
-
-
CreateDataPropertyOrThrow (
@@ -6744,7 +6728,7 @@
1. If _fieldName_ is a Private Name, then
1. Perform ? PrivateFieldAdd(_receiver_, _fieldName_, _initValue_).
1. Else,
- 1. Assert: IsPropertyKey(_fieldName_) is *true*.
+ 1. Assert: _fieldName_ is a property key.
1. Perform ? CreateDataPropertyOrThrow(_receiver_, _fieldName_, _initValue_).
1. Return ~unused~.
@@ -6769,6 +6753,65 @@
1. Return ~unused~.
+
+
+
+ AddValueToKeyedGroup (
+ _groups_: a List of Records with fields [[Key]] (an ECMAScript language value) and [[Elements]] (a List of ECMAScript language values),
+ _key_: an ECMAScript language value,
+ _value_: an ECMAScript language value,
+ ): ~unused~
+
+
+
+
+ 1. For each Record { [[Key]], [[Elements]] } _g_ of _groups_, do
+ 1. If SameValue(_g_.[[Key]], _key_) is *true*, then
+ 1. Assert: Exactly one element of _groups_ meets this criterion.
+ 1. Append _value_ to _g_.[[Elements]].
+ 1. Return ~unused~.
+ 1. Let _group_ be the Record { [[Key]]: _key_, [[Elements]]: « _value_ » }.
+ 1. Append _group_ to _groups_.
+ 1. Return ~unused~.
+
+
+
+
+
+ GroupBy (
+ _items_: an ECMAScript language value,
+ _callbackfn_: an ECMAScript language value,
+ _keyCoercion_: ~property~ or ~zero~,
+ ): 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
+
+
+
+
+ 1. Perform ? RequireObjectCoercible(_items_).
+ 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception.
+ 1. Let _groups_ be a new empty List.
+ 1. Let _iteratorRecord_ be ? GetIterator(_items_, ~sync~).
+ 1. Let _k_ be 0.
+ 1. Repeat,
+ 1. If _k_ ≥ 253 - 1, then
+ 1. Let _error_ be ThrowCompletion(a newly created *TypeError* object).
+ 1. Return ? IteratorClose(_iteratorRecord_, _error_).
+ 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
+ 1. If _next_ is ~done~, then
+ 1. Return _groups_.
+ 1. Let _value_ be _next_.
+ 1. Let _key_ be Completion(Call(_callbackfn_, *undefined*, « _value_, 𝔽(_k_) »)).
+ 1. IfAbruptCloseIterator(_key_, _iteratorRecord_).
+ 1. If _keyCoercion_ is ~property~, then
+ 1. Set _key_ to Completion(ToPropertyKey(_key_)).
+ 1. IfAbruptCloseIterator(_key_, _iteratorRecord_).
+ 1. Else,
+ 1. Assert: _keyCoercion_ is ~zero~.
+ 1. If _key_ is *-0*𝔽, set _key_ to *+0*𝔽.
+ 1. Perform AddValueToKeyedGroup(_groups_, _key_, _value_).
+ 1. Set _k_ to _k_ + 1.
+
+
@@ -6822,7 +6865,7 @@
Iterator Records
a Boolean
- Whether the iterator has been closed.
+ Whether the iterator has completed or been closed.
@@ -6882,10 +6925,16 @@
1. If _value_ is not present, then
- 1. Let _result_ be ? Call(_iteratorRecord_.[[NextMethod]], _iteratorRecord_.[[Iterator]]).
+ 1. Let _result_ be Completion(Call(_iteratorRecord_.[[NextMethod]], _iteratorRecord_.[[Iterator]])).
1. Else,
- 1. Let _result_ be ? Call(_iteratorRecord_.[[NextMethod]], _iteratorRecord_.[[Iterator]], « _value_ »).
- 1. If _result_ is not an Object, throw a *TypeError* exception.
+ 1. Let _result_ be Completion(Call(_iteratorRecord_.[[NextMethod]], _iteratorRecord_.[[Iterator]], « _value_ »)).
+ 1. If _result_ is a throw completion, then
+ 1. Set _iteratorRecord_.[[Done]] to *true*.
+ 1. Return ? _result_.
+ 1. Set _result_ to ! _result_.
+ 1. If _result_ is not an Object, then
+ 1. Set _iteratorRecord_.[[Done]] to *true*.
+ 1. Throw a *TypeError* exception.
1. Return _result_.
@@ -6920,20 +6969,47 @@
IteratorStep (
_iteratorRecord_: an Iterator Record,
- ): either a normal completion containing either an Object or *false*, or a throw completion
+ ): either a normal completion containing either an Object or ~done~, or a throw completion
description
-
It requests the next value from _iteratorRecord_.[[Iterator]] by calling _iteratorRecord_.[[NextMethod]] and returns either *false* indicating that the iterator has reached its end or the IteratorResult object if a next value is available.
+
It requests the next value from _iteratorRecord_.[[Iterator]] by calling _iteratorRecord_.[[NextMethod]] and returns either ~done~ indicating that the iterator has reached its end or the IteratorResult object if a next value is available.
1. Let _result_ be ? IteratorNext(_iteratorRecord_).
- 1. Let _done_ be ? IteratorComplete(_result_).
- 1. If _done_ is *true*, return *false*.
+ 1. Let _done_ be Completion(IteratorComplete(_result_)).
+ 1. If _done_ is a throw completion, then
+ 1. Set _iteratorRecord_.[[Done]] to *true*.
+ 1. Return ? _done_.
+ 1. Set _done_ to ! _done_.
+ 1. If _done_ is *true*, then
+ 1. Set _iteratorRecord_.[[Done]] to *true*.
+ 1. Return ~done~.
1. Return _result_.
+
+
+ IteratorStepValue (
+ _iteratorRecord_: an Iterator Record,
+ ): either a normal completion containing either an ECMAScript language value or ~done~, or a throw completion
+
+
+
description
+
It requests the next value from _iteratorRecord_.[[Iterator]] by calling _iteratorRecord_.[[NextMethod]] and returns either ~done~ indicating that the iterator has reached its end or the value from the IteratorResult object if a next value is available.
+
+
+ 1. Let _result_ be ? IteratorStep(_iteratorRecord_).
+ 1. If _result_ is ~done~, then
+ 1. Return ~done~.
+ 1. Let _value_ be Completion(IteratorValue(_result_)).
+ 1. If _value_ is a throw completion, then
+ 1. Set _iteratorRecord_.[[Done]] to *true*.
+ 1. Return ? _value_.
+
+
+
IteratorClose (
@@ -6949,12 +7025,12 @@
1. Assert: _iteratorRecord_.[[Iterator]] is an Object.
1. Let _iterator_ be _iteratorRecord_.[[Iterator]].
1. Let _innerResult_ be Completion(GetMethod(_iterator_, *"return"*)).
- 1. If _innerResult_.[[Type]] is ~normal~, then
+ 1. If _innerResult_ is a normal completion, then
1. Let _return_ be _innerResult_.[[Value]].
1. If _return_ is *undefined*, return ? _completion_.
1. Set _innerResult_ to Completion(Call(_return_, _iterator_)).
- 1. If _completion_.[[Type]] is ~throw~, return ? _completion_.
- 1. If _innerResult_.[[Type]] is ~throw~, return ? _innerResult_.
+ 1. If _completion_ is a throw completion, return ? _completion_.
+ 1. If _innerResult_ is a throw completion, return ? _innerResult_.
1. If _innerResult_.[[Value]] is not an Object, throw a *TypeError* exception.
1. Return ? _completion_.
@@ -6970,7 +7046,7 @@
1. Assert: _value_ is a Completion Record.
1. If _value_ is an abrupt completion, return ? IteratorClose(_iteratorRecord_, _value_).
- 1. Else, set _value_ to _value_.[[Value]].
+ 1. Else, set _value_ to ! _value_.
@@ -6989,13 +7065,13 @@
1. Assert: _iteratorRecord_.[[Iterator]] is an Object.
1. Let _iterator_ be _iteratorRecord_.[[Iterator]].
1. Let _innerResult_ be Completion(GetMethod(_iterator_, *"return"*)).
- 1. If _innerResult_.[[Type]] is ~normal~, then
+ 1. If _innerResult_ is a normal completion, then
1. Let _return_ be _innerResult_.[[Value]].
1. If _return_ is *undefined*, return ? _completion_.
1. Set _innerResult_ to Completion(Call(_return_, _iterator_)).
- 1. If _innerResult_.[[Type]] is ~normal~, set _innerResult_ to Completion(Await(_innerResult_.[[Value]])).
- 1. If _completion_.[[Type]] is ~throw~, return ? _completion_.
- 1. If _innerResult_.[[Type]] is ~throw~, return ? _innerResult_.
+ 1. If _innerResult_ is a normal completion, set _innerResult_ to Completion(Await(_innerResult_.[[Value]])).
+ 1. If _completion_ is a throw completion, return ? _completion_.
+ 1. If _innerResult_ is a throw completion, return ? _innerResult_.
1. If _innerResult_.[[Value]] is not an Object, throw a *TypeError* exception.
1. Return ? _completion_.
@@ -7053,13 +7129,11 @@
1. Let _values_ be a new empty List.
- 1. Let _next_ be *true*.
- 1. Repeat, while _next_ is not *false*,
- 1. Set _next_ to ? IteratorStep(_iteratorRecord_).
- 1. If _next_ is not *false*, then
- 1. Let _nextValue_ be ? IteratorValue(_next_).
- 1. Append _nextValue_ to _values_.
- 1. Return _values_.
+ 1. Repeat,
+ 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
+ 1. If _next_ is ~done~, then
+ 1. Return _values_.
+ 1. Append _next_ to _values_.
@@ -7122,8 +7196,8 @@
Static Semantics: BoundNames ( ): a List of Strings
VariableDeclarationList : VariableDeclarationList `,` VariableDeclaration
- 1. Let _names1_ be BoundNames of |VariableDeclarationList|.
- 1. Let _names2_ be BoundNames of |VariableDeclaration|.
+ 1. Let _names1_ be the BoundNames of |VariableDeclarationList|.
+ 1. Let _names2_ be the BoundNames of |VariableDeclaration|.
1. Return the list-concatenation of _names1_ and _names2_.
VariableDeclaration : BindingIdentifier Initializer?
@@ -7140,8 +7214,8 @@
Static Semantics: BoundNames ( ): a List of Strings
ObjectBindingPattern : `{` BindingPropertyList `,` BindingRestProperty `}`
- 1. Let _names1_ be BoundNames of |BindingPropertyList|.
- 1. Let _names2_ be BoundNames of |BindingRestProperty|.
+ 1. Let _names1_ be the BoundNames of |BindingPropertyList|.
+ 1. Let _names2_ be the BoundNames of |BindingRestProperty|.
1. Return the list-concatenation of _names1_ and _names2_.
ArrayBindingPattern : `[` Elision? `]`
@@ -7158,25 +7232,25 @@
Static Semantics: BoundNames ( ): a List of Strings
ArrayBindingPattern : `[` BindingElementList `,` Elision? BindingRestElement `]`
- 1. Let _names1_ be BoundNames of |BindingElementList|.
- 1. Let _names2_ be BoundNames of |BindingRestElement|.
+ 1. Let _names1_ be the BoundNames of |BindingElementList|.
+ 1. Let _names2_ be the BoundNames of |BindingRestElement|.
1. Return the list-concatenation of _names1_ and _names2_.
BindingPropertyList : BindingPropertyList `,` BindingProperty
- 1. Let _names1_ be BoundNames of |BindingPropertyList|.
- 1. Let _names2_ be BoundNames of |BindingProperty|.
+ 1. Let _names1_ be the BoundNames of |BindingPropertyList|.
+ 1. Let _names2_ be the BoundNames of |BindingProperty|.
1. Return the list-concatenation of _names1_ and _names2_.
BindingElementList : BindingElementList `,` BindingElisionElement
- 1. Let _names1_ be BoundNames of |BindingElementList|.
- 1. Let _names2_ be BoundNames of |BindingElisionElement|.
+ 1. Let _names1_ be the BoundNames of |BindingElementList|.
+ 1. Let _names2_ be the BoundNames of |BindingElisionElement|.
1. Return the list-concatenation of _names1_ and _names2_.
BindingElisionElement : Elision? BindingElement
- 1. Return BoundNames of |BindingElement|.
+ 1. Return the BoundNames of |BindingElement|.
BindingProperty : PropertyName `:` BindingElement
@@ -7208,14 +7282,14 @@
Static Semantics: BoundNames ( ): a List of Strings
FormalParameters : FormalParameterList `,` FunctionRestParameter
- 1. Let _names1_ be BoundNames of |FormalParameterList|.
- 1. Let _names2_ be BoundNames of |FunctionRestParameter|.
+ 1. Let _names1_ be the BoundNames of |FormalParameterList|.
+ 1. Let _names2_ be the BoundNames of |FunctionRestParameter|.
1. Return the list-concatenation of _names1_ and _names2_.
FormalParameterList : FormalParameterList `,` FormalParameter
- 1. Let _names1_ be BoundNames of |FormalParameterList|.
- 1. Let _names2_ be BoundNames of |FormalParameter|.
+ 1. Let _names1_ be the BoundNames of |FormalParameterList|.
+ 1. Let _names2_ be the BoundNames of |FormalParameter|.
1. Return the list-concatenation of _names1_ and _names2_.
ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList
@@ -7432,13 +7506,13 @@
Static Semantics: LexicallyDeclaredNames ( ): a List of Strings
StatementList : StatementList StatementListItem
- 1. Let _names1_ be LexicallyDeclaredNames of |StatementList|.
- 1. Let _names2_ be LexicallyDeclaredNames of |StatementListItem|.
+ 1. Let _names1_ be the LexicallyDeclaredNames of |StatementList|.
+ 1. Let _names2_ be the LexicallyDeclaredNames of |StatementListItem|.
1. Return the list-concatenation of _names1_ and _names2_.
StatementListItem : Statement
- 1. If |Statement| is Statement : LabelledStatement, return LexicallyDeclaredNames of |LabelledStatement|.
+ 1. If |Statement| is Statement : LabelledStatement, return the LexicallyDeclaredNames of |LabelledStatement|.
1. Return a new empty List.
StatementListItem : Declaration
@@ -7453,15 +7527,15 @@
Static Semantics: LexicallyDeclaredNames ( ): a List of Strings
1. If the first |CaseClauses| is present, let _names1_ be the LexicallyDeclaredNames of the first |CaseClauses|.
1. Else, let _names1_ be a new empty List.
- 1. Let _names2_ be LexicallyDeclaredNames of |DefaultClause|.
+ 1. Let _names2_ be the LexicallyDeclaredNames of |DefaultClause|.
1. If the second |CaseClauses| is present, let _names3_ be the LexicallyDeclaredNames of the second |CaseClauses|.
1. Else, let _names3_ be a new empty List.
1. Return the list-concatenation of _names1_, _names2_, and _names3_.
CaseClauses : CaseClauses CaseClause
- 1. Let _names1_ be LexicallyDeclaredNames of |CaseClauses|.
- 1. Let _names2_ be LexicallyDeclaredNames of |CaseClause|.
+ 1. Let _names1_ be the LexicallyDeclaredNames of |CaseClauses|.
+ 1. Let _names2_ be the LexicallyDeclaredNames of |CaseClause|.
1. Return the list-concatenation of _names1_ and _names2_.
CaseClause : `case` Expression `:` StatementList?
@@ -7484,7 +7558,7 @@
Static Semantics: LexicallyDeclaredNames ( ): a List of Strings
LabelledItem : FunctionDeclaration
- 1. Return BoundNames of |FunctionDeclaration|.
+ 1. Return the BoundNames of |FunctionDeclaration|.
FunctionStatementList : [empty]
@@ -7492,7 +7566,7 @@
Static Semantics: LexicallyDeclaredNames ( ): a List of Strings
FunctionStatementList : StatementList
- 1. Return TopLevelLexicallyDeclaredNames of |StatementList|.
+ 1. Return the TopLevelLexicallyDeclaredNames of |StatementList|.
ClassStaticBlockStatementList : [empty]
@@ -7518,7 +7592,7 @@
Static Semantics: LexicallyDeclaredNames ( ): a List of Strings
ScriptBody : StatementList
- 1. Return TopLevelLexicallyDeclaredNames of |StatementList|.
+ 1. Return the TopLevelLexicallyDeclaredNames of |StatementList|.
At the top level of a |Script|, function declarations are treated like var declarations rather than like lexical declarations.
@@ -7528,8 +7602,8 @@
Static Semantics: LexicallyDeclaredNames ( ): a List of Strings
ModuleItemList : ModuleItemList ModuleItem
- 1. Let _names1_ be LexicallyDeclaredNames of |ModuleItemList|.
- 1. Let _names2_ be LexicallyDeclaredNames of |ModuleItem|.
+ 1. Let _names1_ be the LexicallyDeclaredNames of |ModuleItemList|.
+ 1. Let _names2_ be the LexicallyDeclaredNames of |ModuleItem|.
1. Return the list-concatenation of _names1_ and _names2_.
ModuleItem : ImportDeclaration
@@ -7543,7 +7617,7 @@
Static Semantics: LexicallyDeclaredNames ( ): a List of Strings
ModuleItem : StatementListItem
- 1. Return LexicallyDeclaredNames of |StatementListItem|.
+ 1. Return the LexicallyDeclaredNames of |StatementListItem|.
At the top level of a |Module|, function declarations are treated like lexical declarations rather than like var declarations.
@@ -7556,18 +7630,18 @@
Static Semantics: LexicallyScopedDeclarations ( ): a List of Parse Nodes
StatementList : StatementList StatementListItem
- 1. Let _declarations1_ be LexicallyScopedDeclarations of |StatementList|.
- 1. Let _declarations2_ be LexicallyScopedDeclarations of |StatementListItem|.
+ 1. Let _declarations1_ be the LexicallyScopedDeclarations of |StatementList|.
+ 1. Let _declarations2_ be the LexicallyScopedDeclarations of |StatementListItem|.
1. Return the list-concatenation of _declarations1_ and _declarations2_.
StatementListItem : Statement
- 1. If |Statement| is Statement : LabelledStatement, return LexicallyScopedDeclarations of |LabelledStatement|.
+ 1. If |Statement| is Statement : LabelledStatement, return the LexicallyScopedDeclarations of |LabelledStatement|.
1. Return a new empty List.
StatementListItem : Declaration
- 1. Return a List whose sole element is DeclarationPart of |Declaration|.
+ 1. Return a List whose sole element is the DeclarationPart of |Declaration|.
CaseBlock : `{` `}`
@@ -7577,15 +7651,15 @@
Static Semantics: LexicallyScopedDeclarations ( ): a List of Parse Nodes
1. If the first |CaseClauses| is present, let _declarations1_ be the LexicallyScopedDeclarations of the first |CaseClauses|.
1. Else, let _declarations1_ be a new empty List.
- 1. Let _declarations2_ be LexicallyScopedDeclarations of |DefaultClause|.
+ 1. Let _declarations2_ be the LexicallyScopedDeclarations of |DefaultClause|.
1. If the second |CaseClauses| is present, let _declarations3_ be the LexicallyScopedDeclarations of the second |CaseClauses|.
1. Else, let _declarations3_ be a new empty List.
1. Return the list-concatenation of _declarations1_, _declarations2_, and _declarations3_.
CaseClauses : CaseClauses CaseClause
- 1. Let _declarations1_ be LexicallyScopedDeclarations of |CaseClauses|.
- 1. Let _declarations2_ be LexicallyScopedDeclarations of |CaseClause|.
+ 1. Let _declarations1_ be the LexicallyScopedDeclarations of |CaseClauses|.
+ 1. Let _declarations2_ be the LexicallyScopedDeclarations of |CaseClause|.
1. Return the list-concatenation of _declarations1_ and _declarations2_.
CaseClause : `case` Expression `:` StatementList?
@@ -7642,7 +7716,7 @@
Static Semantics: LexicallyScopedDeclarations ( ): a List of Parse Nodes
ScriptBody : StatementList
- 1. Return TopLevelLexicallyScopedDeclarations of |StatementList|.
+ 1. Return the TopLevelLexicallyScopedDeclarations of |StatementList|.
Module : [empty]
@@ -7650,8 +7724,8 @@
Static Semantics: LexicallyScopedDeclarations ( ): a List of Parse Nodes
ModuleItemList : ModuleItemList ModuleItem
- 1. Let _declarations1_ be LexicallyScopedDeclarations of |ModuleItemList|.
- 1. Let _declarations2_ be LexicallyScopedDeclarations of |ModuleItem|.
+ 1. Let _declarations1_ be the LexicallyScopedDeclarations of |ModuleItemList|.
+ 1. Let _declarations2_ be the LexicallyScopedDeclarations of |ModuleItem|.
1. Return the list-concatenation of _declarations1_ and _declarations2_.
ModuleItem : ImportDeclaration
@@ -7669,11 +7743,11 @@
Static Semantics: LexicallyScopedDeclarations ( ): a List of Parse Nodes
ExportDeclaration : `export` Declaration
- 1. Return a List whose sole element is DeclarationPart of |Declaration|.
+ 1. Return a List whose sole element is the DeclarationPart of |Declaration|.
ExportDeclaration : `export` `default` HoistableDeclaration
- 1. Return a List whose sole element is DeclarationPart of |HoistableDeclaration|.
+ 1. Return a List whose sole element is the DeclarationPart of |HoistableDeclaration|.
ExportDeclaration : `export` `default` ClassDeclaration
@@ -7708,8 +7782,8 @@
Static Semantics: VarDeclaredNames ( ): a List of Strings
StatementList : StatementList StatementListItem
- 1. Let _names1_ be VarDeclaredNames of |StatementList|.
- 1. Let _names2_ be VarDeclaredNames of |StatementListItem|.
+ 1. Let _names1_ be the VarDeclaredNames of |StatementList|.
+ 1. Let _names2_ be the VarDeclaredNames of |StatementListItem|.
1. Return the list-concatenation of _names1_ and _names2_.
StatementListItem : Declaration
@@ -7718,12 +7792,12 @@
Static Semantics: VarDeclaredNames ( ): a List of Strings
VariableStatement : `var` VariableDeclarationList `;`
- 1. Return BoundNames of |VariableDeclarationList|.
+ 1. Return the BoundNames of |VariableDeclarationList|.
IfStatement : `if` `(` Expression `)` Statement `else` Statement
- 1. Let _names1_ be VarDeclaredNames of the first |Statement|.
- 1. Let _names2_ be VarDeclaredNames of the second |Statement|.
+ 1. Let _names1_ be the VarDeclaredNames of the first |Statement|.
+ 1. Let _names2_ be the VarDeclaredNames of the second |Statement|.
1. Return the list-concatenation of _names1_ and _names2_.
IfStatement : `if` `(` Expression `)` Statement
@@ -7744,8 +7818,8 @@
Static Semantics: VarDeclaredNames ( ): a List of Strings
ForStatement : `for` `(` `var` VariableDeclarationList `;` Expression? `;` Expression? `)` Statement
- 1. Let _names1_ be BoundNames of |VariableDeclarationList|.
- 1. Let _names2_ be VarDeclaredNames of |Statement|.
+ 1. Let _names1_ be the BoundNames of |VariableDeclarationList|.
+ 1. Let _names2_ be the VarDeclaredNames of |Statement|.
1. Return the list-concatenation of _names1_ and _names2_.
ForStatement : `for` `(` LexicalDeclaration Expression? `;` Expression? `)` Statement
@@ -7794,15 +7868,15 @@
Static Semantics: VarDeclaredNames ( ): a List of Strings
1. If the first |CaseClauses| is present, let _names1_ be the VarDeclaredNames of the first |CaseClauses|.
1. Else, let _names1_ be a new empty List.
- 1. Let _names2_ be VarDeclaredNames of |DefaultClause|.
+ 1. Let _names2_ be the VarDeclaredNames of |DefaultClause|.
1. If the second |CaseClauses| is present, let _names3_ be the VarDeclaredNames of the second |CaseClauses|.
1. Else, let _names3_ be a new empty List.
1. Return the list-concatenation of _names1_, _names2_, and _names3_.
CaseClauses : CaseClauses CaseClause
- 1. Let _names1_ be VarDeclaredNames of |CaseClauses|.
- 1. Let _names2_ be VarDeclaredNames of |CaseClause|.
+ 1. Let _names1_ be the VarDeclaredNames of |CaseClauses|.
+ 1. Let _names2_ be the VarDeclaredNames of |CaseClause|.
1. Return the list-concatenation of _names1_ and _names2_.
CaseClause : `case` Expression `:` StatementList?
@@ -7825,21 +7899,21 @@
Static Semantics: VarDeclaredNames ( ): a List of Strings
TryStatement : `try` Block Catch
- 1. Let _names1_ be VarDeclaredNames of |Block|.
- 1. Let _names2_ be VarDeclaredNames of |Catch|.
+ 1. Let _names1_ be the VarDeclaredNames of |Block|.
+ 1. Let _names2_ be the VarDeclaredNames of |Catch|.
1. Return the list-concatenation of _names1_ and _names2_.
TryStatement : `try` Block Finally
- 1. Let _names1_ be VarDeclaredNames of |Block|.
- 1. Let _names2_ be VarDeclaredNames of |Finally|.
+ 1. Let _names1_ be the VarDeclaredNames of |Block|.
+ 1. Let _names2_ be the VarDeclaredNames of |Finally|.
1. Return the list-concatenation of _names1_ and _names2_.
TryStatement : `try` Block Catch Finally
- 1. Let _names1_ be VarDeclaredNames of |Block|.
- 1. Let _names2_ be VarDeclaredNames of |Catch|.
- 1. Let _names3_ be VarDeclaredNames of |Finally|.
+ 1. Let _names1_ be the VarDeclaredNames of |Block|.
+ 1. Let _names2_ be the VarDeclaredNames of |Catch|.
+ 1. Let _names3_ be the VarDeclaredNames of |Finally|.
1. Return the list-concatenation of _names1_, _names2_, and _names3_.
Catch : `catch` `(` CatchParameter `)` Block
@@ -7852,7 +7926,7 @@
Static Semantics: VarDeclaredNames ( ): a List of Strings
FunctionStatementList : StatementList
- 1. Return TopLevelVarDeclaredNames of |StatementList|.
+ 1. Return the TopLevelVarDeclaredNames of |StatementList|.
ClassStaticBlockStatementList : [empty]
@@ -7878,12 +7952,12 @@
Static Semantics: VarDeclaredNames ( ): a List of Strings
ScriptBody : StatementList
- 1. Return TopLevelVarDeclaredNames of |StatementList|.
+ 1. Return the TopLevelVarDeclaredNames of |StatementList|.
ModuleItemList : ModuleItemList ModuleItem
- 1. Let _names1_ be VarDeclaredNames of |ModuleItemList|.
- 1. Let _names2_ be VarDeclaredNames of |ModuleItem|.
+ 1. Let _names1_ be the VarDeclaredNames of |ModuleItemList|.
+ 1. Let _names2_ be the VarDeclaredNames of |ModuleItem|.
1. Return the list-concatenation of _names1_ and _names2_.
ModuleItem : ImportDeclaration
@@ -7892,7 +7966,7 @@
Static Semantics: VarDeclaredNames ( ): a List of Strings
ModuleItem : ExportDeclaration
- 1. If |ExportDeclaration| is `export` |VariableStatement|, return BoundNames of |ExportDeclaration|.
+ 1. If |ExportDeclaration| is `export` |VariableStatement|, return the BoundNames of |ExportDeclaration|.
1. Return a new empty List.
@@ -7920,8 +7994,8 @@
Static Semantics: VarScopedDeclarations ( ): a List of Parse Nodes
StatementList : StatementList StatementListItem
- 1. Let _declarations1_ be VarScopedDeclarations of |StatementList|.
- 1. Let _declarations2_ be VarScopedDeclarations of |StatementListItem|.
+ 1. Let _declarations1_ be the VarScopedDeclarations of |StatementList|.
+ 1. Let _declarations2_ be the VarScopedDeclarations of |StatementListItem|.
1. Return the list-concatenation of _declarations1_ and _declarations2_.
StatementListItem : Declaration
@@ -7934,13 +8008,13 @@
Static Semantics: VarScopedDeclarations ( ): a List of Parse Nodes
VariableDeclarationList : VariableDeclarationList `,` VariableDeclaration
- 1. Let _declarations1_ be VarScopedDeclarations of |VariableDeclarationList|.
+ 1. Let _declarations1_ be the VarScopedDeclarations of |VariableDeclarationList|.
1. Return the list-concatenation of _declarations1_ and « |VariableDeclaration| ».
IfStatement : `if` `(` Expression `)` Statement `else` Statement
- 1. Let _declarations1_ be VarScopedDeclarations of the first |Statement|.
- 1. Let _declarations2_ be VarScopedDeclarations of the second |Statement|.
+ 1. Let _declarations1_ be the VarScopedDeclarations of the first |Statement|.
+ 1. Let _declarations2_ be the VarScopedDeclarations of the second |Statement|.
1. Return the list-concatenation of _declarations1_ and _declarations2_.
IfStatement : `if` `(` Expression `)` Statement
@@ -7961,8 +8035,8 @@
Static Semantics: VarScopedDeclarations ( ): a List of Parse Nodes
ForStatement : `for` `(` `var` VariableDeclarationList `;` Expression? `;` Expression? `)` Statement
- 1. Let _declarations1_ be VarScopedDeclarations of |VariableDeclarationList|.
- 1. Let _declarations2_ be VarScopedDeclarations of |Statement|.
+ 1. Let _declarations1_ be the VarScopedDeclarations of |VariableDeclarationList|.
+ 1. Let _declarations2_ be the VarScopedDeclarations of |Statement|.
1. Return the list-concatenation of _declarations1_ and _declarations2_.
ForStatement : `for` `(` LexicalDeclaration Expression? `;` Expression? `)` Statement
@@ -7989,7 +8063,7 @@
Static Semantics: VarScopedDeclarations ( ): a List of Parse Nodes
1. Let _declarations1_ be « |ForBinding| ».
- 1. Let _declarations2_ be VarScopedDeclarations of |Statement|.
+ 1. Let _declarations2_ be the VarScopedDeclarations of |Statement|.
1. Return the list-concatenation of _declarations1_ and _declarations2_.
@@ -8011,15 +8085,15 @@
Static Semantics: VarScopedDeclarations ( ): a List of Parse Nodes
1. If the first |CaseClauses| is present, let _declarations1_ be the VarScopedDeclarations of the first |CaseClauses|.
1. Else, let _declarations1_ be a new empty List.
- 1. Let _declarations2_ be VarScopedDeclarations of |DefaultClause|.
+ 1. Let _declarations2_ be the VarScopedDeclarations of |DefaultClause|.
1. If the second |CaseClauses| is present, let _declarations3_ be the VarScopedDeclarations of the second |CaseClauses|.
1. Else, let _declarations3_ be a new empty List.
1. Return the list-concatenation of _declarations1_, _declarations2_, and _declarations3_.
CaseClauses : CaseClauses CaseClause
- 1. Let _declarations1_ be VarScopedDeclarations of |CaseClauses|.
- 1. Let _declarations2_ be VarScopedDeclarations of |CaseClause|.
+ 1. Let _declarations1_ be the VarScopedDeclarations of |CaseClauses|.
+ 1. Let _declarations2_ be the VarScopedDeclarations of |CaseClause|.
1. Return the list-concatenation of _declarations1_ and _declarations2_.
CaseClause : `case` Expression `:` StatementList?
@@ -8042,21 +8116,21 @@
Static Semantics: VarScopedDeclarations ( ): a List of Parse Nodes
TryStatement : `try` Block Catch
- 1. Let _declarations1_ be VarScopedDeclarations of |Block|.
- 1. Let _declarations2_ be VarScopedDeclarations of |Catch|.
+ 1. Let _declarations1_ be the VarScopedDeclarations of |Block|.
+ 1. Let _declarations2_ be the VarScopedDeclarations of |Catch|.
1. Return the list-concatenation of _declarations1_ and _declarations2_.
TryStatement : `try` Block Finally
- 1. Let _declarations1_ be VarScopedDeclarations of |Block|.
- 1. Let _declarations2_ be VarScopedDeclarations of |Finally|.
+ 1. Let _declarations1_ be the VarScopedDeclarations of |Block|.
+ 1. Let _declarations2_ be the VarScopedDeclarations of |Finally|.
1. Return the list-concatenation of _declarations1_ and _declarations2_.
TryStatement : `try` Block Catch Finally
- 1. Let _declarations1_ be VarScopedDeclarations of |Block|.
- 1. Let _declarations2_ be VarScopedDeclarations of |Catch|.
- 1. Let _declarations3_ be VarScopedDeclarations of |Finally|.
+ 1. Let _declarations1_ be the VarScopedDeclarations of |Block|.
+ 1. Let _declarations2_ be the VarScopedDeclarations of |Catch|.
+ 1. Let _declarations3_ be the VarScopedDeclarations of |Finally|.
1. Return the list-concatenation of _declarations1_, _declarations2_, and _declarations3_.
Catch : `catch` `(` CatchParameter `)` Block
@@ -8095,7 +8169,7 @@
Static Semantics: VarScopedDeclarations ( ): a List of Parse Nodes
ScriptBody : StatementList
- 1. Return TopLevelVarScopedDeclarations of |StatementList|.
+ 1. Return the TopLevelVarScopedDeclarations of |StatementList|.
Module : [empty]
@@ -8103,8 +8177,8 @@
Static Semantics: VarScopedDeclarations ( ): a List of Parse Nodes
ModuleItemList : ModuleItemList ModuleItem
- 1. Let _declarations1_ be VarScopedDeclarations of |ModuleItemList|.
- 1. Let _declarations2_ be VarScopedDeclarations of |ModuleItem|.
+ 1. Let _declarations1_ be the VarScopedDeclarations of |ModuleItemList|.
+ 1. Let _declarations2_ be the VarScopedDeclarations of |ModuleItem|.
1. Return the list-concatenation of _declarations1_ and _declarations2_.
ModuleItem : ImportDeclaration
@@ -8113,7 +8187,7 @@
Static Semantics: VarScopedDeclarations ( ): a List of Parse Nodes
ModuleItem : ExportDeclaration
- 1. If |ExportDeclaration| is `export` |VariableStatement|, return VarScopedDeclarations of |VariableStatement|.
+ 1. If |ExportDeclaration| is `export` |VariableStatement|, return the VarScopedDeclarations of |VariableStatement|.
1. Return a new empty List.
@@ -8124,8 +8198,8 @@
Static Semantics: TopLevelLexicallyDeclaredNames ( ): a List of Strings
StatementList : StatementList StatementListItem
- 1. Let _names1_ be TopLevelLexicallyDeclaredNames of |StatementList|.
- 1. Let _names2_ be TopLevelLexicallyDeclaredNames of |StatementListItem|.
+ 1. Let _names1_ be the TopLevelLexicallyDeclaredNames of |StatementList|.
+ 1. Let _names2_ be the TopLevelLexicallyDeclaredNames of |StatementListItem|.
1. Return the list-concatenation of _names1_ and _names2_.
StatementListItem : Statement
@@ -8149,8 +8223,8 @@
Static Semantics: TopLevelLexicallyScopedDeclarations ( ): a List of Parse N
StatementList : StatementList StatementListItem
- 1. Let _declarations1_ be TopLevelLexicallyScopedDeclarations of |StatementList|.
- 1. Let _declarations2_ be TopLevelLexicallyScopedDeclarations of |StatementListItem|.
+ 1. Let _declarations1_ be the TopLevelLexicallyScopedDeclarations of |StatementList|.
+ 1. Let _declarations2_ be the TopLevelLexicallyScopedDeclarations of |StatementListItem|.
1. Return the list-concatenation of _declarations1_ and _declarations2_.
StatementListItem : Statement
@@ -8171,8 +8245,8 @@
Static Semantics: TopLevelVarDeclaredNames ( ): a List of Strings
StatementList : StatementList StatementListItem
- 1. Let _names1_ be TopLevelVarDeclaredNames of |StatementList|.
- 1. Let _names2_ be TopLevelVarDeclaredNames of |StatementListItem|.
+ 1. Let _names1_ be the TopLevelVarDeclaredNames of |StatementList|.
+ 1. Let _names2_ be the TopLevelVarDeclaredNames of |StatementListItem|.
1. Return the list-concatenation of _names1_ and _names2_.
StatementListItem : Declaration
@@ -8183,8 +8257,8 @@
Static Semantics: TopLevelVarDeclaredNames ( ): a List of Strings
StatementListItem : Statement
- 1. If |Statement| is Statement : LabelledStatement, return TopLevelVarDeclaredNames of |Statement|.
- 1. Return VarDeclaredNames of |Statement|.
+ 1. If |Statement| is Statement : LabelledStatement, return the TopLevelVarDeclaredNames of |Statement|.
+ 1. Return the VarDeclaredNames of |Statement|.
At the top level of a function or script, inner function declarations are treated like var declarations.
@@ -8195,12 +8269,12 @@
Static Semantics: TopLevelVarDeclaredNames ( ): a List of Strings
LabelledItem : Statement
- 1. If |Statement| is Statement : LabelledStatement, return TopLevelVarDeclaredNames of |Statement|.
- 1. Return VarDeclaredNames of |Statement|.
+ 1. If |Statement| is Statement : LabelledStatement, return the TopLevelVarDeclaredNames of |Statement|.
+ 1. Return the VarDeclaredNames of |Statement|.
LabelledItem : FunctionDeclaration
- 1. Return BoundNames of |FunctionDeclaration|.
+ 1. Return the BoundNames of |FunctionDeclaration|.
@@ -8210,19 +8284,19 @@
Static Semantics: TopLevelVarScopedDeclarations ( ): a List of Parse Nodes
StatementList : StatementList StatementListItem
- 1. Let _declarations1_ be TopLevelVarScopedDeclarations of |StatementList|.
- 1. Let _declarations2_ be TopLevelVarScopedDeclarations of |StatementListItem|.
+ 1. Let _declarations1_ be the TopLevelVarScopedDeclarations of |StatementList|.
+ 1. Let _declarations2_ be the TopLevelVarScopedDeclarations of |StatementListItem|.
1. Return the list-concatenation of _declarations1_ and _declarations2_.
StatementListItem : Statement
- 1. If |Statement| is Statement : LabelledStatement, return TopLevelVarScopedDeclarations of |Statement|.
- 1. Return VarScopedDeclarations of |Statement|.
+ 1. If |Statement| is Statement : LabelledStatement, return the TopLevelVarScopedDeclarations of |Statement|.
+ 1. Return the VarScopedDeclarations of |Statement|.
StatementListItem : Declaration
1. If |Declaration| is Declaration : HoistableDeclaration, then
- 1. Let _declaration_ be DeclarationPart of |HoistableDeclaration|.
+ 1. Let _declaration_ be the DeclarationPart of |HoistableDeclaration|.
1. Return « _declaration_ ».
1. Return a new empty List.
@@ -8232,8 +8306,8 @@
Static Semantics: TopLevelVarScopedDeclarations ( ): a List of Parse Nodes
LabelledItem : Statement
- 1. If |Statement| is Statement : LabelledStatement, return TopLevelVarScopedDeclarations of |Statement|.
- 1. Return VarScopedDeclarations of |Statement|.
+ 1. If |Statement| is Statement : LabelledStatement, return the TopLevelVarScopedDeclarations of |Statement|.
+ 1. Return the VarScopedDeclarations of |Statement|.
LabelledItem : FunctionDeclaration
@@ -9374,7 +9448,7 @@
BindingIdentifier : Identifier
- 1. Let _name_ be StringValue of |Identifier|.
+ 1. Let _name_ be the StringValue of |Identifier|.
1. Return ? InitializeBoundName(_name_, _value_, _environment_).
BindingIdentifier : `yield`
@@ -9492,19 +9566,13 @@
SingleNameBinding : BindingIdentifier Initializer?
- 1. Let _bindingId_ be StringValue of |BindingIdentifier|.
+ 1. Let _bindingId_ be the StringValue of |BindingIdentifier|.
1. Let _lhs_ be ? ResolveBinding(_bindingId_, _environment_).
1. Let _v_ be *undefined*.
1. If _iteratorRecord_.[[Done]] is *false*, then
- 1. Let _next_ be Completion(IteratorStep(_iteratorRecord_)).
- 1. If _next_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_next_).
- 1. If _next_ is *false*, then
- 1. Set _iteratorRecord_.[[Done]] to *true*.
- 1. Else,
- 1. Set _v_ to Completion(IteratorValue(_next_)).
- 1. If _v_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_v_).
+ 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
+ 1. If _next_ is not ~done~, then
+ 1. Set _v_ to _next_.
1. If |Initializer| is present and _v_ is *undefined*, then
1. If IsAnonymousFunctionDefinition(|Initializer|) is *true*, then
1. Set _v_ to ? NamedEvaluation of |Initializer| with argument _bindingId_.
@@ -9518,15 +9586,9 @@
1. Let _v_ be *undefined*.
1. If _iteratorRecord_.[[Done]] is *false*, then
- 1. Let _next_ be Completion(IteratorStep(_iteratorRecord_)).
- 1. If _next_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_next_).
- 1. If _next_ is *false*, then
- 1. Set _iteratorRecord_.[[Done]] to *true*.
- 1. Else,
- 1. Set _v_ to Completion(IteratorValue(_next_)).
- 1. If _v_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_v_).
+ 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
+ 1. If _next_ is not ~done~, then
+ 1. Set _v_ to _next_.
1. If |Initializer| is present and _v_ is *undefined*, then
1. Let _defaultValue_ be ? Evaluation of |Initializer|.
1. Set _v_ to ? GetValue(_defaultValue_).
@@ -9538,18 +9600,13 @@
1. Let _A_ be ! ArrayCreate(0).
1. Let _n_ be 0.
1. Repeat,
+ 1. Let _next_ be ~done~.
1. If _iteratorRecord_.[[Done]] is *false*, then
- 1. Let _next_ be Completion(IteratorStep(_iteratorRecord_)).
- 1. If _next_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_next_).
- 1. If _next_ is *false*, set _iteratorRecord_.[[Done]] to *true*.
- 1. If _iteratorRecord_.[[Done]] is *true*, then
+ 1. Set _next_ to ? IteratorStepValue(_iteratorRecord_).
+ 1. If _next_ is ~done~, then
1. If _environment_ is *undefined*, return ? PutValue(_lhs_, _A_).
1. Return ? InitializeReferencedBinding(_lhs_, _A_).
- 1. Let _nextValue_ be Completion(IteratorValue(_next_)).
- 1. If _nextValue_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_nextValue_).
- 1. Perform ! CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_n_)), _nextValue_).
+ 1. Perform ! CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_n_)), _next_).
1. Set _n_ to _n_ + 1.
1. Let _A_ be ! ArrayCreate(0).
1. Let _n_ be 0.
1. Repeat,
+ 1. Let _next_ be ~done~.
1. If _iteratorRecord_.[[Done]] is *false*, then
- 1. Let _next_ be Completion(IteratorStep(_iteratorRecord_)).
- 1. If _next_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_next_).
- 1. If _next_ is *false*, set _iteratorRecord_.[[Done]] to *true*.
- 1. If _iteratorRecord_.[[Done]] is *true*, then
+ 1. Set _next_ to ? IteratorStepValue(_iteratorRecord_).
+ 1. If _next_ is ~done~, then
1. Return ? BindingInitialization of |BindingPattern| with arguments _A_ and _environment_.
- 1. Let _nextValue_ be Completion(IteratorValue(_next_)).
- 1. If _nextValue_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_nextValue_).
- 1. Perform ! CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_n_)), _nextValue_).
+ 1. Perform ! CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_n_)), _next_).
1. Set _n_ to _n_ + 1.
FormalParameters : [empty]
@@ -9588,15 +9640,9 @@
1. Let _v_ be *undefined*.
1. Assert: _iteratorRecord_.[[Done]] is *false*.
- 1. Let _next_ be Completion(IteratorStep(_iteratorRecord_)).
- 1. If _next_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_next_).
- 1. If _next_ is *false*, then
- 1. Set _iteratorRecord_.[[Done]] to *true*.
- 1. Else,
- 1. Set _v_ to Completion(IteratorValue(_next_)).
- 1. If _v_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_v_).
+ 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
+ 1. If _next_ is not ~done~, then
+ 1. Set _v_ to _next_.
1. Return ? BindingInitialization of |BindingIdentifier| with arguments _v_ and _environment_.
ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList
@@ -9610,15 +9656,9 @@
1. Let _v_ be *undefined*.
1. Assert: _iteratorRecord_.[[Done]] is *false*.
- 1. Let _next_ be Completion(IteratorStep(_iteratorRecord_)).
- 1. If _next_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_next_).
- 1. If _next_ is *false*, then
- 1. Set _iteratorRecord_.[[Done]] to *true*.
- 1. Else,
- 1. Set _v_ to Completion(IteratorValue(_next_)).
- 1. If _v_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_v_).
+ 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
+ 1. If _next_ is not ~done~, then
+ 1. Set _v_ to _next_.
1. Return ? BindingInitialization of |BindingIdentifier| with arguments _v_ and _environment_.
@@ -9629,7 +9669,7 @@
Static Semantics: AssignmentTargetType ( ): ~simple~ or ~invalid~
IdentifierReference : Identifier
- 1. If this |IdentifierReference| is contained in strict mode code and StringValue of |Identifier| is either *"eval"* or *"arguments"*, return ~invalid~.
+ 1. If IsStrict(this |IdentifierReference|) is *true* and the StringValue of |Identifier| is either *"eval"* or *"arguments"*, return ~invalid~.
1. Return ~simple~.
@@ -9657,7 +9697,7 @@
Static Semantics: AssignmentTargetType ( ): ~simple~ or ~invalid~
1. Let _expr_ be the |ParenthesizedExpression| that is covered by |CoverParenthesizedExpressionAndArrowParameterList|.
- 1. Return AssignmentTargetType of _expr_.
+ 1. Return the AssignmentTargetType of _expr_.
PrimaryExpression :
@@ -9787,7 +9827,7 @@
Static Semantics: PropName ( ): a String or ~empty~
PropertyDefinition : IdentifierReference
- 1. Return StringValue of |IdentifierReference|.
+ 1. Return the StringValue of |IdentifierReference|.
PropertyDefinition : `...` AssignmentExpression
@@ -9795,11 +9835,11 @@
Static Semantics: PropName ( ): a String or ~empty~
PropertyDefinition : PropertyName `:` AssignmentExpression
- 1. Return PropName of |PropertyName|.
+ 1. Return the PropName of |PropertyName|.
LiteralPropertyName : IdentifierName
- 1. Return StringValue of |IdentifierName|.
+ 1. Return the StringValue of |IdentifierName|.
LiteralPropertyName : StringLiteral
@@ -9821,15 +9861,15 @@
Static Semantics: PropName ( ): a String or ~empty~
`set` ClassElementName `(` PropertySetParameterList `)` `{` FunctionBody `}`
- 1. Return PropName of |ClassElementName|.
+ 1. Return the PropName of |ClassElementName|.
GeneratorMethod : `*` ClassElementName `(` UniqueFormalParameters `)` `{` GeneratorBody `}`
- 1. Return PropName of |ClassElementName|.
+ 1. Return the PropName of |ClassElementName|.
AsyncGeneratorMethod : `async` `*` ClassElementName `(` UniqueFormalParameters `)` `{` AsyncGeneratorBody `}`
- 1. Return PropName of |ClassElementName|.
+ 1. Return the PropName of |ClassElementName|.
ClassElement : ClassStaticBlock
@@ -9843,13 +9883,13 @@
Static Semantics: PropName ( ): a String or ~empty~
AsyncMethod : `async` ClassElementName `(` UniqueFormalParameters `)` `{` AsyncFunctionBody `}`
- 1. Return PropName of |ClassElementName|.
+ 1. Return the PropName of |ClassElementName|.
FieldDefinition : ClassElementName Initializer?
- 1. Return PropName of |ClassElementName|.
+ 1. Return the PropName of |ClassElementName|.
ClassElementName : PrivateIdentifier
@@ -11771,7 +11811,7 @@
1. If _env_ is not present or _env_ is *undefined*, then
1. Set _env_ to the running execution context's LexicalEnvironment.
1. Assert: _env_ is an Environment Record.
- 1. If the source text matched by the syntactic production that is being evaluated is contained in strict mode code, let _strict_ be *true*; else let _strict_ be *false*.
+ 1. Let _strict_ be IsStrict(the syntactic production that is being evaluated).
1. Return ? GetIdentifierReference(_env_, _name_, _strict_).
@@ -12005,7 +12045,7 @@
-
The _realm_ for Jobs returned by NewPromiseResolveThenableJob is usually the result of calling GetFunctionRealm on the _then_ function object. The _realm_ for Jobs returned by NewPromiseReactionJob is usually the result of calling GetFunctionRealm on the handler if the handler is not *undefined*. If the handler is *undefined*, _realm_ is *null*. For both kinds of Jobs, when GetFunctionRealm completes abnormally (i.e. called on a revoked Proxy), _realm_ is the current Realm at the time of the GetFunctionRealm call. When the _realm_ is *null*, no user ECMAScript code will be evaluated and no new ECMAScript objects (e.g. Error objects) will be created. The WHATWG HTML specification (https://html.spec.whatwg.org/), for example, uses _realm_ to check for the ability to run script and for the entry concept.
+
The _realm_ for Jobs returned by NewPromiseResolveThenableJob is usually the result of calling GetFunctionRealm on the _then_ function object. The _realm_ for Jobs returned by NewPromiseReactionJob is usually the result of calling GetFunctionRealm on the handler if the handler is not *undefined*. If the handler is *undefined*, _realm_ is *null*. For both kinds of Jobs, when GetFunctionRealm completes abnormally (i.e. called on a revoked Proxy), _realm_ is the current Realm Record at the time of the GetFunctionRealm call. When the _realm_ is *null*, no user ECMAScript code will be evaluated and no new ECMAScript objects (e.g. Error objects) will be created. The WHATWG HTML specification (https://html.spec.whatwg.org/), for example, uses _realm_ to check for the ability to run script and for the entry concept.
@@ -12647,7 +12687,7 @@
It returns *true* if and only if _Desc_ can be applied as the property of an object with specified _extensibility_ and current property _current_ while upholding invariants. When such application is possible and _O_ is not *undefined*, it is performed for the property named _P_ (which is created if necessary).
- 1. Assert: IsPropertyKey(_P_) is *true*.
+ 1. Assert: _P_ is a property key.
1. If _current_ is *undefined*, then
1. If _extensible_ is *false*, return *false*.
1. If _O_ is *undefined*, return *true*.
@@ -13198,7 +13238,7 @@
1. Perform OrdinaryCallBindThis(_F_, _calleeContext_, _thisArgument_).
1. Let _result_ be Completion(OrdinaryCallEvaluateBody(_F_, _argumentsList_)).
1. [id="step-call-pop-context-stack"] Remove _calleeContext_ from the execution context stack and restore _callerContext_ as the running execution context.
- 1. If _result_.[[Type]] is ~return~, return _result_.[[Value]].
+ 1. If _result_ is a return completion, return _result_.[[Value]].
1. ReturnIfAbrupt(_result_).
1. Return *undefined*.
@@ -13372,7 +13412,7 @@
1. Let _constructorEnv_ be the LexicalEnvironment of _calleeContext_.
1. Let _result_ be Completion(OrdinaryCallEvaluateBody(_F_, _argumentsList_)).
1. Remove _calleeContext_ from the execution context stack and restore _callerContext_ as the running execution context.
- 1. If _result_.[[Type]] is ~return~, then
+ 1. If _result_ is a return completion, then
1. If _result_.[[Value]] is an Object, return _result_.[[Value]].
1. If _kind_ is ~base~, return _thisArgument_.
1. If _result_.[[Value]] is not *undefined*, throw a *TypeError* exception.
@@ -13407,7 +13447,7 @@
1. Set _F_.[[SourceText]] to _sourceText_.
1. Set _F_.[[FormalParameters]] to _ParameterList_.
1. Set _F_.[[ECMAScriptCode]] to _Body_.
- 1. If the source text matched by _Body_ is strict mode code, let _Strict_ be *true*; else let _Strict_ be *false*.
+ 1. Let _Strict_ be IsStrict(_Body_).
1. Set _F_.[[Strict]] to _Strict_.
1. If _thisMode_ is ~lexical-this~, set _F_.[[ThisMode]] to ~lexical~.
1. Else if _Strict_ is *true*, set _F_.[[ThisMode]] to ~strict~.
@@ -13519,24 +13559,25 @@
-
+
DefineMethodProperty (
_homeObject_: an Object,
_key_: a property key or Private Name,
_closure_: a function object,
_enumerable_: a Boolean,
- ): a PrivateElement or ~unused~
+ ): either a normal completion containing either a PrivateElement or ~unused~, or an abrupt completion
- 1. Assert: _homeObject_ is an ordinary, extensible object with no non-configurable properties.
+ 1. Assert: _homeObject_ is an ordinary, extensible object.
1. If _key_ is a Private Name, then
1. Return PrivateElement { [[Key]]: _key_, [[Kind]]: ~method~, [[Value]]: _closure_ }.
1. Else,
1. Let _desc_ be the PropertyDescriptor { [[Value]]: _closure_, [[Writable]]: *true*, [[Enumerable]]: _enumerable_, [[Configurable]]: *true* }.
- 1. Perform ! DefinePropertyOrThrow(_homeObject_, _key_, _desc_).
+ 1. Perform ? DefinePropertyOrThrow(_homeObject_, _key_, _desc_).
+ 1. NOTE: DefinePropertyOrThrow only returns an abrupt completion when attempting to define a class static method whose _key_ is *"prototype"*.
1. Return ~unused~.
@@ -13648,7 +13689,7 @@
1. NOTE: A separate Environment Record is needed to ensure that bindings created by direct eval calls in the formal parameter list are outside the environment where parameters are declared.
1. Let _calleeEnv_ be the LexicalEnvironment of _calleeContext_.
1. Let _env_ be NewDeclarativeEnvironment(_calleeEnv_).
- 1. Assert: The VariableEnvironment of _calleeContext_ is _calleeEnv_.
+ 1. Assert: The VariableEnvironment of _calleeContext_ and _calleeEnv_ are the same Environment Record.
1. Set the LexicalEnvironment of _calleeContext_ to _env_.
1. For each String _paramName_ of _parameterNames_, do
1. Let _alreadyDeclared_ be ! _env_.HasBinding(_paramName_).
@@ -14492,13 +14533,13 @@
-
-
Integer-Indexed Exotic Objects
-
An Integer-Indexed exotic object is an exotic object that performs special handling of integer index property keys.
-
Integer-Indexed exotic objects have the same internal slots as ordinary objects and additionally [[ViewedArrayBuffer]], [[ArrayLength]], [[ByteOffset]], [[ContentType]], and [[TypedArrayName]] internal slots.
-
An object is an Integer-Indexed exotic object if its [[GetOwnProperty]], [[HasProperty]], [[DefineOwnProperty]], [[Get]], [[Set]], [[Delete]], and [[OwnPropertyKeys]] internal methods use the definitions in this section, and its other essential internal methods use the definitions found in . These methods are installed by IntegerIndexedObjectCreate.
+
+
TypedArray Exotic Objects
+
A TypedArray is an exotic object that performs special handling of integer index property keys.
+
TypedArrays have the same internal slots as ordinary objects and additionally [[ViewedArrayBuffer]], [[ArrayLength]], [[ByteOffset]], [[ContentType]], and [[TypedArrayName]] internal slots.
+
An object is a TypedArray if its [[GetOwnProperty]], [[HasProperty]], [[DefineOwnProperty]], [[Get]], [[Set]], [[Delete]], and [[OwnPropertyKeys]] internal methods use the definitions in this section, and its other essential internal methods use the definitions found in . These methods are installed by TypedArrayCreate.
-
+
[[GetOwnProperty]] (
_P_: a property key,
@@ -14506,20 +14547,20 @@
for
-
an Integer-Indexed exotic object _O_
+
a TypedArray _O_
1. If _P_ is a String, then
1. Let _numericIndex_ be CanonicalNumericIndexString(_P_).
1. If _numericIndex_ is not *undefined*, then
- 1. Let _value_ be IntegerIndexedElementGet(_O_, _numericIndex_).
+ 1. Let _value_ be TypedArrayGetElement(_O_, _numericIndex_).
1. If _value_ is *undefined*, return *undefined*.
1. Return the PropertyDescriptor { [[Value]]: _value_, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: *true* }.
1. Return OrdinaryGetOwnProperty(_O_, _P_).
-
+
[[HasProperty]] (
_P_: a property key,
@@ -14527,7 +14568,7 @@
for
-
an Integer-Indexed exotic object _O_
+
a TypedArray _O_
1. If _P_ is a String, then
@@ -14537,7 +14578,7 @@
-
+
[[DefineOwnProperty]] (
_P_: a property key,
@@ -14546,7 +14587,7 @@
for
-
an Integer-Indexed exotic object _O_
+
a TypedArray _O_
1. If _P_ is a String, then
@@ -14557,13 +14598,13 @@
1. If _Desc_ has an [[Enumerable]] field and _Desc_.[[Enumerable]] is *false*, return *false*.
1. If IsAccessorDescriptor(_Desc_) is *true*, return *false*.
1. If _Desc_ has a [[Writable]] field and _Desc_.[[Writable]] is *false*, return *false*.
- 1. If _Desc_ has a [[Value]] field, perform ? IntegerIndexedElementSet(_O_, _numericIndex_, _Desc_.[[Value]]).
+ 1. If _Desc_ has a [[Value]] field, perform ? TypedArraySetElement(_O_, _numericIndex_, _Desc_.[[Value]]).
1. Return *true*.
1. Return ! OrdinaryDefineOwnProperty(_O_, _P_, _Desc_).
-
+
[[Get]] (
_P_: a property key,
@@ -14572,18 +14613,18 @@
for
-
an Integer-Indexed exotic object _O_
+
a TypedArray _O_
1. If _P_ is a String, then
1. Let _numericIndex_ be CanonicalNumericIndexString(_P_).
1. If _numericIndex_ is not *undefined*, then
- 1. Return IntegerIndexedElementGet(_O_, _numericIndex_).
+ 1. Return TypedArrayGetElement(_O_, _numericIndex_).
1. Return ? OrdinaryGet(_O_, _P_, _Receiver_).
-
+
[[Set]] (
_P_: a property key,
@@ -14593,21 +14634,21 @@
for
-
an Integer-Indexed exotic object _O_
+
a TypedArray _O_
1. If _P_ is a String, then
1. Let _numericIndex_ be CanonicalNumericIndexString(_P_).
1. If _numericIndex_ is not *undefined*, then
1. If SameValue(_O_, _Receiver_) is *true*, then
- 1. Perform ? IntegerIndexedElementSet(_O_, _numericIndex_, _V_).
+ 1. Perform ? TypedArraySetElement(_O_, _numericIndex_, _V_).
1. Return *true*.
1. If IsValidIntegerIndex(_O_, _numericIndex_) is *false*, return *true*.
1. Return ? OrdinarySet(_O_, _P_, _V_, _Receiver_).
-
+
[[Delete]] (
_P_: a property key,
@@ -14615,7 +14656,7 @@
for
-
an Integer-Indexed exotic object _O_
+
a TypedArray _O_
1. If _P_ is a String, then
@@ -14626,17 +14667,17 @@
-
+
[[OwnPropertyKeys]] ( ): a normal completion containing a List of property keys
for
-
an Integer-Indexed exotic object _O_
+
a TypedArray _O_
- 1. Let _iieoRecord_ be MakeIntegerIndexedObjectWithBufferWitnessRecord(_O_, ~seq-cst~).
+ 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_O_, ~seq-cst~).
1. Let _keys_ be a new empty List.
- 1. If IsIntegerIndexedObjectOutOfBounds(_iieoRecord_) is *false*, then
- 1. Let _length_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 1. If IsTypedArrayOutOfBounds(_taRecord_) is *false*, then
+ 1. Let _length_ be TypedArrayLength(_taRecord_).
1. For each integer _i_ such that 0 ≤ _i_ < _length_, in ascending order, do
1. Append ! ToString(𝔽(_i_)) to _keys_.
1. For each own property key _P_ of _O_ such that _P_ is a String and _P_ is not an integer index, in ascending chronological order of property creation, do
@@ -14647,11 +14688,11 @@
[[OwnPropertyKeys]] ( ): a normal completion containing a List of property k
-
-
Integer-Indexed Object With Buffer Witness Records
-
An Integer-Indexed Object With Buffer Witness Record is a Record value used to encapsulate an Integer-Indexed object along with a cached byte length of the viewed buffer. It is used to help ensure there is a single shared memory read event of the byte length data block when the viewed buffer is a growable SharedArrayBuffer.
-
Integer-Indexed Object With Buffer Witness Records have the fields listed in .
-
+
+
TypedArray With Buffer Witness Records
+
An TypedArray With Buffer Witness Record is a Record value used to encapsulate a TypedArray along with a cached byte length of the viewed buffer. It is used to help ensure there is a single shared memory read event of the byte length data block when the viewed buffer is a growable SharedArrayBuffer.
+
TypedArray With Buffer Witness Records have the fields listed in .
+
@@ -14669,10 +14710,10 @@
Integer-Indexed Object With Buffer Witness Records
[[Object]]
- an Integer-Indexed exotic object
+ a TypedArray
- The Integer-Indexed exotic object whose buffer's byte length is loaded.
+ The TypedArray whose buffer's byte length is loaded.
@@ -14690,12 +14731,12 @@
Integer-Indexed Object With Buffer Witness Records
-
+
- MakeIntegerIndexedObjectWithBufferWitnessRecord (
- _obj_: an Integer-Indexed exotic object,
+ MakeTypedArrayWithBufferWitnessRecord (
+ _obj_: a TypedArray,
_order_: ~seq-cst~ or ~unordered~,
- ): an Integer-Indexed Object With Buffer Witness Record
+ ): a TypedArray With Buffer Witness Record
@@ -14705,79 +14746,79 @@
1. Let _byteLength_ be ~detached~.
1. Else,
1. Let _byteLength_ be ArrayBufferByteLength(_buffer_, _order_).
- 1. Return the Integer-Indexed Object With Buffer Witness Record { [[Object]]: _obj_, [[CachedBufferByteLength]]: _byteLength_ }.
+ 1. Return the TypedArray With Buffer Witness Record { [[Object]]: _obj_, [[CachedBufferByteLength]]: _byteLength_ }.
-
+
- IntegerIndexedObjectCreate (
+ TypedArrayCreate (
_prototype_: an Object,
- ): an Integer-Indexed exotic object
+ ): a TypedArray
description
-
It is used to specify the creation of new Integer-Indexed exotic objects.
+
It is used to specify the creation of new TypedArrays.
1. Let _internalSlotsList_ be « [[Prototype]], [[Extensible]], [[ViewedArrayBuffer]], [[TypedArrayName]], [[ContentType]], [[ByteLength]], [[ByteOffset]], [[ArrayLength]] ».
1. Let _A_ be MakeBasicObject(_internalSlotsList_).
- 1. Set _A_.[[GetOwnProperty]] as specified in .
- 1. Set _A_.[[HasProperty]] as specified in .
- 1. Set _A_.[[DefineOwnProperty]] as specified in .
- 1. Set _A_.[[Get]] as specified in .
- 1. Set _A_.[[Set]] as specified in .
- 1. Set _A_.[[Delete]] as specified in .
- 1. Set _A_.[[OwnPropertyKeys]] as specified in .
+ 1. Set _A_.[[GetOwnProperty]] as specified in .
+ 1. Set _A_.[[HasProperty]] as specified in .
+ 1. Set _A_.[[DefineOwnProperty]] as specified in .
+ 1. Set _A_.[[Get]] as specified in .
+ 1. Set _A_.[[Set]] as specified in .
+ 1. Set _A_.[[Delete]] as specified in .
+ 1. Set _A_.[[OwnPropertyKeys]] as specified in .
1. Set _A_.[[Prototype]] to _prototype_.
1. Return _A_.
-
+
- IntegerIndexedObjectByteLength (
- _iieoRecord_: an Integer-Indexed Object With Buffer Witness Record,
+ TypedArrayByteLength (
+ _taRecord_: a TypedArray With Buffer Witness Record,
): a non-negative integer
- 1. If IsIntegerIndexedObjectOutOfBounds(_iieoRecord_) is *true*, return 0.
- 1. Let _length_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, return 0.
+ 1. Let _length_ be TypedArrayLength(_taRecord_).
1. If _length_ = 0, return 0.
- 1. Let _O_ be _iieoRecord_.[[Object]].
+ 1. Let _O_ be _taRecord_.[[Object]].
1. If _O_.[[ByteLength]] is not ~auto~, return _O_.[[ByteLength]].
1. Let _elementSize_ be TypedArrayElementSize(_O_).
1. Return _length_ × _elementSize_.
-
+
- IntegerIndexedObjectLength (
- _iieoRecord_: an Integer-Indexed Object With Buffer Witness Record,
+ TypedArrayLength (
+ _taRecord_: a TypedArray With Buffer Witness Record,
): a non-negative integer
- 1. Assert: IsIntegerIndexedObjectOutOfBounds(_iieoRecord_) is *false*.
- 1. Let _O_ be _iieoRecord_.[[Object]].
+ 1. Assert: IsTypedArrayOutOfBounds(_taRecord_) is *false*.
+ 1. Let _O_ be _taRecord_.[[Object]].
1. If _O_.[[ArrayLength]] is not ~auto~, return _O_.[[ArrayLength]].
1. Assert: IsFixedLengthArrayBuffer(_O_.[[ViewedArrayBuffer]]) is *false*.
1. Let _byteOffset_ be _O_.[[ByteOffset]].
1. Let _elementSize_ be TypedArrayElementSize(_O_).
- 1. Let _byteLength_ be _iieoRecord_.[[CachedBufferByteLength]].
+ 1. Let _byteLength_ be _taRecord_.[[CachedBufferByteLength]].
1. Assert: _byteLength_ is not ~detached~.
1. Return floor((_byteLength_ - _byteOffset_) / _elementSize_).
-
+
- IsIntegerIndexedObjectOutOfBounds (
- _iieoRecord_: an Integer-Indexed Object With Buffer Witness Record,
+ IsTypedArrayOutOfBounds (
+ _taRecord_: a TypedArray With Buffer Witness Record,
): a Boolean
@@ -14785,8 +14826,8 @@
It checks if any of the object's numeric properties reference a value at an index not contained within the underlying buffer's bounds.
- 1. Let _O_ be _iieoRecord_.[[Object]].
- 1. Let _bufferByteLength_ be _iieoRecord_.[[CachedBufferByteLength]].
+ 1. Let _O_ be _taRecord_.[[Object]].
+ 1. Let _bufferByteLength_ be _taRecord_.[[CachedBufferByteLength]].
1. Assert: IsDetachedBuffer(_O_.[[ViewedArrayBuffer]]) is *true* if and only if _bufferByteLength_ is ~detached~.
1. If _bufferByteLength_ is ~detached~, return *true*.
1. Let _byteOffsetStart_ be _O_.[[ByteOffset]].
@@ -14804,7 +14845,7 @@
IsValidIntegerIndex (
- _O_: an Integer-Indexed exotic object,
+ _O_: a TypedArray,
_index_: a Number,
): a Boolean
@@ -14814,19 +14855,19 @@
1. If IsDetachedBuffer(_O_.[[ViewedArrayBuffer]]) is *true*, return *false*.
1. If IsIntegralNumber(_index_) is *false*, return *false*.
1. If _index_ is *-0*𝔽, return *false*.
- 1. Let _iieoRecord_ be MakeIntegerIndexedObjectWithBufferWitnessRecord(_O_, ~unordered~).
+ 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.
- 1. If IsIntegerIndexedObjectOutOfBounds(_iieoRecord_) is *true*, return *false*.
- 1. Let _length_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, return *false*.
+ 1. Let _length_ be TypedArrayLength(_taRecord_).
1. If ℝ(_index_) < 0 or ℝ(_index_) ≥ _length_, return *false*.
1. Return *true*.
-
+
- IntegerIndexedElementGet (
- _O_: an Integer-Indexed exotic object,
+ TypedArrayGetElement (
+ _O_: a TypedArray,
_index_: a Number,
): a Number, a BigInt, or *undefined*
@@ -14842,10 +14883,10 @@
-
+
- IntegerIndexedElementSet (
- _O_: an Integer-Indexed exotic object,
+ TypedArraySetElement (
+ _O_: a TypedArray,
_index_: a Number,
_value_: an ECMAScript language value,
): either a normal completion containing ~unused~ or a throw completion
@@ -14871,7 +14912,7 @@
IsArrayBufferViewOutOfBounds (
- _O_: an Integer-Indexed exotic object or a DataView,
+ _O_: a TypedArray or a DataView,
): a Boolean
@@ -14882,8 +14923,8 @@
1. If _O_ has a [[DataView]] internal slot, then
1. Let _viewRecord_ be MakeDataViewWithBufferWitnessRecord(_O_, ~seq-cst~).
1. Return IsViewOutOfBounds(_viewRecord_).
- 1. Let _iieoRecord_ be MakeIntegerIndexedObjectWithBufferWitnessRecord(_O_, ~seq-cst~).
- 1. Return IsIntegerIndexedObjectOutOfBounds(_iieoRecord_).
+ 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_O_, ~seq-cst~).
+ 1. Return IsTypedArrayOutOfBounds(_taRecord_).
@@ -14925,7 +14966,7 @@
Module Namespace Exotic Objects
a List of Strings
- A List whose elements are the String values of the exported names exposed as own properties of this object. The list is ordered as if an Array of those String values had been sorted using %Array.prototype.sort% using *undefined* as _comparefn_.
+ A List whose elements are the String values of the exported names exposed as own properties of this object. The list is sorted according to lexicographic code unit order.
@@ -15138,7 +15179,7 @@
1. Let _M_ be MakeBasicObject(_internalSlotsList_).
1. Set _M_'s essential internal methods to the definitions specified in .
1. Set _M_.[[Module]] to _module_.
- 1. [declared="comparefn"] Let _sortedExports_ be a List whose elements are the elements of _exports_ ordered as if an Array of the same values had been sorted using %Array.prototype.sort% using *undefined* as _comparefn_.
+ 1. Let _sortedExports_ be a List whose elements are the elements of _exports_, sorted according to lexicographic code unit order.
1. Set _M_.[[Exports]] to _sortedExports_.
1. Create own properties of _M_ corresponding to the definitions in .
1. Set _module_.[[Namespace]] to _M_.
@@ -16051,13 +16092,14 @@
Static Semantics: ParseText (
- _sourceText_: a sequence of Unicode code points,
+ _sourceText_: a String or a sequence of Unicode code points,
_goalSymbol_: a nonterminal in one of the ECMAScript grammars,
): a Parse Node or a non-empty List of *SyntaxError* objects
+ 1. If _sourceText_ is a String, set _sourceText_ to StringToCodePoints(_sourceText_).
1. Attempt to parse _sourceText_ using _goalSymbol_ as the goal symbol, and analyse the parse result for any early error conditions. Parsing and early error detection may be interleaved in an implementation-defined manner.
1. If the parse succeeded and no early errors were found, return the Parse Node (an instance of _goalSymbol_) at the root of the parse tree resulting from the parse.
1. Otherwise, return a List of one or more *SyntaxError* objects representing the parsing errors and/or early errors. If more than one parsing error or early error is present, the number and ordering of error objects in the list is implementation-defined, but at least one must be present.
@@ -16137,6 +16179,19 @@
Strict Mode Code
ECMAScript code that is not strict mode code is called non-strict code.
+
+
+
+ Static Semantics: IsStrict (
+ _node_: a Parse Node,
+ ): a Boolean
+
+
+
+
+ 1. If the source text matched by _node_ is strict mode code, return *true*; else return *false*.
+
+
@@ -16208,69 +16263,7 @@
Syntax
Unicode Format-Control Characters
The Unicode format-control characters (i.e., the characters in category “Cf” in the Unicode Character Database such as LEFT-TO-RIGHT MARK or RIGHT-TO-LEFT MARK) are control codes used to control the formatting of a range of text in the absence of higher-level protocols for this (such as mark-up languages).
It is useful to allow format-control characters in source text to facilitate editing and display. All format control characters may be used within comments, and within string literals, template literals, and regular expression literals.
-
U+200C (ZERO WIDTH NON-JOINER) and U+200D (ZERO WIDTH JOINER) are format-control characters that are used to make necessary distinctions when forming words or phrases in certain languages. In ECMAScript source text these code points may also be used in an |IdentifierName| after the first character.
-
U+FEFF (ZERO WIDTH NO-BREAK SPACE) is a format-control character used primarily at the start of a text to mark it as Unicode and to allow detection of the text's encoding and byte order. <ZWNBSP> characters intended for this purpose can sometimes also appear after the start of a text, for example as a result of concatenating files. In ECMAScript source text <ZWNBSP> code points are treated as white space characters (see ).
-
The special treatment of certain format-control characters outside of comments, string literals, and regular expression literals is summarized in .
-
-
-
-
- Code Point
-
-
- Name
-
-
- Abbreviation
-
-
- Usage
-
-
-
-
- `U+200C`
-
-
- ZERO WIDTH NON-JOINER
-
-
- <ZWNJ>
-
-
- |IdentifierPart|
-
-
-
-
- `U+200D`
-
-
- ZERO WIDTH JOINER
-
-
- <ZWJ>
-
-
- |IdentifierPart|
-
-
-
-
- `U+FEFF`
-
-
- ZERO WIDTH NO-BREAK SPACE
-
-
- <ZWNBSP>
-
-
- |WhiteSpace|
-
-
-
-
+
U+FEFF (ZERO WIDTH NO-BREAK SPACE) is a format-control character used primarily at the start of a text to mark it as Unicode and to allow detection of the text's encoding and byte order. <ZWNBSP> characters intended for this purpose can sometimes also appear after the start of a text, for example as a result of concatenating files. In ECMAScript source text <ZWNBSP> code points are treated as white space characters (see ) outside of comments, string literals, template literals, and regular expression literals.
@@ -16519,7 +16512,7 @@
Syntax
Names and Keywords
|IdentifierName| and |ReservedWord| are tokens that are interpreted according to the Default Identifier Syntax given in Unicode Standard Annex #31, Identifier and Pattern Syntax, with some small modifications. |ReservedWord| is an enumerated subset of |IdentifierName|. The syntactic grammar defines |Identifier| as an |IdentifierName| that is not a |ReservedWord|. The Unicode identifier grammar is based on character properties specified by the Unicode Standard. The Unicode code points in the specified categories in the latest version of the Unicode Standard must be treated as in those categories by all conforming ECMAScript implementations. ECMAScript implementations may recognize identifier code points defined in later editions of the Unicode Standard.
-
This standard specifies specific code point additions: U+0024 (DOLLAR SIGN) and U+005F (LOW LINE) are permitted anywhere in an |IdentifierName|, and the code points U+200C (ZERO WIDTH NON-JOINER) and U+200D (ZERO WIDTH JOINER) are permitted anywhere after the first code point of an |IdentifierName|.
+
This standard specifies specific code point additions: U+0024 (DOLLAR SIGN) and U+005F (LOW LINE) are permitted anywhere in an |IdentifierName|.
Syntax
@@ -16546,8 +16539,6 @@
Syntax
IdentifierPartChar ::
UnicodeIDContinue
`$`
- <ZWNJ>
- <ZWJ>
// emu-format ignore
AsciiLetter :: one of
@@ -16578,13 +16569,13 @@
Static Semantics: Early Errors
IdentifierStart :: `\` UnicodeEscapeSequence
- It is a Syntax Error if IdentifierCodePoint of |UnicodeEscapeSequence| is not some Unicode code point matched by the |IdentifierStartChar| lexical grammar production.
+ It is a Syntax Error if the IdentifierCodePoint of |UnicodeEscapeSequence| is not some Unicode code point matched by the |IdentifierStartChar| lexical grammar production.
IdentifierPart :: `\` UnicodeEscapeSequence
- It is a Syntax Error if IdentifierCodePoint of |UnicodeEscapeSequence| is not some Unicode code point matched by the |IdentifierPartChar| lexical grammar production.
+ It is a Syntax Error if the IdentifierCodePoint of |UnicodeEscapeSequence| is not some Unicode code point matched by the |IdentifierPartChar| lexical grammar production.
@@ -16595,13 +16586,13 @@
Static Semantics: IdentifierCodePoints ( ): a List of code points
IdentifierName :: IdentifierStart
- 1. Let _cp_ be IdentifierCodePoint of |IdentifierStart|.
+ 1. Let _cp_ be the IdentifierCodePoint of |IdentifierStart|.
1. Return « _cp_ ».
IdentifierName :: IdentifierName IdentifierPart
- 1. Let _cps_ be IdentifierCodePoints of the derived |IdentifierName|.
- 1. Let _cp_ be IdentifierCodePoint of |IdentifierPart|.
+ 1. Let _cps_ be the IdentifierCodePoints of the derived |IdentifierName|.
+ 1. Let _cp_ be the IdentifierCodePoint of |IdentifierPart|.
1. Return the list-concatenation of _cps_ and « _cp_ ».
It is a Syntax Error if the source text matched by this production is strict mode code.
+
It is a Syntax Error if IsStrict(this production) is *true*.
In non-strict code, this syntax is Legacy.
@@ -17137,7 +17128,7 @@
Static Semantics: Early Errors
NonOctalDecimalEscapeSequence
-
It is a Syntax Error if the source text matched by this production is strict mode code.
+
It is a Syntax Error if IsStrict(this production) is *true*.
In non-strict code, this syntax is Legacy.
@@ -17548,10 +17539,10 @@
Syntax
`u` `{` CodePoint [lookahead ∉ HexDigit] [lookahead != `}`]
NotCodePoint ::
- HexDigits[~Sep] [> but only if MV of |HexDigits| > 0x10FFFF]
+ HexDigits[~Sep] [> but only if the MV of |HexDigits| > 0x10FFFF]
CodePoint ::
- HexDigits[~Sep] [> but only if MV of |HexDigits| ≤ 0x10FFFF]
+ HexDigits[~Sep] [> but only if the MV of |HexDigits| ≤ 0x10FFFF]
|TemplateSubstitutionTail| is used by the |InputElementTemplateTail| alternative lexical goal.
@@ -17994,7 +17985,7 @@
Static Semantics: Early Errors
BindingIdentifier : Identifier
- It is a Syntax Error if the source text matched by this production is contained in strict mode code and the StringValue of |Identifier| is either *"arguments"* or *"eval"*.
+ It is a Syntax Error if IsStrict(this production) is *true* and the StringValue of |Identifier| is either *"arguments"* or *"eval"*.
@@ -18006,7 +17997,7 @@
Static Semantics: Early Errors
- It is a Syntax Error if the source text matched by this production is contained in strict mode code.
+ It is a Syntax Error if IsStrict(this production) is *true*.
@@ -18046,16 +18037,16 @@
Static Semantics: Early Errors
- It is a Syntax Error if this production has a [Yield] parameter and StringValue of |Identifier| is *"yield"*.
+ It is a Syntax Error if this production has a [Yield] parameter and the StringValue of |Identifier| is *"yield"*.
- It is a Syntax Error if this production has an [Await] parameter and StringValue of |Identifier| is *"await"*.
+ It is a Syntax Error if this production has an [Await] parameter and the StringValue of |Identifier| is *"await"*.
Identifier : IdentifierName but not ReservedWord
- It is a Syntax Error if this phrase is contained in strict mode code and the StringValue of |IdentifierName| is one of *"implements"*, *"interface"*, *"let"*, *"package"*, *"private"*, *"protected"*, *"public"*, *"static"*, or *"yield"*.
+ It is a Syntax Error if IsStrict(this phrase) is *true* and the StringValue of |IdentifierName| is one of *"implements"*, *"interface"*, *"let"*, *"package"*, *"private"*, *"protected"*, *"public"*, *"static"*, or *"yield"*.
It is a Syntax Error if the goal symbol of the syntactic grammar is |Module| and the StringValue of |IdentifierName| is *"await"*.
@@ -18065,7 +18056,7 @@
Static Semantics: Early Errors
-
StringValue of |IdentifierName| normalizes any Unicode escape sequences in |IdentifierName| hence such escapes cannot be used to write an |Identifier| whose code point sequence is the same as a |ReservedWord|.
+
The StringValue of |IdentifierName| normalizes any Unicode escape sequences in |IdentifierName| hence such escapes cannot be used to write an |Identifier| whose code point sequence is the same as a |ReservedWord|.
@@ -18079,7 +18070,7 @@
Static Semantics: StringValue ( ): a String
IdentifierName IdentifierPart
- 1. Let _idTextUnescaped_ be IdentifierCodePoints of |IdentifierName|.
+ 1. Let _idTextUnescaped_ be the IdentifierCodePoints of |IdentifierName|.
1. Return CodePointsToString(_idTextUnescaped_).
@@ -18318,10 +18309,9 @@
1. Let _spreadObj_ be ? GetValue(_spreadRef_).
1. Let _iteratorRecord_ be ? GetIterator(_spreadObj_, ~sync~).
1. Repeat,
- 1. Let _next_ be ? IteratorStep(_iteratorRecord_).
- 1. If _next_ is *false*, return _nextIndex_.
- 1. Let _nextValue_ be ? IteratorValue(_next_).
- 1. Perform ! CreateDataPropertyOrThrow(_array_, ! ToString(𝔽(_nextIndex_)), _nextValue_).
+ 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
+ 1. If _next_ is ~done~, return _nextIndex_.
+ 1. Perform ! CreateDataPropertyOrThrow(_array_, ! ToString(𝔽(_nextIndex_)), _next_).
1. Set _nextIndex_ to _nextIndex_ + 1.
@@ -18411,7 +18401,7 @@
Static Semantics: Early Errors
It is a Syntax Error if HasDirectSuper of |MethodDefinition| is *true*.
- It is a Syntax Error if PrivateBoundIdentifiers of |MethodDefinition| is not empty.
+ It is a Syntax Error if the PrivateBoundIdentifiers of |MethodDefinition| is not empty.
In addition to describing an actual object initializer the |ObjectLiteral| productions are also used as a cover grammar for |ObjectAssignmentPattern| and may be recognized as part of a |CoverParenthesizedExpressionAndArrowParameterList|. When |ObjectLiteral| appears in a context where |ObjectAssignmentPattern| is required the following Early Error rules are not applied. In addition, they are not applied when initially parsing a |CoverParenthesizedExpressionAndArrowParameterList| or |CoverCallExpressionAndAsyncArrowHead|.
@@ -18431,7 +18421,7 @@
Static Semantics: Early Errors
- It is a Syntax Error if PropertyNameList of |PropertyDefinitionList| contains any duplicate entries for *"__proto__"* and at least two of those entries were obtained from productions of the form PropertyDefinition : PropertyName `:` AssignmentExpression. This rule is not applied if this |ObjectLiteral| is contained within a |Script| that is being parsed for JSON.parse (see step of JSON.parse).
+ It is a Syntax Error if the PropertyNameList of |PropertyDefinitionList| contains any duplicate entries for *"__proto__"* and at least two of those entries were obtained from productions of the form PropertyDefinition : PropertyName `:` AssignmentExpression. This rule is not applied if this |ObjectLiteral| is contained within a |Script| that is being parsed for JSON.parse (see step of JSON.parse).
@@ -18459,14 +18449,14 @@
Static Semantics: PropertyNameList ( ): a List of Strings
PropertyDefinitionList : PropertyDefinition
- 1. Let _propName_ be PropName of |PropertyDefinition|.
+ 1. Let _propName_ be the PropName of |PropertyDefinition|.
1. If _propName_ is ~empty~, return a new empty List.
1. Return « _propName_ ».
PropertyDefinitionList : PropertyDefinitionList `,` PropertyDefinition
- 1. Let _list_ be PropertyNameList of |PropertyDefinitionList|.
- 1. Let _propName_ be PropName of |PropertyDefinition|.
+ 1. Let _list_ be the PropertyNameList of |PropertyDefinitionList|.
+ 1. Let _propName_ be the PropName of |PropertyDefinition|.
1. If _propName_ is ~empty~, return _list_.
1. Return the list-concatenation of _list_ and « _propName_ ».
@@ -18490,7 +18480,7 @@
Runtime Semantics: Evaluation
LiteralPropertyName : IdentifierName
- 1. Return StringValue of |IdentifierName|.
+ 1. Return the StringValue of |IdentifierName|.
LiteralPropertyName : StringLiteral
@@ -18533,7 +18523,7 @@
PropertyDefinition : IdentifierReference
- 1. Let _propName_ be StringValue of |IdentifierReference|.
+ 1. Let _propName_ be the StringValue of |IdentifierReference|.
1. Let _exprValue_ be ? Evaluation of |IdentifierReference|.
1. Let _propValue_ be ? GetValue(_exprValue_).
1. Assert: _object_ is an ordinary, extensible object with no non-configurable properties.
@@ -18605,11 +18595,11 @@
It determines if its argument is a valid regular expression literal.
- 1. Let _flags_ be FlagText of _literal_.
+ 1. Let _flags_ be the FlagText of _literal_.
1. If _flags_ contains any code points other than `d`, `g`, `i`, `m`, `s`, `u`, `v`, or `y`, or if _flags_ contains any code point more than once, return *false*.
1. If _flags_ contains `u`, let _u_ be *true*; else let _u_ be *false*.
1. If _flags_ contains `v`, let _v_ be *true*; else let _v_ be *false*.
- 1. Let _patternText_ be BodyText of _literal_.
+ 1. Let _patternText_ be the BodyText of _literal_.
1. If _u_ is *false* and _v_ is *false*, then
1. Let _stringValue_ be CodePointsToString(_patternText_).
1. Set _patternText_ to the sequence of code points resulting from interpreting each of the 16-bit elements of _stringValue_ as a Unicode BMP code point. UTF-16 decoding is not applied to the elements.
@@ -18665,7 +18655,7 @@
Static Semantics: Early Errors
- It is a Syntax Error if the number of elements in the result of TemplateStrings of |TemplateLiteral| with argument *false* is greater than or equal to 232.
+ It is a Syntax Error if the number of elements in the TemplateStrings of |TemplateLiteral| with argument *false* is greater than or equal to 232.
@@ -18714,7 +18704,7 @@
SubstitutionTemplate : TemplateHead Expression TemplateSpans
1. Let _head_ be « TemplateString(|TemplateHead|, _raw_) ».
- 1. Let _tail_ be TemplateStrings of |TemplateSpans| with argument _raw_.
+ 1. Let _tail_ be the TemplateStrings of |TemplateSpans| with argument _raw_.
1. Return the list-concatenation of _head_ and _tail_.
TemplateSpans : TemplateTail
@@ -18723,7 +18713,7 @@
TemplateSpans : TemplateMiddleList TemplateTail
- 1. Let _middle_ be TemplateStrings of |TemplateMiddleList| with argument _raw_.
+ 1. Let _middle_ be the TemplateStrings of |TemplateMiddleList| with argument _raw_.
1. Let _tail_ be « TemplateString(|TemplateTail|, _raw_) ».
1. Return the list-concatenation of _middle_ and _tail_.
@@ -18733,7 +18723,7 @@
TemplateMiddleList : TemplateMiddleList TemplateMiddle Expression
- 1. Let _front_ be TemplateStrings of |TemplateMiddleList| with argument _raw_.
+ 1. Let _front_ be the TemplateStrings of |TemplateMiddleList| with argument _raw_.
1. Let _last_ be « TemplateString(|TemplateMiddle|, _raw_) ».
1. Return the list-concatenation of _front_ and _last_.
@@ -18774,9 +18764,9 @@
1. For each element _e_ of _templateRegistry_, do
1. If _e_.[[Site]] is the same Parse Node as _templateLiteral_, then
1. Return _e_.[[Array]].
- 1. Let _rawStrings_ be TemplateStrings of _templateLiteral_ with argument *true*.
+ 1. Let _rawStrings_ be the TemplateStrings of _templateLiteral_ with argument *true*.
1. Assert: _rawStrings_ is a List of Strings.
- 1. Let _cookedStrings_ be TemplateStrings of _templateLiteral_ with argument *false*.
+ 1. Let _cookedStrings_ be the TemplateStrings of _templateLiteral_ with argument *false*.
1. Let _count_ be the number of elements in the List _cookedStrings_.
1. Assert: _count_ ≤ 232 - 1.
1. Let _template_ be ! ArrayCreate(_count_).
@@ -19080,7 +19070,7 @@
Property Accessors
|CallExpression| `[` <identifier-name-string> `]`
-
where <identifier-name-string> is the result of evaluating StringValue of |IdentifierName|.
+
where <identifier-name-string> is the StringValue of |IdentifierName|.
@@ -19089,14 +19079,14 @@
Runtime Semantics: Evaluation
1. Let _baseReference_ be ? Evaluation of |MemberExpression|.
1. Let _baseValue_ be ? GetValue(_baseReference_).
- 1. If the source text matched by this |MemberExpression| is strict mode code, let _strict_ be *true*; else let _strict_ be *false*.
+ 1. Let _strict_ be IsStrict(this |MemberExpression|).
1. Return ? EvaluatePropertyAccessWithExpressionKey(_baseValue_, |Expression|, _strict_).
MemberExpression : MemberExpression `.` IdentifierName
1. Let _baseReference_ be ? Evaluation of |MemberExpression|.
1. Let _baseValue_ be ? GetValue(_baseReference_).
- 1. If the source text matched by this |MemberExpression| is strict mode code, let _strict_ be *true*; else let _strict_ be *false*.
+ 1. Let _strict_ be IsStrict(this |MemberExpression|).
1. Return EvaluatePropertyAccessWithIdentifierKey(_baseValue_, |IdentifierName|, _strict_).
MemberExpression : MemberExpression `.` PrivateIdentifier
@@ -19110,14 +19100,14 @@
Runtime Semantics: Evaluation
1. Let _baseReference_ be ? Evaluation of |CallExpression|.
1. Let _baseValue_ be ? GetValue(_baseReference_).
- 1. If the source text matched by this |CallExpression| is strict mode code, let _strict_ be *true*; else let _strict_ be *false*.
+ 1. Let _strict_ be IsStrict(this |CallExpression|).
1. Return ? EvaluatePropertyAccessWithExpressionKey(_baseValue_, |Expression|, _strict_).
CallExpression : CallExpression `.` IdentifierName
1. Let _baseReference_ be ? Evaluation of |CallExpression|.
1. Let _baseValue_ be ? GetValue(_baseReference_).
- 1. If the source text matched by this |CallExpression| is strict mode code, let _strict_ be *true*; else let _strict_ be *false*.
+ 1. Let _strict_ be IsStrict(this |CallExpression|).
1. Return EvaluatePropertyAccessWithIdentifierKey(_baseValue_, |IdentifierName|, _strict_).
CallExpression : CallExpression `.` PrivateIdentifier
@@ -19159,7 +19149,7 @@
- 1. Let _propertyNameString_ be StringValue of _identifierName_.
+ 1. Let _propertyNameString_ be the StringValue of _identifierName_.
1. Return the Reference Record { [[Base]]: _baseValue_, [[ReferencedName]]: _propertyNameString_, [[Strict]]: _strict_, [[ThisValue]]: ~empty~ }.
@@ -19218,7 +19208,7 @@
Runtime Semantics: Evaluation
1. Let _argList_ be ? ArgumentListEvaluation of _arguments_.
1. If _argList_ has no elements, return *undefined*.
1. Let _evalArg_ be the first element of _argList_.
- 1. If the source text matched by this |CallExpression| is strict mode code, let _strictCaller_ be *true*. Otherwise let _strictCaller_ be *false*.
+ 1. If IsStrict(this |CallExpression|) is *true*, let _strictCaller_ be *true*. Otherwise let _strictCaller_ be *false*.
1. [id="step-callexpression-evaluation-direct-eval"] Return ? PerformEval(_evalArg_, _strictCaller_, *true*).
1. Let _thisCall_ be this |CallExpression|.
1. Let _tailCall_ be IsInTailPosition(_thisCall_).
@@ -19277,15 +19267,15 @@
Runtime Semantics: Evaluation
1. Let _propertyNameReference_ be ? Evaluation of |Expression|.
1. Let _propertyNameValue_ be ? GetValue(_propertyNameReference_).
1. Let _propertyKey_ be ? ToPropertyKey(_propertyNameValue_).
- 1. If the source text matched by this |SuperProperty| is strict mode code, let _strict_ be *true*; else let _strict_ be *false*.
+ 1. Let _strict_ be IsStrict(this |SuperProperty|).
1. Return ? MakeSuperPropertyReference(_actualThis_, _propertyKey_, _strict_).
SuperProperty : `super` `.` IdentifierName
1. Let _env_ be GetThisEnvironment().
1. Let _actualThis_ be ? _env_.GetThisBinding().
- 1. Let _propertyKey_ be StringValue of |IdentifierName|.
- 1. If the source text matched by this |SuperProperty| is strict mode code, let _strict_ be *true*; else let _strict_ be *false*.
+ 1. Let _propertyKey_ be the StringValue of |IdentifierName|.
+ 1. Let _strict_ be IsStrict(this |SuperProperty|).
1. Return ? MakeSuperPropertyReference(_actualThis_, _propertyKey_, _strict_).
SuperCall : `super` Arguments
@@ -19365,10 +19355,9 @@
Runtime Semantics: ArgumentListEvaluation ( ): either a normal completion co
1. Let _spreadObj_ be ? GetValue(_spreadRef_).
1. Let _iteratorRecord_ be ? GetIterator(_spreadObj_, ~sync~).
1. Repeat,
- 1. Let _next_ be ? IteratorStep(_iteratorRecord_).
- 1. If _next_ is *false*, return _list_.
- 1. Let _nextArg_ be ? IteratorValue(_next_).
- 1. Append _nextArg_ to _list_.
+ 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
+ 1. If _next_ is ~done~, return _list_.
+ 1. Append _next_ to _list_.
ArgumentList : ArgumentList `,` AssignmentExpression
@@ -19383,10 +19372,9 @@
Runtime Semantics: ArgumentListEvaluation ( ): either a normal completion co
1. Let _spreadRef_ be ? Evaluation of |AssignmentExpression|.
1. Let _iteratorRecord_ be ? GetIterator(? GetValue(_spreadRef_), ~sync~).
1. Repeat,
- 1. Let _next_ be ? IteratorStep(_iteratorRecord_).
- 1. If _next_ is *false*, return _precedingArgs_.
- 1. Let _nextArg_ be ? IteratorValue(_next_).
- 1. Append _nextArg_ to _precedingArgs_.
+ 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
+ 1. If _next_ is ~done~, return _precedingArgs_.
+ 1. Append _next_ to _precedingArgs_.
OptionalChain : `?.` `[` Expression `]`
- 1. If the source text matched by this |OptionalChain| is strict mode code, let _strict_ be *true*; else let _strict_ be *false*.
+ 1. Let _strict_ be IsStrict(this |OptionalChain|).
1. Return ? EvaluatePropertyAccessWithExpressionKey(_baseValue_, |Expression|, _strict_).
OptionalChain : `?.` IdentifierName
- 1. If the source text matched by this |OptionalChain| is strict mode code, let _strict_ be *true*; else let _strict_ be *false*.
+ 1. Let _strict_ be IsStrict(this |OptionalChain|).
1. Return EvaluatePropertyAccessWithIdentifierKey(_baseValue_, |IdentifierName|, _strict_).
OptionalChain : `?.` PrivateIdentifier
@@ -19497,7 +19485,7 @@
1. Let _optionalChain_ be |OptionalChain|.
1. Let _newReference_ be ? ChainEvaluation of _optionalChain_ with arguments _baseValue_ and _baseReference_.
1. Let _newValue_ be ? GetValue(_newReference_).
- 1. If the source text matched by this |OptionalChain| is strict mode code, let _strict_ be *true*; else let _strict_ be *false*.
+ 1. Let _strict_ be IsStrict(this |OptionalChain|).
1. Return ? EvaluatePropertyAccessWithExpressionKey(_newValue_, |Expression|, _strict_).
OptionalChain : OptionalChain `.` IdentifierName
@@ -19505,7 +19493,7 @@
1. Let _optionalChain_ be |OptionalChain|.
1. Let _newReference_ be ? ChainEvaluation of _optionalChain_ with arguments _baseValue_ and _baseReference_.
1. Let _newValue_ be ? GetValue(_newReference_).
- 1. If the source text matched by this |OptionalChain| is strict mode code, let _strict_ be *true*; else let _strict_ be *false*.
+ 1. Let _strict_ be IsStrict(this |OptionalChain|).
1. Return EvaluatePropertyAccessWithIdentifierKey(_newValue_, |IdentifierName|, _strict_).
OptionalChain : OptionalChain `.` PrivateIdentifier
@@ -19690,7 +19678,7 @@
Static Semantics: Early Errors
- It is an early Syntax Error if AssignmentTargetType of |LeftHandSideExpression| is not ~simple~.
+ It is an early Syntax Error if the AssignmentTargetType of |LeftHandSideExpression| is not ~simple~.
@@ -19701,7 +19689,7 @@
Static Semantics: Early Errors
- It is an early Syntax Error if AssignmentTargetType of |UnaryExpression| is not ~simple~.
+ It is an early Syntax Error if the AssignmentTargetType of |UnaryExpression| is not ~simple~.
@@ -19811,7 +19799,7 @@
Static Semantics: Early Errors
UnaryExpression : `delete` UnaryExpression
- It is a Syntax Error if the |UnaryExpression| is contained in strict mode code and the derived |UnaryExpression| is PrimaryExpression : IdentifierReference, MemberExpression : MemberExpression `.` PrivateIdentifier, CallExpression : CallExpression `.` PrivateIdentifier, OptionalChain : `?.` PrivateIdentifier, or OptionalChain : OptionalChain `.` PrivateIdentifier.
+ It is a Syntax Error if IsStrict(the |UnaryExpression|) is *true* and the derived |UnaryExpression| is PrimaryExpression : IdentifierReference, MemberExpression : MemberExpression `.` PrivateIdentifier, CallExpression : CallExpression `.` PrivateIdentifier, OptionalChain : `?.` PrivateIdentifier, or OptionalChain : OptionalChain `.` PrivateIdentifier.
If |LeftHandSideExpression| is either an |ObjectLiteral| or an |ArrayLiteral|, the following Early Error rules are applied:
- |LeftHandSideExpression| must cover an |AssignmentPattern|.
+ If |LeftHandSideExpression| is either an |ObjectLiteral| or an |ArrayLiteral|, |LeftHandSideExpression| must cover an |AssignmentPattern|.
-
-
If |LeftHandSideExpression| is neither an |ObjectLiteral| nor an |ArrayLiteral|, the following Early Error rule is applied:
-
- It is a Syntax Error if AssignmentTargetType of |LeftHandSideExpression| is not ~simple~.
+ If |LeftHandSideExpression| is neither an |ObjectLiteral| nor an |ArrayLiteral|, it is a Syntax Error if the AssignmentTargetType of |LeftHandSideExpression| is not ~simple~.
@@ -20491,7 +20475,7 @@
Static Semantics: Early Errors
- It is a Syntax Error if AssignmentTargetType of |LeftHandSideExpression| is not ~simple~.
+ It is a Syntax Error if the AssignmentTargetType of |LeftHandSideExpression| is not ~simple~.
- It is a Syntax Error if AssignmentTargetType of |IdentifierReference| is not ~simple~.
+ It is a Syntax Error if the AssignmentTargetType of |IdentifierReference| is not ~simple~.
If |LeftHandSideExpression| is either an |ObjectLiteral| or an |ArrayLiteral|, the following Early Error rules are applied:
- |LeftHandSideExpression| must cover an |AssignmentPattern|.
+ If |LeftHandSideExpression| is either an |ObjectLiteral| or an |ArrayLiteral|, |LeftHandSideExpression| must cover an |AssignmentPattern|.
-
-
If |LeftHandSideExpression| is neither an |ObjectLiteral| nor an |ArrayLiteral|, the following Early Error rule is applied:
-
- It is a Syntax Error if AssignmentTargetType of |LeftHandSideExpression| is not ~simple~.
+ If |LeftHandSideExpression| is neither an |ObjectLiteral| nor an |ArrayLiteral|, it is a Syntax Error if the AssignmentTargetType of |LeftHandSideExpression| is not ~simple~.
@@ -20861,10 +20841,10 @@
AssignmentProperty : IdentifierReference Initializer?
- 1. Let _P_ be StringValue of |IdentifierReference|.
+ 1. Let _P_ be the StringValue of |IdentifierReference|.
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 |Initializer| is present and _v_ is *undefined*, then
1. If IsAnonymousFunctionDefinition(|Initializer|) is *true*, then
1. Set _v_ to ? NamedEvaluation of |Initializer| with argument _P_.
1. Else,
@@ -20929,37 +20909,25 @@
Elision : `,`
1. If _iteratorRecord_.[[Done]] is *false*, then
- 1. Let _next_ be Completion(IteratorStep(_iteratorRecord_)).
- 1. If _next_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_next_).
- 1. If _next_ is *false*, set _iteratorRecord_.[[Done]] to *true*.
+ 1. Perform ? IteratorStep(_iteratorRecord_).
1. Return ~unused~.
Elision : Elision `,`
1. Perform ? IteratorDestructuringAssignmentEvaluation of |Elision| with argument _iteratorRecord_.
1. If _iteratorRecord_.[[Done]] is *false*, then
- 1. Let _next_ be Completion(IteratorStep(_iteratorRecord_)).
- 1. If _next_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_next_).
- 1. If _next_ is *false*, set _iteratorRecord_.[[Done]] to *true*.
+ 1. Perform ? IteratorStep(_iteratorRecord_).
1. Return ~unused~.
AssignmentElement : DestructuringAssignmentTarget Initializer?
1. If |DestructuringAssignmentTarget| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then
1. Let _lref_ be ? Evaluation of |DestructuringAssignmentTarget|.
+ 1. Let _value_ be *undefined*.
1. If _iteratorRecord_.[[Done]] is *false*, then
- 1. Let _next_ be Completion(IteratorStep(_iteratorRecord_)).
- 1. If _next_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_next_).
- 1. If _next_ is *false*, then
- 1. Set _iteratorRecord_.[[Done]] to *true*.
- 1. Else,
- 1. Let _value_ be Completion(IteratorValue(_next_)).
- 1. If _value_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_value_).
- 1. If _iteratorRecord_.[[Done]] is *true*, let _value_ be *undefined*.
+ 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
+ 1. If _next_ is not ~done~, then
+ 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]].
@@ -20983,16 +20951,9 @@
1. Let _A_ be ! ArrayCreate(0).
1. Let _n_ be 0.
1. Repeat, while _iteratorRecord_.[[Done]] is *false*,
- 1. Let _next_ be Completion(IteratorStep(_iteratorRecord_)).
- 1. If _next_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_next_).
- 1. If _next_ is *false*, then
- 1. Set _iteratorRecord_.[[Done]] to *true*.
- 1. Else,
- 1. Let _nextValue_ be Completion(IteratorValue(_next_)).
- 1. If _nextValue_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_nextValue_).
- 1. Perform ! CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_n_)), _nextValue_).
+ 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
+ 1. If _next_ is not ~done~, then
+ 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_).
@@ -21298,7 +21259,7 @@
Runtime Semantics: Evaluation
LexicalBinding : BindingIdentifier Initializer
- 1. Let _bindingId_ be StringValue of |BindingIdentifier|.
+ 1. Let _bindingId_ be the StringValue of |BindingIdentifier|.
1. Let _lhs_ be ! ResolveBinding(_bindingId_).
1. If IsAnonymousFunctionDefinition(|Initializer|) is *true*, then
1. Let _value_ be ? NamedEvaluation of |Initializer| with argument _bindingId_.
@@ -21355,7 +21316,7 @@
Runtime Semantics: Evaluation
VariableDeclaration : BindingIdentifier Initializer
- 1. Let _bindingId_ be StringValue of |BindingIdentifier|.
+ 1. Let _bindingId_ be the StringValue of |BindingIdentifier|.
1. Let _lhs_ be ? ResolveBinding(_bindingId_).
1. If IsAnonymousFunctionDefinition(|Initializer|) is *true*, then
1. Let _value_ be ? NamedEvaluation of |Initializer| with argument _bindingId_.
@@ -21502,7 +21463,7 @@
SingleNameBinding : BindingIdentifier Initializer?
- 1. Let _bindingId_ be StringValue of |BindingIdentifier|.
+ 1. Let _bindingId_ be the StringValue of |BindingIdentifier|.
1. Let _lhs_ be ? ResolveBinding(_bindingId_, _environment_).
1. Let _v_ be ? GetV(_value_, _propertyName_).
1. If |Initializer| is present and _v_ is *undefined*, then
@@ -21637,8 +21598,8 @@
- 1. If _completion_.[[Type]] is ~normal~, return *true*.
- 1. If _completion_.[[Type]] is not ~continue~, return *false*.
+ 1. If _completion_ is a normal completion, return *true*.
+ 1. If _completion_ is not a continue completion, return *false*.
1. If _completion_.[[Target]] is ~empty~, return *true*.
1. If _labelSet_ contains _completion_.[[Target]], return *true*.
1. Return *false*.
@@ -21952,16 +21913,12 @@
If |LeftHandSideExpression| is either an |ObjectLiteral| or an |ArrayLiteral|, the following Early Error rules are applied:
- |LeftHandSideExpression| must cover an |AssignmentPattern|.
+ If |LeftHandSideExpression| is either an |ObjectLiteral| or an |ArrayLiteral|, |LeftHandSideExpression| must cover an |AssignmentPattern|.
-
-
If |LeftHandSideExpression| is neither an |ObjectLiteral| nor an |ArrayLiteral|, the following Early Error rule is applied:
-
- It is a Syntax Error if AssignmentTargetType of |LeftHandSideExpression| is not ~simple~.
+ If |LeftHandSideExpression| is neither an |ObjectLiteral| nor an |ArrayLiteral|, it is a Syntax Error if the AssignmentTargetType of |LeftHandSideExpression| is not ~simple~.
@@ -22219,7 +22176,7 @@
1. Let _status_ be Completion(ForDeclarationBindingInitialization of _lhs_ with arguments _nextValue_ and _iterationEnv_).
1. Else,
1. Assert: _lhs_ binds a single name.
- 1. Let _lhsName_ be the sole element of BoundNames of _lhs_.
+ 1. Let _lhsName_ be the sole element of the BoundNames of _lhs_.
1. Let _lhsRef_ be ! ResolveBinding(_lhsName_).
1. Let _status_ be Completion(InitializeReferencedBinding(_lhsRef_, _nextValue_)).
1. If _status_ is an abrupt completion, then
@@ -22253,7 +22210,7 @@
Runtime Semantics: Evaluation
`await`
- 1. Let _bindingId_ be StringValue of |BindingIdentifier|.
+ 1. Let _bindingId_ be the StringValue of |BindingIdentifier|.
1. Return ? ResolveBinding(_bindingId_).
@@ -22271,7 +22228,7 @@
The iterator's `throw` and `return` methods are *null* and are never invoked. The iterator's `next` method processes object properties to determine whether the property key should be returned as an iterator value. Returned property keys do not include keys that are Symbols. Properties of the target object may be deleted during enumeration. A property that is deleted before it is processed by the iterator's `next` method is ignored. If new properties are added to the target object during enumeration, the newly added properties are not guaranteed to be processed in the active enumeration. A property name will be returned by the iterator's `next` method at most once in any enumeration.
Enumerating the properties of the target object includes enumerating properties of its prototype, and the prototype of the prototype, and so on, recursively; but a property of a prototype is not processed if it has the same name as a property that has already been processed by the iterator's `next` method. The values of [[Enumerable]] attributes are not considered when determining if a property of a prototype object has already been processed. The enumerable property names of prototype objects must be obtained by invoking EnumerateObjectProperties passing the prototype object as the argument. EnumerateObjectProperties must obtain the own property keys of the target object by calling its [[OwnPropertyKeys]] internal method. Property attributes of the target object must be obtained by calling its [[GetOwnProperty]] internal method.
-
In addition, if neither _O_ nor any object in its prototype chain is a Proxy exotic object, Integer-Indexed exotic object, module namespace exotic object, or implementation provided exotic object, then the iterator must behave as would the iterator given by CreateForInIterator(_O_) until one of the following occurs:
+
In addition, if neither _O_ nor any object in its prototype chain is a Proxy exotic object, TypedArray, module namespace exotic object, or implementation provided exotic object, then the iterator must behave as would the iterator given by CreateForInIterator(_O_) until one of the following occurs:
the value of the [[Prototype]] internal slot of _O_ or an object in its prototype chain changes,
a property is removed from _O_ or an object in its prototype chain,
@@ -22358,7 +22315,7 @@
%ForInIteratorPrototype%.next ( )
1. Repeat, while _O_.[[RemainingKeys]] is not empty,
1. Let _r_ be the first element of _O_.[[RemainingKeys]].
1. Remove the first element from _O_.[[RemainingKeys]].
- 1. If there does not exist an element _v_ of _O_.[[VisitedKeys]] such that SameValue(_r_, _v_) is *true*, then
+ 1. If _O_.[[VisitedKeys]] does not contain _r_, then
1. Let _desc_ be ? _object_.[[GetOwnProperty]](_r_).
1. If _desc_ is not *undefined*, then
1. Append _r_ to _O_.[[VisitedKeys]].
@@ -22556,7 +22513,7 @@
- It is a Syntax Error if the source text matched by this production is contained in strict mode code.
+ It is a Syntax Error if IsStrict(this production) is *true*.
It is a Syntax Error if IsLabelledFunction(|Statement|) is *true*.
@@ -22810,7 +22767,7 @@
BreakableStatement : IterationStatement
1. Let _stmtResult_ be Completion(LoopEvaluation of |IterationStatement| with argument _labelSet_).
- 1. If _stmtResult_.[[Type]] is ~break~, then
+ 1. If _stmtResult_ is a break completion, then
1. If _stmtResult_.[[Target]] is ~empty~, then
1. If _stmtResult_.[[Value]] is ~empty~, set _stmtResult_ to NormalCompletion(*undefined*).
1. Else, set _stmtResult_ to NormalCompletion(_stmtResult_.[[Value]]).
@@ -22819,7 +22776,7 @@
BreakableStatement : SwitchStatement
1. Let _stmtResult_ be Completion(Evaluation of |SwitchStatement|).
- 1. If _stmtResult_.[[Type]] is ~break~, then
+ 1. If _stmtResult_ is a break completion, then
1. If _stmtResult_.[[Target]] is ~empty~, then
1. If _stmtResult_.[[Value]] is ~empty~, set _stmtResult_ to NormalCompletion(*undefined*).
1. Else, set _stmtResult_ to NormalCompletion(_stmtResult_.[[Value]]).
@@ -22833,7 +22790,7 @@
1. Let _label_ be the StringValue of |LabelIdentifier|.
1. Let _newLabelSet_ be the list-concatenation of _labelSet_ and « _label_ ».
1. Let _stmtResult_ be Completion(LabelledEvaluation of |LabelledItem| with argument _newLabelSet_).
- 1. If _stmtResult_.[[Type]] is ~break~ and _stmtResult_.[[Target]] is _label_, then
+ 1. If _stmtResult_ is a break completion and _stmtResult_.[[Target]] is _label_, then
1. Set _stmtResult_ to NormalCompletion(_stmtResult_.[[Value]]).
1. Return ? _stmtResult_.
@@ -22913,7 +22870,7 @@
Static Semantics: Early Errors
Catch : `catch` `(` CatchParameter `)` Block
- It is a Syntax Error if BoundNames of |CatchParameter| contains any duplicate elements.
+ It is a Syntax Error if the BoundNames of |CatchParameter| contains any duplicate elements.
It is a Syntax Error if any element of the BoundNames of |CatchParameter| also occurs in the LexicallyDeclaredNames of |Block|.
@@ -22964,7 +22921,7 @@
Runtime Semantics: Evaluation
TryStatement : `try` Block Catch
1. Let _B_ be Completion(Evaluation of |Block|).
- 1. If _B_.[[Type]] is ~throw~, let _C_ be Completion(CatchClauseEvaluation of |Catch| with argument _B_.[[Value]]).
+ 1. If _B_ is a throw completion, let _C_ be Completion(CatchClauseEvaluation of |Catch| with argument _B_.[[Value]]).
1. Else, let _C_ be _B_.
1. Return ? UpdateEmpty(_C_, *undefined*).
@@ -22972,16 +22929,16 @@
Runtime Semantics: Evaluation
1. Let _B_ be Completion(Evaluation of |Block|).
1. Let _F_ be Completion(Evaluation of |Finally|).
- 1. If _F_.[[Type]] is ~normal~, set _F_ to _B_.
+ 1. If _F_ is a normal completion, set _F_ to _B_.
1. Return ? UpdateEmpty(_F_, *undefined*).
TryStatement : `try` Block Catch Finally
1. Let _B_ be Completion(Evaluation of |Block|).
- 1. If _B_.[[Type]] is ~throw~, let _C_ be Completion(CatchClauseEvaluation of |Catch| with argument _B_.[[Value]]).
+ 1. If _B_ is a throw completion, let _C_ be Completion(CatchClauseEvaluation of |Catch| with argument _B_.[[Value]]).
1. Else, let _C_ be _B_.
1. Let _F_ be Completion(Evaluation of |Finally|).
- 1. If _F_.[[Type]] is ~normal~, set _F_ to _C_.
+ 1. If _F_ is a normal completion, set _F_ to _C_.
1. Return ? UpdateEmpty(_F_, *undefined*).
@@ -23048,13 +23005,13 @@
Static Semantics: Early Errors
UniqueFormalParameters : FormalParameters
- It is a Syntax Error if BoundNames of |FormalParameters| contains any duplicate elements.
+ It is a Syntax Error if the BoundNames of |FormalParameters| contains any duplicate elements.
FormalParameters : FormalParameterList
- It is a Syntax Error if IsSimpleParameterList of |FormalParameterList| is *false* and BoundNames of |FormalParameterList| contains any duplicate elements.
+ It is a Syntax Error if IsSimpleParameterList of |FormalParameterList| is *false* and the BoundNames of |FormalParameterList| contains any duplicate elements.
@@ -23275,7 +23232,7 @@
Static Semantics: ExpectedArgumentCount ( ): an integer
FormalParameters : FormalParameterList `,` FunctionRestParameter
- 1. Return ExpectedArgumentCount of |FormalParameterList|.
+ 1. Return the ExpectedArgumentCount of |FormalParameterList|.
The ExpectedArgumentCount of a |FormalParameterList| is the number of |FormalParameters| to the left of either the rest parameter or the first |FormalParameter| with an Initializer. A |FormalParameter| without an initializer is allowed after the first parameter with an initializer but such parameters are considered to be optional with *undefined* as their default value.
@@ -23287,7 +23244,7 @@
Static Semantics: ExpectedArgumentCount ( ): an integer
FormalParameterList : FormalParameterList `,` FormalParameter
- 1. Let _count_ be ExpectedArgumentCount of |FormalParameterList|.
+ 1. Let _count_ be the ExpectedArgumentCount of |FormalParameterList|.
1. If HasInitializer of |FormalParameterList| is *true* or HasInitializer of |FormalParameter| is *true*, return _count_.
1. Return _count_ + 1.
@@ -23298,7 +23255,7 @@
Static Semantics: ExpectedArgumentCount ( ): an integer
ArrowParameters : CoverParenthesizedExpressionAndArrowParameterList
1. Let _formals_ be the |ArrowFormalParameters| that is covered by |CoverParenthesizedExpressionAndArrowParameterList|.
- 1. Return ExpectedArgumentCount of _formals_.
+ 1. Return the ExpectedArgumentCount of _formals_.
PropertySetParameterList : FormalParameter
@@ -23344,10 +23301,10 @@
Static Semantics: Early Errors
- If the source text matched by |FormalParameters| is strict mode code, the Early Error rules for UniqueFormalParameters : FormalParameters are applied.
+ If IsStrict(|FormalParameters|) is *true*, the Early Error rules for UniqueFormalParameters : FormalParameters are applied.
- If |BindingIdentifier| is present and the source text matched by |BindingIdentifier| is strict mode code, it is a Syntax Error if the StringValue of |BindingIdentifier| is either *"eval"* or *"arguments"*.
+ If |BindingIdentifier| is present and IsStrict(|BindingIdentifier|) is *true*, it is a Syntax Error if the StringValue of |BindingIdentifier| is either *"eval"* or *"arguments"*.
It is a Syntax Error if FunctionBodyContainsUseStrict of |FunctionBody| is *true* and IsSimpleParameterList of |FormalParameters| is *false*.
@@ -23428,7 +23385,7 @@
FunctionDeclaration : `function` BindingIdentifier `(` FormalParameters `)` `{` FunctionBody `}`
- 1. Let _name_ be StringValue of |BindingIdentifier|.
+ 1. Let _name_ be the StringValue of |BindingIdentifier|.
1. Let _sourceText_ be the source text matched by |FunctionDeclaration|.
1. Let _F_ be OrdinaryFunctionCreate(%Function.prototype%, _sourceText_, |FormalParameters|, |FunctionBody|, ~non-lexical-this~, _env_, _privateEnv_).
1. Perform SetFunctionName(_F_, _name_).
@@ -23470,7 +23427,7 @@
FunctionExpression : `function` BindingIdentifier `(` FormalParameters `)` `{` FunctionBody `}`
1. Assert: _name_ is not present.
- 1. Set _name_ to StringValue of |BindingIdentifier|.
+ 1. Set _name_ to the StringValue of |BindingIdentifier|.
1. Let _outerEnv_ be the running execution context's LexicalEnvironment.
1. Let _funcEnv_ be NewDeclarativeEnvironment(_outerEnv_).
1. Perform ! _funcEnv_.CreateImmutableBinding(_name_, *false*).
@@ -23668,7 +23625,7 @@
- It is a Syntax Error if BoundNames of |PropertySetParameterList| contains any duplicate elements.
+ It is a Syntax Error if the BoundNames of |PropertySetParameterList| contains any duplicate elements.
It is a Syntax Error if FunctionBodyContainsUseStrict of |FunctionBody| is *true* and IsSimpleParameterList of |PropertySetParameterList| is *false*.
@@ -23775,7 +23732,7 @@
- If the source text matched by |FormalParameters| is strict mode code, the Early Error rules for UniqueFormalParameters : FormalParameters are applied.
+ If IsStrict(|FormalParameters|) is *true*, the Early Error rules for UniqueFormalParameters : FormalParameters are applied.
- If |BindingIdentifier| is present and the source text matched by |BindingIdentifier| is strict mode code, it is a Syntax Error if the StringValue of |BindingIdentifier| is either *"eval"* or *"arguments"*.
+ If |BindingIdentifier| is present and IsStrict(|BindingIdentifier|) is *true*, it is a Syntax Error if the StringValue of |BindingIdentifier| is either *"eval"* or *"arguments"*.
It is a Syntax Error if FunctionBodyContainsUseStrict of |GeneratorBody| is *true* and IsSimpleParameterList of |FormalParameters| is *false*.
@@ -23972,7 +23929,7 @@
GeneratorDeclaration : `function` `*` BindingIdentifier `(` FormalParameters `)` `{` GeneratorBody `}`
- 1. Let _name_ be StringValue of |BindingIdentifier|.
+ 1. Let _name_ be the StringValue of |BindingIdentifier|.
1. Let _sourceText_ be the source text matched by |GeneratorDeclaration|.
1. Let _F_ be OrdinaryFunctionCreate(%GeneratorFunction.prototype%, _sourceText_, |FormalParameters|, |GeneratorBody|, ~non-lexical-this~, _env_, _privateEnv_).
1. Perform SetFunctionName(_F_, _name_).
@@ -24017,7 +23974,7 @@
GeneratorExpression : `function` `*` BindingIdentifier `(` FormalParameters `)` `{` GeneratorBody `}`
1. Assert: _name_ is not present.
- 1. Set _name_ to StringValue of |BindingIdentifier|.
+ 1. Set _name_ to the StringValue of |BindingIdentifier|.
1. Let _outerEnv_ be the running execution context's LexicalEnvironment.
1. Let _funcEnv_ be NewDeclarativeEnvironment(_outerEnv_).
1. Perform ! _funcEnv_.CreateImmutableBinding(_name_, *false*).
@@ -24062,7 +24019,7 @@
Runtime Semantics: Evaluation
1. Let _iterator_ be _iteratorRecord_.[[Iterator]].
1. Let _received_ be NormalCompletion(*undefined*).
1. Repeat,
- 1. If _received_.[[Type]] is ~normal~, then
+ 1. If _received_ is a normal completion, then
1. Let _innerResult_ be ? Call(_iteratorRecord_.[[NextMethod]], _iteratorRecord_.[[Iterator]], « _received_.[[Value]] »).
1. If _generatorKind_ is ~async~, set _innerResult_ to ? Await(_innerResult_).
1. If _innerResult_ is not an Object, throw a *TypeError* exception.
@@ -24071,7 +24028,7 @@
Runtime Semantics: Evaluation
1. Return ? IteratorValue(_innerResult_).
1. If _generatorKind_ is ~async~, set _received_ to Completion(AsyncGeneratorYield(? IteratorValue(_innerResult_))).
1. Else, set _received_ to Completion(GeneratorYield(_innerResult_)).
- 1. Else if _received_.[[Type]] is ~throw~, then
+ 1. Else if _received_ is a throw completion, then
1. Let _throw_ be ? GetMethod(_iterator_, *"throw"*).
1. If _throw_ is not *undefined*, then
1. Let _innerResult_ be ? Call(_throw_, _iterator_, « _received_.[[Value]] »).
@@ -24091,7 +24048,7 @@
Runtime Semantics: Evaluation
1. NOTE: The next step throws a *TypeError* to indicate that there was a `yield*` protocol violation: _iterator_ does not have a `throw` method.
1. Throw a *TypeError* exception.
1. Else,
- 1. Assert: _received_.[[Type]] is ~return~.
+ 1. Assert: _received_ is a return completion.
1. Let _return_ be ? GetMethod(_iterator_, *"return"*).
1. If _return_ is *undefined*, then
1. Set _value_ to _received_.[[Value]].
@@ -24154,8 +24111,8 @@
If the source text matched by |FormalParameters| is strict mode code, the Early Error rules for UniqueFormalParameters : FormalParameters are applied.
-
If |BindingIdentifier| is present and the source text matched by |BindingIdentifier| is strict mode code, it is a Syntax Error if the StringValue of |BindingIdentifier| is either *"eval"* or *"arguments"*.
+
If IsStrict(|FormalParameters|) is *true*, the Early Error rules for UniqueFormalParameters : FormalParameters are applied.
+
If |BindingIdentifier| is present and IsStrict(|BindingIdentifier|) is *true*, it is a Syntax Error if the StringValue of |BindingIdentifier| is either *"eval"* or *"arguments"*.
It is a Syntax Error if FunctionBodyContainsUseStrict of |AsyncGeneratorBody| is *true* and IsSimpleParameterList of |FormalParameters| is *false*.
It is a Syntax Error if any element of the BoundNames of |FormalParameters| also occurs in the LexicallyDeclaredNames of |AsyncGeneratorBody|.
It is a Syntax Error if |FormalParameters| Contains |YieldExpression| is *true*.
@@ -24201,7 +24158,7 @@
AsyncGeneratorDeclaration : `async` `function` `*` BindingIdentifier `(` FormalParameters `)` `{` AsyncGeneratorBody `}`
- 1. Let _name_ be StringValue of |BindingIdentifier|.
+ 1. Let _name_ be the StringValue of |BindingIdentifier|.
1. Let _sourceText_ be the source text matched by |AsyncGeneratorDeclaration|.
1. Let _F_ be OrdinaryFunctionCreate(%AsyncGeneratorFunction.prototype%, _sourceText_, |FormalParameters|, |AsyncGeneratorBody|, ~non-lexical-this~, _env_, _privateEnv_).
1. Perform SetFunctionName(_F_, _name_).
@@ -24252,7 +24209,7 @@
1. Assert: _name_ is not present.
- 1. Set _name_ to StringValue of |BindingIdentifier|.
+ 1. Set _name_ to the StringValue of |BindingIdentifier|.
1. Let _outerEnv_ be the running execution context's LexicalEnvironment.
1. Let _funcEnv_ be NewDeclarativeEnvironment(_outerEnv_).
1. Perform ! _funcEnv_.CreateImmutableBinding(_name_, *false*).
@@ -24340,7 +24297,7 @@
Static Semantics: Early Errors
It is a Syntax Error if |ClassHeritage| is not present and the following algorithm returns *true*:
- 1. Let _constructor_ be ConstructorMethod of |ClassBody|.
+ 1. Let _constructor_ be the ConstructorMethod of |ClassBody|.
1. If _constructor_ is ~empty~, return *false*.
1. Return HasDirectSuper of _constructor_.
@@ -24349,19 +24306,19 @@
Static Semantics: Early Errors
ClassBody : ClassElementList
- It is a Syntax Error if PrototypePropertyNameList of |ClassElementList| contains more than one occurrence of *"constructor"*.
+ It is a Syntax Error if the PrototypePropertyNameList of |ClassElementList| contains more than one occurrence of *"constructor"*.
- It is a Syntax Error if PrivateBoundIdentifiers of |ClassElementList| contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries, and the getter and setter are either both static or both non-static.
+ It is a Syntax Error if the PrivateBoundIdentifiers of |ClassElementList| contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries, and the getter and setter are either both static or both non-static.
ClassElement : MethodDefinition
- It is a Syntax Error if PropName of |MethodDefinition| is not *"constructor"* and HasDirectSuper of |MethodDefinition| is *true*.
+ It is a Syntax Error if the PropName of |MethodDefinition| is not *"constructor"* and HasDirectSuper of |MethodDefinition| is *true*.
- It is a Syntax Error if PropName of |MethodDefinition| is *"constructor"* and SpecialMethod of |MethodDefinition| is *true*.
+ It is a Syntax Error if the PropName of |MethodDefinition| is *"constructor"* and SpecialMethod of |MethodDefinition| is *true*.
It is a Syntax Error if HasDirectSuper of |MethodDefinition| is *true*.
- It is a Syntax Error if PropName of |MethodDefinition| is *"prototype"*.
+ It is a Syntax Error if the PropName of |MethodDefinition| is *"prototype"*.
ClassElement : FieldDefinition `;`
-
It is a Syntax Error if PropName of |FieldDefinition| is *"constructor"*.
+
It is a Syntax Error if the PropName of |FieldDefinition| is *"constructor"*.
ClassElement : `static` FieldDefinition `;`
- It is a Syntax Error if PropName of |FieldDefinition| is either *"prototype"* or *"constructor"*.
+ It is a Syntax Error if the PropName of |FieldDefinition| is either *"prototype"* or *"constructor"*.
@@ -24397,7 +24354,7 @@
Static Semantics: Early Errors
ClassElementName : PrivateIdentifier
-
It is a Syntax Error if StringValue of |PrivateIdentifier| is *"#constructor"*.
+
It is a Syntax Error if the StringValue of |PrivateIdentifier| is *"#constructor"*.
Static Semantics: ClassElementKind ( ): ~constructor-method~, ~non-construct
ClassElement : MethodDefinition
- 1. If PropName of |MethodDefinition| is *"constructor"*, return ~constructor-method~.
+ 1. If the PropName of |MethodDefinition| is *"constructor"*, return ~constructor-method~.
1. Return ~non-constructor-method~.
@@ -24463,14 +24420,14 @@
Static Semantics: ConstructorMethod ( ): a |ClassElement| Parse Node or ~emp
ClassElementList : ClassElement
- 1. If ClassElementKind of |ClassElement| is ~constructor-method~, return |ClassElement|.
+ 1. If the ClassElementKind of |ClassElement| is ~constructor-method~, return |ClassElement|.
1. Return ~empty~.
ClassElementList : ClassElementList ClassElement
- 1. Let _head_ be ConstructorMethod of |ClassElementList|.
+ 1. Let _head_ be the ConstructorMethod of |ClassElementList|.
1. If _head_ is not ~empty~, return _head_.
- 1. If ClassElementKind of |ClassElement| is ~constructor-method~, return |ClassElement|.
+ 1. If the ClassElementKind of |ClassElement| is ~constructor-method~, return |ClassElement|.
1. Return ~empty~.
@@ -24514,14 +24471,14 @@
Static Semantics: NonConstructorElements ( ): a List of |ClassElement| Parse
ClassElementList : ClassElement
- 1. If ClassElementKind of |ClassElement| is ~non-constructor-method~, then
+ 1. If the ClassElementKind of |ClassElement| is ~non-constructor-method~, then
1. Return « |ClassElement| ».
1. Return a new empty List.
ClassElementList : ClassElementList ClassElement
- 1. Let _list_ be NonConstructorElements of |ClassElementList|.
- 1. If ClassElementKind of |ClassElement| is ~non-constructor-method~, then
+ 1. Let _list_ be the NonConstructorElements of |ClassElementList|.
+ 1. If the ClassElementKind of |ClassElement| is ~non-constructor-method~, then
1. Append |ClassElement| to the end of _list_.
1. Return _list_.
@@ -24533,15 +24490,15 @@
Static Semantics: PrototypePropertyNameList ( ): a List of property keys
ClassElementList : ClassElement
- 1. Let _propName_ be PropName of |ClassElement|.
+ 1. Let _propName_ be the PropName of |ClassElement|.
1. If _propName_ is ~empty~, return a new empty List.
1. If IsStatic of |ClassElement| is *true*, return a new empty List.
1. Return « _propName_ ».
ClassElementList : ClassElementList ClassElement
- 1. Let _list_ be PrototypePropertyNameList of |ClassElementList|.
- 1. Let _propName_ be PropName of |ClassElement|.
+ 1. Let _list_ be the PrototypePropertyNameList of |ClassElementList|.
+ 1. Let _propName_ be the PropName of |ClassElement|.
1. If _propName_ is ~empty~, return _list_.
1. If IsStatic of |ClassElement| is *true*, return _list_.
1. Return the list-concatenation of _list_ and « _propName_ ».
@@ -24593,7 +24550,7 @@
ClassBody : ClassElementList
- 1. Let _newNames_ be the list-concatenation of _names_ and PrivateBoundIdentifiers of |ClassBody|.
+ 1. Let _newNames_ be the list-concatenation of _names_ and the PrivateBoundIdentifiers of |ClassBody|.
1. Return AllPrivateIdentifiersValid of |ClassElementList| with argument _newNames_.
@@ -24613,7 +24570,7 @@
Static Semantics: PrivateBoundIdentifiers ( ): a List of Strings
FieldDefinition : ClassElementName Initializer?
- 1. Return PrivateBoundIdentifiers of |ClassElementName|.
+ 1. Return the PrivateBoundIdentifiers of |ClassElementName|.
@@ -24639,8 +24596,8 @@
Static Semantics: PrivateBoundIdentifiers ( ): a List of Strings
ClassElementList : ClassElementList ClassElement
- 1. Let _names1_ be PrivateBoundIdentifiers of |ClassElementList|.
- 1. Let _names2_ be PrivateBoundIdentifiers of |ClassElement|.
+ 1. Let _names1_ be the PrivateBoundIdentifiers of |ClassElementList|.
+ 1. Let _names2_ be the PrivateBoundIdentifiers of |ClassElement|.
1. Return the list-concatenation of _names1_ and _names2_.
@@ -24660,7 +24617,7 @@
Static Semantics: PrivateBoundIdentifiers ( ): a List of Strings
`async` `*` ClassElementName `(` UniqueFormalParameters `)` `{` AsyncGeneratorBody `}`
- 1. Return PrivateBoundIdentifiers of |ClassElementName|.
+ 1. Return the PrivateBoundIdentifiers of |ClassElementName|.
@@ -24751,7 +24708,7 @@
1. Let _name_ be ? Evaluation of |ClassElementName|.
- 1. If |Initializer?| is present, then
+ 1. If |Initializer| is present, then
1. Let _formalParameterList_ be an instance of the production FormalParameters : [empty].
1. Let _env_ be the LexicalEnvironment of the running execution context.
1. Let _privateEnv_ be the running execution context's PrivateEnvironment.
@@ -24782,7 +24739,7 @@
1. Let _privateEnv_ be the running execution context's PrivateEnvironment.
1. Let _sourceText_ be the empty sequence of Unicode code points.
1. Let _formalParameters_ be an instance of the production FormalParameters : [empty].
- 1. Let _bodyFunction_ be OrdinaryFunctionCreate(%Function.prototype%, _sourceText_, _formalParameters_, |ClassStaticBlockBody|, ~non-lexical-this~, _lex_, _privateEnv_).
+ 1. [id="step-synthetic-class-static-block-fn"] Let _bodyFunction_ be OrdinaryFunctionCreate(%Function.prototype%, _sourceText_, _formalParameters_, |ClassStaticBlockBody|, ~non-lexical-this~, _lex_, _privateEnv_).
1. Perform MakeMethod(_bodyFunction_, _homeObject_).
1. Return the ClassStaticBlockDefinition Record { [[BodyFunction]]: _bodyFunction_ }.
@@ -24799,7 +24756,8 @@
ClassStaticBlockBody : ClassStaticBlockStatementList
- 1. Perform ? FunctionDeclarationInstantiation(_functionObject_, « »).
+ 1. Assert: _functionObject_ is a synthetic function created by ClassStaticBlockDefinitionEvaluation step .
+ 1. Perform ! FunctionDeclarationInstantiation(_functionObject_, « »).
1. Return ? Evaluation of |ClassStaticBlockStatementList|.
@@ -24833,7 +24791,7 @@
ClassElement : ClassStaticBlock
- 1. Return ClassStaticBlockDefinitionEvaluation of |ClassStaticBlock| with argument _object_.
+ 1. Return the ClassStaticBlockDefinitionEvaluation of |ClassStaticBlock| with argument _object_.
@@ -24866,14 +24824,14 @@
1. Perform ! _classEnv_.CreateImmutableBinding(_classBinding_, *true*).
1. Let _outerPrivateEnvironment_ be the running execution context's PrivateEnvironment.
1. Let _classPrivateEnvironment_ be NewPrivateEnvironment(_outerPrivateEnvironment_).
- 1. If |ClassBody?| is present, then
- 1. For each String _dn_ of the PrivateBoundIdentifiers of |ClassBody?|, do
+ 1. If |ClassBody| is present, then
+ 1. For each String _dn_ of the PrivateBoundIdentifiers of |ClassBody|, do
1. If _classPrivateEnvironment_.[[Names]] contains a Private Name _pn_ such that _pn_.[[Description]] is _dn_, then
1. Assert: This is only possible for getter/setter pairs.
1. Else,
1. Let _name_ be a new Private Name whose [[Description]] is _dn_.
1. Append _name_ to _classPrivateEnvironment_.[[Names]].
- 1. If |ClassHeritage?| is not present, then
+ 1. If |ClassHeritage| is not present, then
1. Let _protoParent_ be %Object.prototype%.
1. Let _constructorParent_ be %Function.prototype%.
1. Else,
@@ -24892,8 +24850,8 @@
1. If _protoParent_ is not an Object and _protoParent_ is not *null*, throw a *TypeError* exception.
1. Let _constructorParent_ be _superclass_.
1. Let _proto_ be OrdinaryObjectCreate(_protoParent_).
- 1. If |ClassBody?| is not present, let _constructor_ be ~empty~.
- 1. Else, let _constructor_ be ConstructorMethod of |ClassBody|.
+ 1. If |ClassBody| is not present, let _constructor_ be ~empty~.
+ 1. Else, let _constructor_ be the ConstructorMethod of |ClassBody|.
1. Set the running execution context's LexicalEnvironment to _classEnv_.
1. Set the running execution context's PrivateEnvironment to _classPrivateEnvironment_.
1. If _constructor_ is ~empty~, then
@@ -24918,10 +24876,10 @@
1. Perform MakeClassConstructor(_F_).
1. Perform SetFunctionName(_F_, _className_).
1. Perform MakeConstructor(_F_, *false*, _proto_).
- 1. If |ClassHeritage?| is present, set _F_.[[ConstructorKind]] to ~derived~.
- 1. Perform CreateMethodProperty(_proto_, *"constructor"*, _F_).
- 1. If |ClassBody?| is not present, let _elements_ be a new empty List.
- 1. Else, let _elements_ be NonConstructorElements of |ClassBody|.
+ 1. If |ClassHeritage| is present, set _F_.[[ConstructorKind]] to ~derived~.
+ 1. Perform ! DefineMethodProperty(_proto_, *"constructor"*, _F_, *false*).
+ 1. If |ClassBody| is not present, let _elements_ be a new empty List.
+ 1. Else, let _elements_ be the NonConstructorElements of |ClassBody|.
1. Let _instancePrivateMethods_ be a new empty List.
1. Let _staticPrivateMethods_ be a new empty List.
1. Let _instanceFields_ be a new empty List.
@@ -24935,7 +24893,7 @@
1. Set the running execution context's LexicalEnvironment to _env_.
1. Set the running execution context's PrivateEnvironment to _outerPrivateEnvironment_.
1. Return ? _element_.
- 1. Set _element_ to _element_.[[Value]].
+ 1. Set _element_ to ! _element_.
1. If _element_ is a PrivateElement, then
1. Assert: _element_.[[Kind]] is either ~method~ or ~accessor~.
1. If IsStatic of _e_ is *false*, let _container_ be _instancePrivateMethods_.
@@ -24981,7 +24939,7 @@
Runtime Semantics: BindingClassDeclarationEvaluation ( ): either a normal co
ClassDeclaration : `class` BindingIdentifier ClassTail
- 1. Let _className_ be StringValue of |BindingIdentifier|.
+ 1. Let _className_ be the StringValue of |BindingIdentifier|.
1. Let _value_ be ? ClassDefinitionEvaluation of |ClassTail| with arguments _className_ and _className_.
1. Set _value_.[[SourceText]] to the source text matched by |ClassDeclaration|.
1. Let _env_ be the running execution context's LexicalEnvironment.
@@ -25017,14 +24975,14 @@
Runtime Semantics: Evaluation
ClassExpression : `class` BindingIdentifier ClassTail
- 1. Let _className_ be StringValue of |BindingIdentifier|.
+ 1. Let _className_ be the StringValue of |BindingIdentifier|.
1. Let _value_ be ? ClassDefinitionEvaluation of |ClassTail| with arguments _className_ and _className_.
1. Set _value_.[[SourceText]] to the source text matched by |ClassExpression|.
1. Return _value_.
ClassElementName : PrivateIdentifier
- 1. Let _privateIdentifier_ be StringValue of |PrivateIdentifier|.
+ 1. Let _privateIdentifier_ be the StringValue of |PrivateIdentifier|.
1. Let _privateEnvRec_ be the running execution context's PrivateEnvironment.
1. Let _names_ be _privateEnvRec_.[[Names]].
1. Assert: Exactly one element of _names_ is a Private Name whose [[Description]] is _privateIdentifier_.
@@ -25099,8 +25057,8 @@
Static Semantics: Early Errors
It is a Syntax Error if FunctionBodyContainsUseStrict of |AsyncFunctionBody| is *true* and IsSimpleParameterList of |FormalParameters| is *false*.
It is a Syntax Error if |FormalParameters| Contains |AwaitExpression| is *true*.
-
If the source text matched by |FormalParameters| is strict mode code, the Early Error rules for UniqueFormalParameters : FormalParameters are applied.
-
If |BindingIdentifier| is present and the source text matched by |BindingIdentifier| is strict mode code, it is a Syntax Error if the StringValue of |BindingIdentifier| is either *"eval"* or *"arguments"*.
+
If IsStrict(|FormalParameters|) is *true*, the Early Error rules for UniqueFormalParameters : FormalParameters are applied.
+
If |BindingIdentifier| is present and IsStrict(|BindingIdentifier|) is *true*, it is a Syntax Error if the StringValue of |BindingIdentifier| is either *"eval"* or *"arguments"*.
It is a Syntax Error if any element of the BoundNames of |FormalParameters| also occurs in the LexicallyDeclaredNames of |AsyncFunctionBody|.
It is a Syntax Error if |FormalParameters| Contains |SuperProperty| is *true*.
It is a Syntax Error if |AsyncFunctionBody| Contains |SuperProperty| is *true*.
- 1. Let _name_ be StringValue of |BindingIdentifier|.
+ 1. Let _name_ be the StringValue of |BindingIdentifier|.
1. Let _sourceText_ be the source text matched by |AsyncFunctionDeclaration|.
1. Let _F_ be OrdinaryFunctionCreate(%AsyncFunction.prototype%, _sourceText_, |FormalParameters|, |AsyncFunctionBody|, ~non-lexical-this~, _env_, _privateEnv_).
1. Perform SetFunctionName(_F_, _name_).
@@ -25164,7 +25122,7 @@
1. Assert: _name_ is not present.
- 1. Set _name_ to StringValue of |BindingIdentifier|.
+ 1. Set _name_ to the StringValue of |BindingIdentifier|.
1. Let _outerEnv_ be the LexicalEnvironment of the running execution context.
1. Let _funcEnv_ be NewDeclarativeEnvironment(_outerEnv_).
1. Perform ! _funcEnv_.CreateImmutableBinding(_name_, *false*).
@@ -25372,7 +25330,7 @@
- 1. If the source text matched by _call_ is non-strict code, return *false*.
+ 1. If IsStrict(_call_) is *false*, return *false*.
1. If _call_ is not contained within a |FunctionBody|, a |ConciseBody|, or an |AsyncConciseBody|, return *false*.
1. Let _body_ be the |FunctionBody|, |ConciseBody|, or |AsyncConciseBody| that most closely contains _call_.
1. If _body_ is the |FunctionBody| of a |GeneratorBody|, return *false*.
@@ -25786,8 +25744,8 @@
Static Semantics: Early Errors
-
-
Static Semantics: IsStrict ( ): a Boolean
+
+
Static Semantics: ScriptIsStrict ( ): a Boolean
Script : ScriptBody?
@@ -25829,10 +25787,10 @@
Script Records
[[Realm]]
- a Realm Record or *undefined*
+ a Realm Record
- The realm within which this script was created. *undefined* if not yet assigned.
+ The realm within which this script was created.
@@ -25876,7 +25834,7 @@
Script Records
ParseScript (
_sourceText_: ECMAScript source text,
- _realm_: a Realm Record or *undefined*,
+ _realm_: a Realm Record,
_hostDefined_: anything,
): a Script Record or a non-empty List of *SyntaxError* objects
@@ -25917,9 +25875,9 @@
1. Push _scriptContext_ onto the execution context stack; _scriptContext_ is now the running execution context.
1. Let _script_ be _scriptRecord_.[[ECMAScriptCode]].
1. Let _result_ be Completion(GlobalDeclarationInstantiation(_script_, _globalEnv_)).
- 1. If _result_.[[Type]] is ~normal~, then
+ 1. If _result_ is a normal completion, then
1. Set _result_ to Completion(Evaluation of _script_).
- 1. If _result_.[[Type]] is ~normal~ and _result_.[[Value]] is ~empty~, then
+ 1. If _result_ is a normal completion and _result_.[[Value]] is ~empty~, then
1. Set _result_ to NormalCompletion(*undefined*).
1. Suspend _scriptContext_ and remove it from the execution context stack.
1. Assert: The execution context stack is not empty.
@@ -26073,7 +26031,7 @@
Static Semantics: Early Errors
ModuleExportName : StringLiteral
-
It is a Syntax Error if IsStringWellFormedUnicode(the SV of |StringLiteral|) is *false*.
+
It is a Syntax Error if IsStringWellFormedUnicode(SV of |StringLiteral|) is *false*.
@@ -26105,12 +26063,12 @@
Static Semantics: ModuleRequests ( ): a List of Strings
ModuleItemList : ModuleItem
- 1. Return ModuleRequests of |ModuleItem|.
+ 1. Return the ModuleRequests of |ModuleItem|.
ModuleItemList : ModuleItemList ModuleItem
- 1. Let _moduleNames_ be ModuleRequests of |ModuleItemList|.
- 1. Let _additionalNames_ be ModuleRequests of |ModuleItem|.
+ 1. Let _moduleNames_ be the ModuleRequests of |ModuleItemList|.
+ 1. Let _additionalNames_ be the ModuleRequests of |ModuleItem|.
1. For each String _name_ of _additionalNames_, do
1. If _moduleNames_ does not contain _name_, then
1. Append _name_ to _moduleNames_.
@@ -26122,7 +26080,7 @@
Static Semantics: ModuleRequests ( ): a List of Strings
ImportDeclaration : `import` ImportClause FromClause `;`
- 1. Return ModuleRequests of |FromClause|.
+ 1. Return the ModuleRequests of |FromClause|.
ModuleSpecifier : StringLiteral
@@ -26714,7 +26672,7 @@
Evaluate ( ): a Promise
1. Set _m_.[[Status]] to ~evaluated~.
1. Set _m_.[[EvaluationError]] to _result_.
1. Assert: _module_.[[Status]] is ~evaluated~.
- 1. Assert: _module_.[[EvaluationError]] is _result_.
+ 1. Assert: _module_.[[EvaluationError]] and _result_ are the same Completion Record.
1. Perform ! Call(_capability_.[[Reject]], *undefined*, « _result_.[[Value]] »).
1. Else,
1. Assert: _module_.[[Status]] is either ~evaluating-async~ or ~evaluated~.
@@ -26873,7 +26831,7 @@
1. Set _module_.[[AsyncEvaluation]] to *false*.
1. Set _module_.[[Status]] to ~evaluated~.
1. If _module_.[[TopLevelCapability]] is not ~empty~, then
- 1. Assert: _module_.[[CycleRoot]] is _module_.
+ 1. Assert: _module_.[[CycleRoot]] and _module_ are the same Module Record.
1. Perform ! Call(_module_.[[TopLevelCapability]].[[Resolve]], *undefined*, « *undefined* »).
1. Let _execList_ be a new empty List.
1. Perform GatherAvailableAncestors(_module_, _execList_).
@@ -26891,7 +26849,7 @@
1. Else,
1. Set _m_.[[Status]] to ~evaluated~.
1. If _m_.[[TopLevelCapability]] is not ~empty~, then
- 1. Assert: _m_.[[CycleRoot]] is _m_.
+ 1. Assert: _m_.[[CycleRoot]] and _m_ are the same Module Record.
1. Perform ! Call(_m_.[[TopLevelCapability]].[[Resolve]], *undefined*, « *undefined* »).
1. Return ~unused~.
@@ -26918,7 +26876,7 @@
1. For each Cyclic Module Record _m_ of _module_.[[AsyncParentModules]], do
1. Perform AsyncModuleExecutionRejected(_m_, _error_).
1. If _module_.[[TopLevelCapability]] is not ~empty~, then
- 1. Assert: _module_.[[CycleRoot]] is _module_.
+ 1. Assert: _module_.[[CycleRoot]] and _module_ are the same Module Record.
1. Perform ! Call(_module_.[[TopLevelCapability]].[[Reject]], *undefined*, « _error_ »).
1. Return ~unused~.
@@ -26981,7 +26939,7 @@
Example Cyclic Module Record Graphs
Calling _A_.Evaluate() calls InnerModuleEvaluation on _A_, _B_, and _D_, which all transition to ~evaluating~. Then InnerModuleEvaluation is called on _A_ again, which is a no-op because it is already ~evaluating~. At this point, _D_.[[PendingAsyncDependencies]] is 0, so ExecuteAsyncModule(_D_) is called and we call _D_.ExecuteModule with a new PromiseCapability tracking the asynchronous execution of _D_. We unwind back to the InnerModuleEvaluation on _B_, setting _B_.[[PendingAsyncDependencies]] to 1 and _B_.[[AsyncEvaluation]] to *true*. We unwind back to the original InnerModuleEvaluation on _A_, setting _A_.[[PendingAsyncDependencies]] to 1. In the next iteration of the loop over _A_'s dependencies, we call InnerModuleEvaluation on _C_ and thus on _D_ (again a no-op) and _E_. As _E_ has no dependencies and is not part of a cycle, we call ExecuteAsyncModule(_E_) in the same manner as _D_ and _E_ is immediately removed from the stack. We unwind once more to the original InnerModuleEvaluation on _A_, setting _C_.[[AsyncEvaluation]] to *true*. Now we finish the loop over _A_'s dependencies, set _A_.[[AsyncEvaluation]] to *true*, and remove the entire strongly connected component from the stack, transitioning all of the modules to ~evaluating-async~ at once. At this point, the fields of the modules are as given in .
-
+
@@ -27014,7 +26972,7 @@
Example Cyclic Module Record Graphs
_C_
-
2
+
3
0
~evaluating-async~
*true*
@@ -27023,7 +26981,7 @@
Example Cyclic Module Record Graphs
_D_
-
3
+
2
0
~evaluating-async~
*true*
@@ -27044,7 +27002,7 @@
Example Cyclic Module Record Graphs
Let us assume that _E_ finishes executing first. When that happens, AsyncModuleExecutionFulfilled is called, _E_.[[Status]] is set to ~evaluated~ and _C_.[[PendingAsyncDependencies]] is decremented to become 1. The fields of the updated modules are as given in .
-
+
@@ -27059,7 +27017,7 @@
Example Cyclic Module Record Graphs
_C_
-
2
+
3
0
~evaluating-async~
*true*
@@ -27080,7 +27038,7 @@
Example Cyclic Module Record Graphs
_D_ is next to finish (as it was the only module that was still executing). When that happens, AsyncModuleExecutionFulfilled is called again and _D_.[[Status]] is set to ~evaluated~. Then _B_.[[PendingAsyncDependencies]] is decremented to become 0, ExecuteAsyncModule is called on _B_, and it starts executing. _C_.[[PendingAsyncDependencies]] is also decremented to become 0, and _C_ starts executing (potentially in parallel to _B_ if _B_ contains an `await`). The fields of the updated modules are as given in .
-
+
@@ -27104,7 +27062,7 @@
Example Cyclic Module Record Graphs
_C_
-
2
+
3
0
~evaluating-async~
*true*
@@ -27113,7 +27071,7 @@
Example Cyclic Module Record Graphs
_D_
-
3
+
2
0
~evaluated~
*true*
@@ -27125,7 +27083,7 @@
Example Cyclic Module Record Graphs
Let us assume that _C_ finishes executing next. When that happens, AsyncModuleExecutionFulfilled is called again, _C_.[[Status]] is set to ~evaluated~ and _A_.[[PendingAsyncDependencies]] is decremented to become 1. The fields of the updated modules are as given in .
-
+
@@ -27149,7 +27107,7 @@
Example Cyclic Module Record Graphs
_C_
-
2
+
3
0
~evaluated~
*true*
@@ -27161,7 +27119,7 @@
Example Cyclic Module Record Graphs
Then, _B_ finishes executing. When that happens, AsyncModuleExecutionFulfilled is called again and _B_.[[Status]] is set to ~evaluated~. _A_.[[PendingAsyncDependencies]] is decremented to become 0, so ExecuteAsyncModule is called and it starts executing. The fields of the updated modules are as given in .
-
+
@@ -27197,7 +27155,7 @@
Example Cyclic Module Record Graphs
Finally, _A_ finishes executing. When that happens, AsyncModuleExecutionFulfilled is called again and _A_.[[Status]] is set to ~evaluated~. At this point, the Promise in _A_.[[TopLevelCapability]] (which was returned from _A_.Evaluate()) is resolved, and this concludes the handling of this module graph. The fields of the updated module are as given in .
-
+
@@ -27224,7 +27182,7 @@
Example Cyclic Module Record Graphs
Alternatively, consider a failure case where _C_ fails execution and returns an error before _B_ has finished executing. When that happens, AsyncModuleExecutionRejected is called, which sets _C_.[[Status]] to ~evaluated~ and _C_.[[EvaluationError]] to the error. It then propagates this error to all of the AsyncParentModules by performing AsyncModuleExecutionRejected on each of them. The fields of the updated modules are as given in .
-
+
@@ -27250,8 +27208,8 @@
Example Cyclic Module Record Graphs
_C_
-
2
-
1
+
3
+
0
~evaluated~
*true*
« _A_ »
@@ -27263,7 +27221,7 @@
Example Cyclic Module Record Graphs
_A_ will be rejected with the same error as _C_ since _C_ will call AsyncModuleExecutionRejected on _A_ with _C_'s error. _A_.[[Status]] is set to ~evaluated~. At this point the Promise in _A_.[[TopLevelCapability]] (which was returned from _A_.Evaluate()) is rejected. The fields of the updated module are as given in .
-
+
@@ -27292,7 +27250,7 @@
Example Cyclic Module Record Graphs
Then, _B_ finishes executing without an error. When that happens, AsyncModuleExecutionFulfilled is called again and _B_.[[Status]] is set to ~evaluated~. GatherAvailableAncestors is called on _B_. However, _A_.[[CycleRoot]] is _A_ which has an evaluation error, so it will not be added to the returned _sortedExecList_ and AsyncModuleExecutionFulfilled will return without further processing. Any future importer of _B_ will resolve the rejection of _B_.[[CycleRoot]].[[EvaluationError]] from the evaluation error from _C_ that was set on the cycle root _A_. The fields of the updated modules are as given in .
-
+
@@ -27480,7 +27438,7 @@
Source Text Module Records
-
+
gives examples of ImportEntry records fields used to represent the syntactic import forms:
@@ -27625,7 +27583,7 @@
Source Text Module Records
-
+
gives examples of the ExportEntry record fields used to represent the syntactic export forms:
@@ -27837,12 +27795,12 @@
1. Let _body_ be ParseText(_sourceText_, |Module|).
1. If _body_ is a List of errors, return _body_.
1. Let _requestedModules_ be the ModuleRequests of _body_.
- 1. Let _importEntries_ be ImportEntries of _body_.
+ 1. Let _importEntries_ be the ImportEntries of _body_.
1. Let _importedBoundNames_ be ImportedLocalNames(_importEntries_).
1. Let _indirectExportEntries_ be a new empty List.
1. Let _localExportEntries_ be a new empty List.
1. Let _starExportEntries_ be a new empty List.
- 1. Let _exportEntries_ be ExportEntries of _body_.
+ 1. Let _exportEntries_ be the ExportEntries of _body_.
1. For each ExportEntry Record _ee_ of _exportEntries_, do
1. If _ee_.[[ModuleRequest]] is *null*, then
1. If _importedBoundNames_ does not contain _ee_.[[LocalName]], then
@@ -27899,7 +27857,7 @@
1. Let _requestedModule_ be GetImportedModule(_module_, _e_.[[ModuleRequest]]).
1. Let _starNames_ be _requestedModule_.GetExportedNames(_exportStarSet_).
1. For each element _n_ of _starNames_, do
- 1. If SameValue(_n_, *"default"*) is *false*, then
+ 1. If _n_ is not *"default"*, then
1. If _exportedNames_ does not contain _n_, then
1. Append _n_ to _exportedNames_.
1. Return _exportedNames_.
@@ -27931,16 +27889,16 @@
1. Assert: _module_.[[Status]] is not ~new~.
1. If _resolveSet_ is not present, set _resolveSet_ to a new empty List.
1. For each Record { [[Module]], [[ExportName]] } _r_ of _resolveSet_, do
- 1. If _module_ and _r_.[[Module]] are the same Module Record and SameValue(_exportName_, _r_.[[ExportName]]) is *true*, then
+ 1. If _module_ and _r_.[[Module]] are the same Module Record and _exportName_ is _r_.[[ExportName]], then
1. Assert: This is a circular import request.
1. Return *null*.
1. Append the Record { [[Module]]: _module_, [[ExportName]]: _exportName_ } to _resolveSet_.
1. For each ExportEntry Record _e_ of _module_.[[LocalExportEntries]], do
- 1. If SameValue(_exportName_, _e_.[[ExportName]]) is *true*, then
+ 1. If _e_.[[ExportName]] is _exportName_, then
1. Assert: _module_ provides the direct binding for this export.
1. Return ResolvedBinding Record { [[Module]]: _module_, [[BindingName]]: _e_.[[LocalName]] }.
1. For each ExportEntry Record _e_ of _module_.[[IndirectExportEntries]], do
- 1. If SameValue(_exportName_, _e_.[[ExportName]]) is *true*, then
+ 1. If _e_.[[ExportName]] is _exportName_, then
1. Assert: _e_.[[ModuleRequest]] is not *null*.
1. Let _importedModule_ be GetImportedModule(_module_, _e_.[[ModuleRequest]]).
1. If _e_.[[ImportName]] is ~all~, then
@@ -27949,7 +27907,7 @@
1. Else,
1. Assert: _module_ imports a specific binding for this export.
1. Return _importedModule_.ResolveExport(_e_.[[ImportName]], _resolveSet_).
- 1. If SameValue(_exportName_, *"default"*) is *true*, then
+ 1. If _exportName_ is *"default"*, then
1. Assert: A `default` export was not explicitly defined by this module.
1. Return *null*.
1. NOTE: A `default` export cannot be provided by an `export * from "mod"` declaration.
@@ -27967,7 +27925,7 @@
1. Assert: There is more than one `*` import that includes the requested name.
1. If _resolution_.[[Module]] and _starResolution_.[[Module]] are not the same Module Record, return ~ambiguous~.
1. If _resolution_.[[BindingName]] is not _starResolution_.[[BindingName]] and either _resolution_.[[BindingName]] or _starResolution_.[[BindingName]] is ~namespace~, return ~ambiguous~.
- 1. If _resolution_.[[BindingName]] is a String, _starResolution_.[[BindingName]] is a String, and SameValue(_resolution_.[[BindingName]], _starResolution_.[[BindingName]]) is *false*, return ~ambiguous~.
+ 1. If _resolution_.[[BindingName]] is a String, _starResolution_.[[BindingName]] is a String, and _resolution_.[[BindingName]] is not _starResolution_.[[BindingName]], return ~ambiguous~.
1. Return _starResolution_.
@@ -28197,7 +28155,7 @@
Runtime Semantics: Evaluation
ModuleBody : ModuleItemList
1. Let _result_ be Completion(Evaluation of |ModuleItemList|).
- 1. If _result_.[[Type]] is ~normal~ and _result_.[[Value]] is ~empty~, then
+ 1. If _result_ is a normal completion and _result_.[[Value]] is ~empty~, then
1. Return *undefined*.
1. Return ? _result_.
@@ -28281,8 +28239,8 @@
Static Semantics: ImportEntries ( ): a List of ImportEntry Records
ModuleItemList : ModuleItemList ModuleItem
- 1. Let _entries1_ be ImportEntries of |ModuleItemList|.
- 1. Let _entries2_ be ImportEntries of |ModuleItem|.
+ 1. Let _entries1_ be the ImportEntries of |ModuleItemList|.
+ 1. Let _entries2_ be the ImportEntries of |ModuleItem|.
1. Return the list-concatenation of _entries1_ and _entries2_.
@@ -28295,8 +28253,8 @@
Static Semantics: ImportEntries ( ): a List of ImportEntry Records
ImportDeclaration : `import` ImportClause FromClause `;`
- 1. Let _module_ be the sole element of ModuleRequests of |FromClause|.
- 1. Return ImportEntriesForModule of |ImportClause| with argument _module_.
+ 1. Let _module_ be the sole element of the ModuleRequests of |FromClause|.
+ 1. Return the ImportEntriesForModule of |ImportClause| with argument _module_.
ImportDeclaration : `import` ModuleSpecifier `;`
@@ -28314,19 +28272,19 @@
ImportClause : ImportedDefaultBinding `,` NameSpaceImport
- 1. Let _entries1_ be ImportEntriesForModule of |ImportedDefaultBinding| with argument _module_.
- 1. Let _entries2_ be ImportEntriesForModule of |NameSpaceImport| with argument _module_.
+ 1. Let _entries1_ be the ImportEntriesForModule of |ImportedDefaultBinding| with argument _module_.
+ 1. Let _entries2_ be the ImportEntriesForModule of |NameSpaceImport| with argument _module_.
1. Return the list-concatenation of _entries1_ and _entries2_.
ImportClause : ImportedDefaultBinding `,` NamedImports
- 1. Let _entries1_ be ImportEntriesForModule of |ImportedDefaultBinding| with argument _module_.
- 1. Let _entries2_ be ImportEntriesForModule of |NamedImports| with argument _module_.
+ 1. Let _entries1_ be the ImportEntriesForModule of |ImportedDefaultBinding| with argument _module_.
+ 1. Let _entries2_ be the ImportEntriesForModule of |NamedImports| with argument _module_.
1. Return the list-concatenation of _entries1_ and _entries2_.
ImportedDefaultBinding : ImportedBinding
- 1. Let _localName_ be the sole element of BoundNames of |ImportedBinding|.
+ 1. Let _localName_ be the sole element of the BoundNames of |ImportedBinding|.
1. Let _defaultEntry_ be the ImportEntry Record { [[ModuleRequest]]: _module_, [[ImportName]]: *"default"*, [[LocalName]]: _localName_ }.
1. Return « _defaultEntry_ ».
@@ -28348,7 +28306,7 @@
ImportSpecifier : ImportedBinding
- 1. Let _localName_ be the sole element of BoundNames of |ImportedBinding|.
+ 1. Let _localName_ be the sole element of the BoundNames of |ImportedBinding|.
1. Let _entry_ be the ImportEntry Record { [[ModuleRequest]]: _module_, [[ImportName]]: _localName_, [[LocalName]]: _localName_ }.
1. Return « _entry_ ».
@@ -28399,10 +28357,10 @@
Static Semantics: Early Errors
ExportDeclaration : `export` NamedExports `;`
- It is a Syntax Error if ReferencedBindings of |NamedExports| contains any |StringLiteral|s.
+ It is a Syntax Error if the ReferencedBindings of |NamedExports| contains any |StringLiteral|s.
- For each |IdentifierName| _n_ in ReferencedBindings of |NamedExports|: It is a Syntax Error if StringValue of _n_ is a |ReservedWord| or the StringValue of _n_ is one of *"implements"*, *"interface"*, *"let"*, *"package"*, *"private"*, *"protected"*, *"public"*, or *"static"*.
+ For each |IdentifierName| _n_ in the ReferencedBindings of |NamedExports|: It is a Syntax Error if the StringValue of _n_ is a |ReservedWord| or the StringValue of _n_ is one of *"implements"*, *"interface"*, *"let"*, *"package"*, *"private"*, *"protected"*, *"public"*, or *"static"*.
@@ -28419,8 +28377,8 @@
Static Semantics: ExportedBindings ( ): a List of Strings
ModuleItemList : ModuleItemList ModuleItem
- 1. Let _names1_ be ExportedBindings of |ModuleItemList|.
- 1. Let _names2_ be ExportedBindings of |ModuleItem|.
+ 1. Let _names1_ be the ExportedBindings of |ModuleItemList|.
+ 1. Let _names2_ be the ExportedBindings of |ModuleItem|.
1. Return the list-concatenation of _names1_ and _names2_.
@@ -28488,8 +28446,8 @@
Static Semantics: ExportedNames ( ): a List of Strings
ModuleItemList : ModuleItemList ModuleItem
- 1. Let _names1_ be ExportedNames of |ModuleItemList|.
- 1. Let _names2_ be ExportedNames of |ModuleItem|.
+ 1. Let _names1_ be the ExportedNames of |ModuleItemList|.
+ 1. Let _names2_ be the ExportedNames of |ModuleItem|.
1. Return the list-concatenation of _names1_ and _names2_.
ModuleItem : ExportDeclaration
@@ -28567,8 +28525,8 @@
Static Semantics: ExportEntries ( ): a List of ExportEntry Records
ModuleItemList : ModuleItemList ModuleItem
- 1. Let _entries1_ be ExportEntries of |ModuleItemList|.
- 1. Let _entries2_ be ExportEntries of |ModuleItem|.
+ 1. Let _entries1_ be the ExportEntries of |ModuleItemList|.
+ 1. Let _entries2_ be the ExportEntries of |ModuleItem|.
1. Return the list-concatenation of _entries1_ and _entries2_.
@@ -28581,12 +28539,12 @@
Static Semantics: ExportEntries ( ): a List of ExportEntry Records
ExportDeclaration : `export` ExportFromClause FromClause `;`
- 1. Let _module_ be the sole element of ModuleRequests of |FromClause|.
- 1. Return ExportEntriesForModule of |ExportFromClause| with argument _module_.
+ 1. Let _module_ be the sole element of the ModuleRequests of |FromClause|.
+ 1. Return the ExportEntriesForModule of |ExportFromClause| with argument _module_.
ExportDeclaration : `export` NamedExports `;`
- 1. Return ExportEntriesForModule of |NamedExports| with argument *null*.
+ 1. Return the ExportEntriesForModule of |NamedExports| with argument *null*.
ExportDeclaration : `export` VariableStatement
@@ -28606,13 +28564,13 @@
Static Semantics: ExportEntries ( ): a List of ExportEntry Records
ExportDeclaration : `export` `default` HoistableDeclaration
- 1. Let _names_ be BoundNames of |HoistableDeclaration|.
+ 1. Let _names_ be the BoundNames of |HoistableDeclaration|.
1. Let _localName_ be the sole element of _names_.
1. Return a List whose sole element is a new ExportEntry Record { [[ModuleRequest]]: *null*, [[ImportName]]: *null*, [[LocalName]]: _localName_, [[ExportName]]: *"default"* }.
ExportDeclaration : `export` `default` ClassDeclaration
- 1. Let _names_ be BoundNames of |ClassDeclaration|.
+ 1. Let _names_ be the BoundNames of |ClassDeclaration|.
1. Let _localName_ be the sole element of _names_.
1. Return a List whose sole element is a new ExportEntry Record { [[ModuleRequest]]: *null*, [[ImportName]]: *null*, [[LocalName]]: _localName_, [[ExportName]]: *"default"* }.
@@ -28733,7 +28691,7 @@
Runtime Semantics: Evaluation
ExportDeclaration : `export` `default` ClassDeclaration
1. Let _value_ be ? BindingClassDeclarationEvaluation of |ClassDeclaration|.
- 1. Let _className_ be the sole element of BoundNames of |ClassDeclaration|.
+ 1. Let _className_ be the sole element of the BoundNames of |ClassDeclaration|.
1. If _className_ is *"\*default\*"*, then
1. Let _env_ be the running execution context's LexicalEnvironment.
1. Perform ? InitializeBoundName(*"\*default\*"*, _value_, _env_).
@@ -28902,7 +28860,7 @@
1. If _x_ is not a String, return _x_.
1. Let _evalRealm_ be the current Realm Record.
1. NOTE: In the case of a direct eval, _evalRealm_ is the realm of both the caller of `eval` and of the `eval` function itself.
- 1. Perform ? HostEnsureCanCompileStrings(_evalRealm_).
+ 1. Perform ? HostEnsureCanCompileStrings(_evalRealm_, « », _x_, _direct_).
1. Let _inFunction_ be *false*.
1. Let _inMethod_ be *false*.
1. Let _inDerivedConstructor_ be *false*.
@@ -28917,7 +28875,7 @@
1. Let _classFieldInitializerName_ be _F_.[[ClassFieldInitializerName]].
1. If _classFieldInitializerName_ is not ~empty~, set _inClassFieldInitializer_ to *true*.
1. Perform the following substeps in an implementation-defined order, possibly interleaving parsing and error detection:
- 1. Let _script_ be ParseText(StringToCodePoints(_x_), |Script|).
+ 1. Let _script_ be ParseText(_x_, |Script|).
1. If _script_ is a List of errors, throw a *SyntaxError* exception.
1. If _script_ Contains |ScriptBody| is *false*, return *undefined*.
1. Let _body_ be the |ScriptBody| of _script_.
@@ -28926,7 +28884,7 @@
1. If _inDerivedConstructor_ is *false* and _body_ Contains |SuperCall|, throw a *SyntaxError* exception.
1. If _inClassFieldInitializer_ is *true* and ContainsArguments of _body_ is *true*, throw a *SyntaxError* exception.
1. If _strictCaller_ is *true*, let _strictEval_ be *true*.
- 1. Else, let _strictEval_ be IsStrict of _script_.
+ 1. Else, let _strictEval_ be ScriptIsStrict of _script_.
1. Let _runningContext_ be the running execution context.
1. NOTE: If _direct_ is *true*, _runningContext_ will be the execution context that performed the direct eval. If _direct_ is *false*, _runningContext_ will be the execution context for the invocation of the `eval` function.
1. If _direct_ is *true*, then
@@ -28948,9 +28906,9 @@
1. Set _evalContext_'s PrivateEnvironment to _privateEnv_.
1. Push _evalContext_ onto the execution context stack; _evalContext_ is now the running execution context.
1. Let _result_ be Completion(EvalDeclarationInstantiation(_body_, _varEnv_, _lexEnv_, _privateEnv_, _strictEval_)).
- 1. If _result_.[[Type]] is ~normal~, then
+ 1. If _result_ is a normal completion, then
1. Set _result_ to Completion(Evaluation of _body_).
- 1. If _result_.[[Type]] is ~normal~ and _result_.[[Value]] is ~empty~, then
+ 1. If _result_ is a normal completion and _result_.[[Value]] is ~empty~, then
1. Set _result_ to NormalCompletion(*undefined*).
1. Suspend _evalContext_ and remove it from the execution context stack.
1. Resume the context that is now on the top of the execution context stack as the running execution context.
@@ -28965,12 +28923,19 @@
HostEnsureCanCompileStrings (
_calleeRealm_: a Realm Record,
+ _parameterStrings_: a List of Strings,
+ _bodyString_: a String,
+ _direct_: a Boolean,
): either a normal completion containing ~unused~ or a throw completion
description
It allows host environments to block certain ECMAScript functions which allow developers to interpret and evaluate strings as ECMAScript code.
+
+ _parameterStrings_ represents the strings that, when using one of the function constructors, will be concatenated together to build the parameters list. _bodyString_ represents the function body or the string passed to an `eval` call.
+ _direct_ signifies whether the evaluation is a direct eval.
+
The default implementation of HostEnsureCanCompileStrings is to return NormalCompletion(~unused~).
@@ -29002,7 +28967,7 @@
1. NOTE: `eval` will not create a global var declaration that would be shadowed by a global lexical declaration.
1. Let _thisEnv_ be _lexEnv_.
1. Assert: The following loop will terminate.
- 1. Repeat, while _thisEnv_ is not _varEnv_,
+ 1. Repeat, while _thisEnv_ and _varEnv_ are not the same Environment Record,
1. If _thisEnv_ is not an Object Environment Record, then
1. NOTE: The environment of with statements cannot contain any lexical declaration so it doesn't need to be checked for var/let hoisting conflicts.
1. For each element _name_ of _varNames_, do
@@ -29118,7 +29083,7 @@
parseFloat ( _string_ )
1. Let _trimmedPrefix_ be the longest prefix of _trimmed_ that satisfies the syntax of a |StrDecimalLiteral|, which might be _trimmed_ itself. If there is no such prefix, return *NaN*.
1. Let _parsedNumber_ be ParseText(_trimmedPrefix_, |StrDecimalLiteral|).
1. Assert: _parsedNumber_ is a Parse Node.
- 1. Return StringNumericValue of _parsedNumber_.
+ 1. Return the StringNumericValue of _parsedNumber_.
This function may interpret only a leading portion of _string_ as a Number value; it ignores any code units that cannot be interpreted as part of the notation of a decimal literal, and no indication is given that any such code units were ignored.
@@ -29325,7 +29290,7 @@
1. Let _len_ be the length of _string_.
1. Assert: _position_ + 2 ≤ _len_.
1. Let _hexDigits_ be the substring of _string_ from _position_ to _position_ + 2.
- 1. Let _parseResult_ be ParseText(StringToCodePoints(_hexDigits_), |HexDigits[~Sep]|).
+ 1. Let _parseResult_ be ParseText(_hexDigits_, |HexDigits[~Sep]|).
1. If _parseResult_ is not a Parse Node, return _parseResult_.
1. Let _n_ be the MV of _parseResult_.
1. Assert: _n_ is in the inclusive interval from 0 to 255.
@@ -29795,6 +29760,24 @@
Object.getPrototypeOf ( _O_ )
+
+
Object.groupBy ( _items_, _callbackfn_ )
+
+
_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.
+
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 _obj_ be OrdinaryObjectCreate(*null*).
+ 1. For each Record { [[Key]], [[Elements]] } _g_ of _groups_, do
+ 1. Let _elements_ be CreateArrayFromList(_g_.[[Elements]]).
+ 1. Perform ! CreateDataPropertyOrThrow(_obj_, _g_.[[Key]], _elements_).
+ 1. Return _obj_.
+
+
+
Object.hasOwn ( _O_, _P_ )
This function performs the following steps when called:
@@ -30157,8 +30140,6 @@
_constructor_ is the constructor function that is performing this action. _newTarget_ is the constructor that `new` was initially applied to. _parameterArgs_ and _bodyArg_ reflect the argument values that were passed to _constructor_.
- 1. Let _currentRealm_ be the current Realm Record.
- 1. Perform ? HostEnsureCanCompileStrings(_currentRealm_).
1. If _newTarget_ is *undefined*, set _newTarget_ to _constructor_.
1. If _kind_ is ~normal~, then
1. Let _prefix_ be *"function"*.
@@ -30186,22 +30167,26 @@
1. Let _parameterSym_ be the grammar symbol |FormalParameters[+Yield, +Await]|.
1. Let _fallbackProto_ be *"%AsyncGeneratorFunction.prototype%"*.
1. Let _argCount_ be the number of elements in _parameterArgs_.
+ 1. Let _parameterStrings_ be a new empty List.
+ 1. For each element _arg_ of _parameterArgs_, do
+ 1. Append ? ToString(_arg_) to _parameterStrings_.
+ 1. Let _bodyString_ be ? ToString(_bodyArg_).
+ 1. Let _currentRealm_ be the current Realm Record.
+ 1. Perform ? HostEnsureCanCompileStrings(_currentRealm_, _parameterStrings_, _bodyString_, *false*).
1. Let _P_ be the empty String.
1. If _argCount_ > 0, then
- 1. Let _firstArg_ be _parameterArgs_[0].
- 1. Set _P_ to ? ToString(_firstArg_).
+ 1. Set _P_ to _parameterStrings_[0].
1. Let _k_ be 1.
1. Repeat, while _k_ < _argCount_,
- 1. Let _nextArg_ be _parameterArgs_[_k_].
- 1. Let _nextArgString_ be ? ToString(_nextArg_).
+ 1. Let _nextArgString_ be _parameterStrings_[_k_].
1. Set _P_ to the string-concatenation of _P_, *","* (a comma), and _nextArgString_.
1. Set _k_ to _k_ + 1.
- 1. Let _bodyString_ be the string-concatenation of 0x000A (LINE FEED), ? ToString(_bodyArg_), and 0x000A (LINE FEED).
- 1. Let _sourceString_ be the string-concatenation of _prefix_, *" anonymous("*, _P_, 0x000A (LINE FEED), *") {"*, _bodyString_, and *"}"*.
+ 1. Let _bodyParseString_ be the string-concatenation of 0x000A (LINE FEED), _bodyString_, and 0x000A (LINE FEED).
+ 1. Let _sourceString_ be the string-concatenation of _prefix_, *" anonymous("*, _P_, 0x000A (LINE FEED), *") {"*, _bodyParseString_, and *"}"*.
1. Let _sourceText_ be StringToCodePoints(_sourceString_).
- 1. Let _parameters_ be ParseText(StringToCodePoints(_P_), _parameterSym_).
+ 1. Let _parameters_ be ParseText(_P_, _parameterSym_).
1. If _parameters_ is a List of errors, throw a *SyntaxError* exception.
- 1. Let _body_ be ParseText(StringToCodePoints(_bodyString_), _bodySym_).
+ 1. Let _body_ be ParseText(_bodyParseString_, _bodySym_).
1. If _body_ is a List of errors, throw a *SyntaxError* exception.
1. NOTE: The parameters and body are parsed separately to ensure that each is valid alone. For example, `new Function("/*", "*/ ) {")` does not evaluate to a function.
1. NOTE: If this step is reached, _sourceText_ must have the syntax of _exprSym_ (although the reverse implication does not hold). The purpose of the next two steps is to enforce any Early Error rules which apply to _exprSym_ directly.
@@ -30568,7 +30553,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 @@asyncIterator ().
This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *false* }.
@@ -30578,7 +30563,7 @@
Symbol.for ( _key_ )
1. Let _stringKey_ be ? ToString(_key_).
1. For each element _e_ of the GlobalSymbolRegistry List, do
- 1. If SameValue(_e_.[[Key]], _stringKey_) is *true*, return _e_.[[Symbol]].
+ 1. If _e_.[[Key]] is _stringKey_, return _e_.[[Symbol]].
1. Assert: GlobalSymbolRegistry does not currently contain an entry for _stringKey_.
1. Let _newSymbol_ be a new Symbol whose [[Description]] is _stringKey_.
1. Append the Record { [[Key]]: _stringKey_, [[Symbol]]: _newSymbol_ } to the GlobalSymbolRegistry List.
@@ -30840,7 +30825,7 @@
Error Objects
Instances of Error objects are thrown as exceptions when runtime errors occur. The Error objects may also serve as base objects for user-defined exception classes.
-
When an ECMAScript implementation detects a runtime error, it throws a new instance of one of the _NativeError_ objects defined in or a new instance of AggregateError object defined in . Each of these objects has the structure described below, differing only in the name used as the constructor name instead of _NativeError_, in the *"name"* property of the prototype object, in the implementation-defined *"message"* property of the prototype object, and in the presence of the %AggregateError%-specific *"errors"* property.
+
When an ECMAScript implementation detects a runtime error, it throws a new instance of one of the _NativeError_ objects defined in or a new instance of the AggregateError object defined in .
The Error Constructor
@@ -30972,7 +30957,7 @@
URIError
_NativeError_ Object Structure
-
When an ECMAScript implementation detects a runtime error, it throws a new instance of one of the _NativeError_ objects defined in . Each of these objects has the structure described below, differing only in the name used as the constructor name instead of _NativeError_, in the *"name"* property of the prototype object, and in the implementation-defined *"message"* property of the prototype object.
+
Each of these objects has the structure described below, differing only in the name used as the constructor name and in the *"name"* property of the prototype object.
For each error object, references to _NativeError_ in the definition should be replaced with the appropriate error object name from .
@@ -31026,7 +31011,7 @@
Properties of the _NativeError_ Prototype Objects
_NativeError_.prototype.constructor
-
The initial value of the *"constructor"* property of the prototype for a given _NativeError_ constructor is the corresponding intrinsic object %_NativeError_% ().
+
The initial value of the *"constructor"* property of the prototype for a given _NativeError_ constructor is the constructor itself.
@@ -31880,7 +31865,13 @@
Math.atan2 ( _y_, _x_ )
1. If _nx_ is *-∞*𝔽, return an implementation-approximated Number value representing -π.
1. If _nx_ is either *+0*𝔽 or *-0*𝔽, return an implementation-approximated Number value representing -π / 2.
1. Assert: _nx_ is finite and is neither *+0*𝔽 nor *-0*𝔽.
- 1. Return an implementation-approximated Number value representing the result of the inverse tangent of the quotient ℝ(_ny_) / ℝ(_nx_).
+ 1. Let _r_ be the inverse tangent of abs(ℝ(_ny_) / ℝ(_nx_)).
+ 1. If _nx_ < *-0*𝔽, then
+ 1. If _ny_ > *+0*𝔽, set _r_ to π - _r_.
+ 1. Else, set _r_ to -π + _r_.
+ 1. Else,
+ 1. If _ny_ < *-0*𝔽, set _r_ to -_r_.
+ 1. Return an implementation-approximated Number value representing _r_.
@@ -32361,7 +32352,7 @@
1. Let _ry_ be ℝ(_y_).
- 1. NOTE: In the following steps, each `_numYearsN_` is the number of years divisible by N that occur between the epoch and the start of year _y_. (The number is negative if _y_ is before the epoch.)
+ 1. [declared="numYears1,numYears4,numYears100,numYears400"] NOTE: In the following steps, _numYears1_, _numYears4_, _numYears100_, and _numYears400_ represent the number of years divisible by 1, 4, 100, and 400, respectively, that occur between the epoch and the start of year _y_. The number is negative if _y_ is before the epoch.
1. Let _numYears1_ be (_ry_ - 1970).
1. Let _numYears4_ be floor((_ry_ - 1969) / 4).
1. Let _numYears100_ be floor((_ry_ - 1901) / 100).
@@ -32718,8 +32709,7 @@
AvailableNamedTimeZoneIdentifiers ( ): a List of Time Zone Identifier Record
1. If the implementation does not include local political rules for any time zones, then
1. Return « the Time Zone Identifier Record { [[Identifier]]: *"UTC"*, [[PrimaryIdentifier]]: *"UTC"* } ».
- 1. Let _identifiers_ be the List of unique available named time zone identifiers.
- 1. [declared="comparefn"] Sort _identifiers_ into the same order as if an Array of the same values had been sorted using %Array.prototype.sort% with *undefined* as _comparefn_.
+ 1. Let _identifiers_ be the List of unique available named time zone identifiers, sorted according to lexicographic code unit order.
1. Let _result_ be a new empty List.
1. For each element _identifier_ of _identifiers_, do
1. Let _primary_ be _identifier_.
@@ -33215,7 +33205,7 @@
The return value indicates whether _offsetString_ conforms to the grammar given by |UTCOffset|.
- 1. Let _parseResult_ be ParseText(StringToCodePoints(_offsetString_), |UTCOffset|).
+ 1. Let _parseResult_ be ParseText(_offsetString_, |UTCOffset|).
1. If _parseResult_ is a List of errors, return *false*.
1. Return *true*.
@@ -33232,7 +33222,7 @@
The return value is the UTC offset, as a number of nanoseconds, that corresponds to the String _offsetString_.
- 1. Let _parseResult_ be ParseText(StringToCodePoints(_offsetString_), |UTCOffset|).
+ 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_.
@@ -33944,7 +33934,8 @@
Date.prototype.toISOString ( )
1. Let _dateObject_ be the *this* value.
1. Perform ? RequireInternalSlot(_dateObject_, [[DateValue]]).
1. Let _tv_ be _dateObject_.[[DateValue]].
- 1. If _tv_ is not finite, throw a *RangeError* exception.
+ 1. If _tv_ is *NaN*, throw a *RangeError* exception.
+ 1. Assert: _tv_ is an integral Number.
1. If _tv_ corresponds with a year that cannot be represented in the Date Time String Format, throw a *RangeError* exception.
1. Return a String representation of _tv_ in the Date Time String Format on the UTC time scale, including all format elements and the UTC offset representation *"Z"*.
@@ -34593,8 +34584,8 @@
1. Let _len_ be the length of _S_.
1. Let _start_ be the result of clamping _pos_ between 0 and _len_.
1. Let _index_ be StringIndexOf(_S_, _searchStr_, _start_).
- 1. If _index_ ≠ -1, return *true*.
- 1. Return *false*.
+ 1. If _index_ is ~not-found~, return *false*.
+ 1. Return *true*.
If _searchString_ appears as a substring of the result of converting this object to a String, at one or more indices that are greater than or equal to _position_, this function returns *true*; otherwise, it returns *false*. If _position_ is *undefined*, 0 is assumed, so as to search all of the String.
1. Assert: If _position_ is *undefined*, then _pos_ is 0.
1. Let _len_ be the length of _S_.
1. Let _start_ be the result of clamping _pos_ between 0 and _len_.
- 1. Return 𝔽(StringIndexOf(_S_, _searchStr_, _start_)).
+ 1. Let _result_ be StringIndexOf(_S_, _searchStr_, _start_).
+ 1. If _result_ is ~not-found~, return *-1*𝔽.
+ 1. Return 𝔽(_result_).
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.
1. Let _len_ be the length of _S_.
1. Let _searchLen_ be the length of _searchStr_.
1. Let _start_ be the result of clamping _pos_ between 0 and _len_ - _searchLen_.
- 1. If _searchStr_ is the empty String, return 𝔽(_start_).
- 1. For each integer _i_ such that 0 ≤ _i_ ≤ _start_, in descending order, do
- 1. Let _candidate_ be the substring of _S_ from _i_ to _i_ + _searchLen_.
- 1. If _candidate_ is _searchStr_, return 𝔽(_i_).
- 1. Return *-1*𝔽.
+ 1. Let _result_ be StringLastIndexOf(_S_, _searchStr_, _start_).
+ 1. If _result_ is ~not-found~, return *-1*𝔽.
+ 1. Return 𝔽(_result_).
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.
1. Set _replaceValue_ to ? ToString(_replaceValue_).
1. Let _searchLength_ be the length of _searchString_.
1. Let _position_ be StringIndexOf(_string_, _searchString_, 0).
- 1. If _position_ = -1, return _string_.
+ 1. If _position_ is ~not-found~, return _string_.
1. Let _preceding_ be the substring of _string_ from 0 to _position_.
1. Let _following_ be the substring of _string_ from _position_ + _searchLength_.
1. If _functionalReplace_ is *true*, then
@@ -34909,7 +34900,7 @@
_matched_: a String,
_str_: a String,
_position_: a non-negative integer,
- _captures_: a possibly empty List, each of whose elements is a String or *undefined*,
+ _captures_: a List of either Strings or *undefined*,
_namedCaptures_: an Object or *undefined*,
_replacementTemplate_: a String,
): either a normal completion containing a String or a throw completion
@@ -34962,7 +34953,7 @@
1. Let _refReplacement_ be _ref_.
1. Else if _templateRemainder_ starts with *"$<"*, then
1. Let _gtPos_ be StringIndexOf(_templateRemainder_, *">"*, 0).
- 1. If _gtPos_ = -1 or _namedCaptures_ is *undefined*, then
+ 1. If _gtPos_ is ~not-found~ or _namedCaptures_ is *undefined*, then
1. Let _ref_ be *"$<"*.
1. Let _refReplacement_ be _ref_.
1. Else,
@@ -35008,7 +34999,7 @@
1. Let _advanceBy_ be max(1, _searchLength_).
1. Let _matchPositions_ be a new empty List.
1. Let _position_ be StringIndexOf(_string_, _searchString_, 0).
- 1. Repeat, while _position_ ≠ -1,
+ 1. Repeat, while _position_ is not ~not-found~,
1. Append _position_ to _matchPositions_.
1. Set _position_ to StringIndexOf(_string_, _searchString_, _position_ + _advanceBy_).
1. Let _endOfLastMatch_ be 0.
@@ -35097,7 +35088,7 @@
String.prototype.split ( _separator_, _limit_ )
1. Let _substrings_ be a new empty List.
1. Let _i_ be 0.
1. Let _j_ be StringIndexOf(_S_, _R_, 0).
- 1. Repeat, while _j_ ≠ -1,
+ 1. Repeat, while _j_ is not ~not-found~,
1. Let _T_ be the substring of _S_ from _i_ to _j_.
1. Append _T_ to _substrings_.
1. If the number of elements in _substrings_ is _lim_, return CreateArrayFromList(_substrings_).
@@ -35704,7 +35695,7 @@
Static Semantics: Early Errors
It is a Syntax Error if CountLeftCapturingParensWithin(|Pattern|) ≥ 232 - 1.
- It is a Syntax Error if |Pattern| contains two or more |GroupSpecifier|s for which CapturingGroupName of |GroupSpecifier| is the same.
+ It is a Syntax Error if |Pattern| contains two or more |GroupSpecifier|s for which the CapturingGroupName of |GroupSpecifier| is the same.
- It is a Syntax Error if RegExpIdentifierCodePoint of |RegExpIdentifierStart| is not matched by the |UnicodeIDStart| lexical grammar production.
+ It is a Syntax Error if the RegExpIdentifierCodePoint of |RegExpIdentifierStart| is not matched by the |UnicodeIDStart| lexical grammar production.
- It is a Syntax Error if RegExpIdentifierCodePoint of |RegExpIdentifierPart| is not matched by the |UnicodeIDContinue| lexical grammar production.
+ It is a Syntax Error if the RegExpIdentifierCodePoint of |RegExpIdentifierPart| is not matched by the |UnicodeIDContinue| lexical grammar production.
Static Semantics: CapturingGroupName ( ): a String
GroupName :: `<` RegExpIdentifierName `>`
- 1. Let _idTextUnescaped_ be RegExpIdentifierCodePoints of |RegExpIdentifierName|.
+ 1. Let _idTextUnescaped_ be the RegExpIdentifierCodePoints of |RegExpIdentifierName|.
1. Return CodePointsToString(_idTextUnescaped_).
@@ -36247,13 +36238,13 @@
Static Semantics: RegExpIdentifierCodePoints ( ): a List of code points
RegExpIdentifierName :: RegExpIdentifierStart
- 1. Let _cp_ be RegExpIdentifierCodePoint of |RegExpIdentifierStart|.
+ 1. Let _cp_ be the RegExpIdentifierCodePoint of |RegExpIdentifierStart|.
1. Return « _cp_ ».
RegExpIdentifierName :: RegExpIdentifierName RegExpIdentifierPart
- 1. Let _cps_ be RegExpIdentifierCodePoints of the derived |RegExpIdentifierName|.
- 1. Let _cp_ be RegExpIdentifierCodePoint of |RegExpIdentifierPart|.
+ 1. Let _cps_ be the RegExpIdentifierCodePoints of the derived |RegExpIdentifierName|.
+ 1. Let _cp_ be the RegExpIdentifierCodePoint of |RegExpIdentifierPart|.
1. Return the list-concatenation of _cps_ and « _cp_ ».
@@ -38025,7 +38016,7 @@
RegExp.prototype [ @@search ] ( _string_ )
1. If _rx_ is not an Object, throw a *TypeError* exception.
1. Let _S_ be ? ToString(_string_).
1. Let _previousLastIndex_ be ? Get(_rx_, *"lastIndex"*).
- 1. If SameValue(_previousLastIndex_, *+0*𝔽) is *false*, then
+ 1. If _previousLastIndex_ is not *+0*𝔽, then
1. Perform ? Set(_rx_, *"lastIndex"*, *+0*𝔽, *true*).
1. Let _result_ be ? RegExpExec(_rx_, _S_).
1. Let _currentLastIndex_ be ? Get(_rx_, *"lastIndex"*).
@@ -38620,16 +38611,15 @@
1. Let _error_ be ThrowCompletion(a newly created *TypeError* object).
1. Return ? IteratorClose(_iteratorRecord_, _error_).
1. Let _Pk_ be ! ToString(𝔽(_k_)).
- 1. Let _next_ be ? IteratorStep(_iteratorRecord_).
- 1. If _next_ is *false*, then
+ 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
+ 1. If _next_ is ~done~, then
1. Perform ? Set(_A_, *"length"*, 𝔽(_k_), *true*).
1. Return _A_.
- 1. Let _nextValue_ be ? IteratorValue(_next_).
1. If _mapping_ is *true*, then
- 1. Let _mappedValue_ be Completion(Call(_mapfn_, _thisArg_, « _nextValue_, 𝔽(_k_) »)).
+ 1. Let _mappedValue_ be Completion(Call(_mapfn_, _thisArg_, « _next_, 𝔽(_k_) »)).
1. IfAbruptCloseIterator(_mappedValue_, _iteratorRecord_).
1. Else,
- 1. Let _mappedValue_ be _nextValue_.
+ 1. Let _mappedValue_ be _next_.
1. Let _defineStatus_ be Completion(CreateDataPropertyOrThrow(_A_, _Pk_, _mappedValue_)).
1. IfAbruptCloseIterator(_defineStatus_, _iteratorRecord_).
1. Set _k_ to _k_ + 1.
@@ -38754,10 +38744,10 @@
Array.prototype.concat ( ..._items_ )
1. If _n_ + _len_ > 253 - 1, throw a *TypeError* exception.
1. Let _k_ be 0.
1. Repeat, while _k_ < _len_,
- 1. Let _P_ be ! ToString(𝔽(_k_)).
- 1. Let _exists_ be ? HasProperty(_E_, _P_).
+ 1. Let _Pk_ be ! ToString(𝔽(_k_)).
+ 1. Let _exists_ be ? HasProperty(_E_, _Pk_).
1. If _exists_ is *true*, then
- 1. Let _subElement_ be ? Get(_E_, _P_).
+ 1. Let _subElement_ be ? Get(_E_, _Pk_).
1. Perform ? CreateDataPropertyOrThrow(_A_, ! ToString(𝔽(_n_)), _subElement_).
1. Set _n_ to _n_ + 1.
1. Set _k_ to _k_ + 1.
@@ -38835,8 +38825,8 @@
_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, if _callbackfn_ returned *true* for all elements, `every` will return *true*. _callbackfn_ is called only for elements of the array which actually exist; it is not called for missing elements of the array.
+
_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_.
1. Let _k_ be _len_ + _n_.
1. If _k_ < 0, set _k_ to 0.
1. Repeat, while _k_ < _len_,
- 1. Let _kPresent_ be ? HasProperty(_O_, ! ToString(𝔽(_k_))).
+ 1. Let _Pk_ be ! ToString(𝔽(_k_)).
+ 1. Let _kPresent_ be ? HasProperty(_O_, _Pk_).
1. If _kPresent_ is *true*, then
- 1. Let _elementK_ be ? Get(_O_, ! ToString(𝔽(_k_))).
+ 1. Let _elementK_ be ? Get(_O_, _Pk_).
1. If IsStrictlyEqual(_searchElement_, _elementK_) is *true*, return 𝔽(_k_).
1. Set _k_ to _k_ + 1.
1. Return *-1*𝔽.
@@ -39244,8 +39235,9 @@
Array.prototype.join ( _separator_ )
1. Repeat, while _k_ < _len_,
1. If _k_ > 0, set _R_ to the string-concatenation of _R_ and _sep_.
1. Let _element_ be ? Get(_O_, ! ToString(𝔽(_k_))).
- 1. If _element_ is either *undefined* or *null*, let _next_ be the empty String; otherwise, let _next_ be ? ToString(_element_).
- 1. Set _R_ to the string-concatenation of _R_ and _next_.
+ 1. If _element_ is neither *undefined* nor *null*, then
+ 1. Let _S_ be ? ToString(_element_).
+ 1. Set _R_ to the string-concatenation of _R_ and _S_.
1. Set _k_ to _k_ + 1.
1. Return _R_.
@@ -39281,9 +39273,10 @@
1. Else,
1. Let _k_ be _len_ + _n_.
1. Repeat, while _k_ ≥ 0,
- 1. Let _kPresent_ be ? HasProperty(_O_, ! ToString(𝔽(_k_))).
+ 1. Let _Pk_ be ! ToString(𝔽(_k_)).
+ 1. Let _kPresent_ be ? HasProperty(_O_, _Pk_).
1. If _kPresent_ is *true*, then
- 1. Let _elementK_ be ? Get(_O_, ! ToString(𝔽(_k_))).
+ 1. Let _elementK_ be ? Get(_O_, _Pk_).
1. If IsStrictlyEqual(_searchElement_, _elementK_) is *true*, return 𝔽(_k_).
1. Set _k_ to _k_ - 1.
1. Return *-1*𝔽.
@@ -39513,8 +39506,8 @@
Array.prototype.shift ( )
1. Let _to_ be ! ToString(𝔽(_k_ - 1)).
1. Let _fromPresent_ be ? HasProperty(_O_, _from_).
1. If _fromPresent_ is *true*, then
- 1. Let _fromVal_ be ? Get(_O_, _from_).
- 1. Perform ? Set(_O_, _to_, _fromVal_, *true*).
+ 1. Let _fromValue_ be ? Get(_O_, _from_).
+ 1. Perform ? Set(_O_, _to_, _fromValue_, *true*).
1. Else,
1. Assert: _fromPresent_ is *false*.
1. Perform ? DeletePropertyOrThrow(_O_, _to_).
@@ -39811,11 +39804,10 @@
1. Let _R_ be the empty String.
1. Let _k_ be 0.
1. Repeat, while _k_ < _len_,
- 1. If _k_ > 0, then
- 1. Set _R_ to the string-concatenation of _R_ and _separator_.
- 1. Let _nextElement_ be ? Get(_array_, ! ToString(𝔽(_k_))).
- 1. If _nextElement_ is neither *undefined* nor *null*, then
- 1. Let _S_ be ? ToString(? Invoke(_nextElement_, *"toLocaleString"*)).
+ 1. If _k_ > 0, set _R_ to the string-concatenation of _R_ and _separator_.
+ 1. Let _element_ be ? Get(_array_, ! ToString(𝔽(_k_))).
+ 1. If _element_ is neither *undefined* nor *null*, then
+ 1. Let _S_ be ? ToString(? Invoke(_element_, *"toLocaleString"*)).
1. Set _R_ to the string-concatenation of _R_ and _S_.
1. Set _k_ to _k_ + 1.
1. Return _R_.
@@ -39872,7 +39864,7 @@
1. Let _O_ be ? ToObject(*this* value).
1. Let _len_ be ? LengthOfArrayLike(_O_).
1. Let _relativeStart_ be ? ToIntegerOrInfinity(_start_).
- 1. If _relativeStart_ is -∞, let _actualStart_ be 0.
+ 1. If _relativeStart_ = -∞, let _actualStart_ be 0.
1. Else if _relativeStart_ < 0, let _actualStart_ be max(_len_ + _relativeStart_, 0).
1. Else, let _actualStart_ be min(_relativeStart_, _len_).
1. Let _insertCount_ be the number of elements in _items_.
@@ -39980,7 +39972,7 @@
Array.prototype.with ( _index_, _value_ )
1. Let _k_ be 0.
1. Repeat, while _k_ < _len_,
1. Let _Pk_ be ! ToString(𝔽(_k_)).
- 1. If _k_ is _actualIndex_, let _fromValue_ be _value_.
+ 1. If _k_ = _actualIndex_, let _fromValue_ be _value_.
1. Else, let _fromValue_ be ? Get(_O_, _Pk_).
1. Perform ! CreateDataPropertyOrThrow(_A_, _Pk_, _fromValue_).
1. Set _k_ to _k_ + 1.
@@ -40059,9 +40051,9 @@
1. Let _index_ be 0.
1. Repeat,
1. If _array_ has a [[TypedArrayName]] internal slot, then
- 1. Let _iieoRecord_ be MakeIntegerIndexedObjectWithBufferWitnessRecord(_array_, ~seq-cst~).
- 1. If IsIntegerIndexedObjectOutOfBounds(_iieoRecord_) is *true*, throw a *TypeError* exception.
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_array_, ~seq-cst~).
+ 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception.
+ 1. Let _len_ be TypedArrayLength(_taRecord_).
1. Else,
1. Let _len_ be ? LengthOfArrayLike(_array_).
1. If _index_ ≥ _len_, return NormalCompletion(*undefined*).
@@ -40375,7 +40367,7 @@
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_.
- 1. Let _targetObj_ be ? TypedArrayCreate(_C_, « 𝔽(_len_) »).
+ 1. Let _targetObj_ be ? TypedArrayCreateFromConstructor(_C_, « 𝔽(_len_) »).
1. Let _k_ be 0.
1. Repeat, while _k_ < _len_,
1. Let _Pk_ be ! ToString(𝔽(_k_)).
@@ -40392,7 +40384,7 @@
1. NOTE: _source_ is not an Iterable so assume it is already an array-like object.
1. Let _arrayLike_ be ! ToObject(_source_).
1. Let _len_ be ? LengthOfArrayLike(_arrayLike_).
- 1. Let _targetObj_ be ? TypedArrayCreate(_C_, « 𝔽(_len_) »).
+ 1. Let _targetObj_ be ? TypedArrayCreateFromConstructor(_C_, « 𝔽(_len_) »).
1. Let _k_ be 0.
1. Repeat, while _k_ < _len_,
1. Let _Pk_ be ! ToString(𝔽(_k_)).
@@ -40414,7 +40406,7 @@
%TypedArray%.of ( ..._items_ )
1. Let _len_ be the number of elements in _items_.
1. Let _C_ be the *this* value.
1. If IsConstructor(_C_) is *false*, throw a *TypeError* exception.
- 1. Let _newObj_ be ? TypedArrayCreate(_C_, « 𝔽(_len_) »).
+ 1. Let _newObj_ be ? TypedArrayCreateFromConstructor(_C_, « 𝔽(_len_) »).
1. Let _k_ be 0.
1. Repeat, while _k_ < _len_,
1. Let _kValue_ be _items_[_k_].
@@ -40458,8 +40450,8 @@
Properties of the %TypedArray% Prototype Object
%TypedArray%.prototype.at ( _index_ )
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
+ 1. Let _len_ be TypedArrayLength(_taRecord_).
1. Let _relativeIndex_ be ? ToIntegerOrInfinity(_index_).
1. If _relativeIndex_ ≥ 0, then
1. Let _k_ be _relativeIndex_.
@@ -40489,8 +40481,8 @@
get %TypedArray%.prototype.byteLength
1. Let _O_ be the *this* value.
1. Perform ? RequireInternalSlot(_O_, [[TypedArrayName]]).
1. Assert: _O_ has a [[ViewedArrayBuffer]] internal slot.
- 1. Let _iieoRecord_ be MakeIntegerIndexedObjectWithBufferWitnessRecord(_O_, ~seq-cst~).
- 1. Let _size_ be IntegerIndexedObjectByteLength(_iieoRecord_).
+ 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_O_, ~seq-cst~).
+ 1. Let _size_ be TypedArrayByteLength(_taRecord_).
1. Return 𝔽(_size_).
@@ -40502,8 +40494,8 @@
get %TypedArray%.prototype.byteOffset
1. Let _O_ be the *this* value.
1. Perform ? RequireInternalSlot(_O_, [[TypedArrayName]]).
1. Assert: _O_ has a [[ViewedArrayBuffer]] internal slot.
- 1. Let _iieoRecord_ be MakeIntegerIndexedObjectWithBufferWitnessRecord(_O_, ~seq-cst~).
- 1. If IsIntegerIndexedObjectOutOfBounds(_iieoRecord_) is *true*, return *+0*𝔽.
+ 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_O_, ~seq-cst~).
+ 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, return *+0*𝔽.
1. Let _offset_ be _O_.[[ByteOffset]].
1. Return 𝔽(_offset_).
@@ -40520,32 +40512,32 @@
This method performs the following steps when called:
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
+ 1. Let _len_ be TypedArrayLength(_taRecord_).
1. Let _relativeTarget_ be ? ToIntegerOrInfinity(_target_).
- 1. If _relativeTarget_ = -∞, let _to_ be 0.
- 1. Else if _relativeTarget_ < 0, let _to_ be max(_len_ + _relativeTarget_, 0).
- 1. Else, let _to_ be min(_relativeTarget_, _len_).
+ 1. If _relativeTarget_ = -∞, let _targetIndex_ be 0.
+ 1. Else if _relativeTarget_ < 0, let _targetIndex_ be max(_len_ + _relativeTarget_, 0).
+ 1. Else, let _targetIndex_ be min(_relativeTarget_, _len_).
1. Let _relativeStart_ be ? ToIntegerOrInfinity(_start_).
- 1. If _relativeStart_ = -∞, let _from_ be 0.
- 1. Else if _relativeStart_ < 0, let _from_ be max(_len_ + _relativeStart_, 0).
- 1. Else, let _from_ be min(_relativeStart_, _len_).
+ 1. If _relativeStart_ = -∞, let _startIndex_ be 0.
+ 1. Else if _relativeStart_ < 0, let _startIndex_ be max(_len_ + _relativeStart_, 0).
+ 1. Else, let _startIndex_ be min(_relativeStart_, _len_).
1. If _end_ is *undefined*, let _relativeEnd_ be _len_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_).
- 1. If _relativeEnd_ = -∞, let _final_ be 0.
- 1. Else if _relativeEnd_ < 0, let _final_ be max(_len_ + _relativeEnd_, 0).
- 1. Else, let _final_ be min(_relativeEnd_, _len_).
- 1. Let _count_ be min(_final_ - _from_, _len_ - _to_).
+ 1. If _relativeEnd_ = -∞, let _endIndex_ be 0.
+ 1. Else if _relativeEnd_ < 0, let _endIndex_ be max(_len_ + _relativeEnd_, 0).
+ 1. Else, let _endIndex_ be min(_relativeEnd_, _len_).
+ 1. Let _count_ be min(_endIndex_ - _startIndex_, _len_ - _targetIndex_).
1. If _count_ > 0, then
1. NOTE: The copying must be performed in a manner that preserves the bit-level encoding of the source data.
1. Let _buffer_ be _O_.[[ViewedArrayBuffer]].
- 1. Set _iieoRecord_ to MakeIntegerIndexedObjectWithBufferWitnessRecord(_O_, ~seq-cst~).
- 1. If IsIntegerIndexedObjectOutOfBounds(_iieoRecord_) is *true*, throw a *TypeError* exception.
- 1. Set _len_ to IntegerIndexedObjectLength(_iieoRecord_).
+ 1. Set _taRecord_ to MakeTypedArrayWithBufferWitnessRecord(_O_, ~seq-cst~).
+ 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception.
+ 1. Set _len_ to TypedArrayLength(_taRecord_).
1. Let _elementSize_ be TypedArrayElementSize(_O_).
1. Let _byteOffset_ be _O_.[[ByteOffset]].
- 1. Let _bufferByteLimit_ be _len_ × _elementSize_ + _byteOffset_.
- 1. Let _toByteIndex_ be _to_ × _elementSize_ + _byteOffset_.
- 1. Let _fromByteIndex_ be _from_ × _elementSize_ + _byteOffset_.
+ 1. Let _bufferByteLimit_ be (_len_ × _elementSize_) + _byteOffset_.
+ 1. Let _toByteIndex_ be (_targetIndex_ × _elementSize_) + _byteOffset_.
+ 1. Let _fromByteIndex_ be (_startIndex_ × _elementSize_) + _byteOffset_.
1. Let _countBytes_ be _count_ × _elementSize_.
1. If _fromByteIndex_ < _toByteIndex_ and _toByteIndex_ < _fromByteIndex_ + _countBytes_, then
1. Let _direction_ be -1.
@@ -40582,8 +40574,8 @@
This method performs the following steps when called:
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 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. Let _k_ be 0.
1. Repeat, while _k_ < _len_,
@@ -40603,23 +40595,24 @@
This method performs the following steps when called:
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
+ 1. Let _len_ be TypedArrayLength(_taRecord_).
1. If _O_.[[ContentType]] is ~bigint~, set _value_ to ? ToBigInt(_value_).
1. Otherwise, set _value_ to ? ToNumber(_value_).
1. Let _relativeStart_ be ? ToIntegerOrInfinity(_start_).
- 1. If _relativeStart_ = -∞, let _k_ be 0.
- 1. Else if _relativeStart_ < 0, let _k_ be max(_len_ + _relativeStart_, 0).
- 1. Else, let _k_ be min(_relativeStart_, _len_).
+ 1. If _relativeStart_ = -∞, let _startIndex_ be 0.
+ 1. Else if _relativeStart_ < 0, let _startIndex_ be max(_len_ + _relativeStart_, 0).
+ 1. Else, let _startIndex_ be min(_relativeStart_, _len_).
1. If _end_ is *undefined*, let _relativeEnd_ be _len_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_).
- 1. If _relativeEnd_ = -∞, let _final_ be 0.
- 1. Else if _relativeEnd_ < 0, let _final_ be max(_len_ + _relativeEnd_, 0).
- 1. Else, let _final_ be min(_relativeEnd_, _len_).
- 1. Set _iieoRecord_ to MakeIntegerIndexedObjectWithBufferWitnessRecord(_O_, ~seq-cst~).
- 1. If IsIntegerIndexedObjectOutOfBounds(_iieoRecord_) is *true*, throw a *TypeError* exception.
- 1. Set _len_ to IntegerIndexedObjectLength(_iieoRecord_).
- 1. Set _final_ to min(_final_, _len_).
- 1. Repeat, while _k_ < _final_,
+ 1. If _relativeEnd_ = -∞, let _endIndex_ be 0.
+ 1. Else if _relativeEnd_ < 0, let _endIndex_ be max(_len_ + _relativeEnd_, 0).
+ 1. Else, let _endIndex_ be min(_relativeEnd_, _len_).
+ 1. Set _taRecord_ to MakeTypedArrayWithBufferWitnessRecord(_O_, ~seq-cst~).
+ 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception.
+ 1. Set _len_ to TypedArrayLength(_taRecord_).
+ 1. Set _endIndex_ to min(_endIndex_, _len_).
+ 1. Let _k_ be _startIndex_.
+ 1. Repeat, while _k_ < _endIndex_,
1. Let _Pk_ be ! ToString(𝔽(_k_)).
1. Perform ! Set(_O_, _Pk_, _value_, *true*).
1. Set _k_ to _k_ + 1.
@@ -40633,8 +40626,8 @@
This method performs the following steps when called:
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 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. Let _kept_ be a new empty List.
1. Let _captured_ be 0.
@@ -40663,8 +40656,8 @@
This method performs the following steps when called:
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
+ 1. Let _len_ be TypedArrayLength(_taRecord_).
1. Let _findRec_ be ? FindViaPredicate(_O_, _len_, ~ascending~, _predicate_, _thisArg_).
1. Return _findRec_.[[Value]].
@@ -40677,8 +40670,8 @@
This method performs the following steps when called:
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
+ 1. Let _len_ be TypedArrayLength(_taRecord_).
1. Let _findRec_ be ? FindViaPredicate(_O_, _len_, ~ascending~, _predicate_, _thisArg_).
1. Return _findRec_.[[Index]].
@@ -40691,8 +40684,8 @@
This method performs the following steps when called:
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
+ 1. Let _len_ be TypedArrayLength(_taRecord_).
1. Let _findRec_ be ? FindViaPredicate(_O_, _len_, ~descending~, _predicate_, _thisArg_).
1. Return _findRec_.[[Value]].
@@ -40705,8 +40698,8 @@
This method performs the following steps when called:
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
+ 1. Let _len_ be TypedArrayLength(_taRecord_).
1. Let _findRec_ be ? FindViaPredicate(_O_, _len_, ~descending~, _predicate_, _thisArg_).
1. Return _findRec_.[[Index]].
@@ -40719,8 +40712,8 @@
This method performs the following steps when called:
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 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. Let _k_ be 0.
1. Repeat, while _k_ < _len_,
@@ -40739,8 +40732,8 @@
This method performs the following steps when called:
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
+ 1. Let _len_ be TypedArrayLength(_taRecord_).
1. If _len_ = 0, return *false*.
1. Let _n_ be ? ToIntegerOrInfinity(_fromIndex_).
1. Assert: If _fromIndex_ is *undefined*, then _n_ is 0.
@@ -40766,8 +40759,8 @@
This method performs the following steps when called:
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
+ 1. Let _len_ be TypedArrayLength(_taRecord_).
1. If _len_ = 0, return *-1*𝔽.
1. Let _n_ be ? ToIntegerOrInfinity(_fromIndex_).
1. Assert: If _fromIndex_ is *undefined*, then _n_ is 0.
@@ -40795,8 +40788,8 @@
%TypedArray%.prototype.join ( _separator_ )
This method performs the following steps when called:
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
+ 1. Let _len_ be TypedArrayLength(_taRecord_).
1. If _separator_ is *undefined*, let _sep_ be *","*.
1. Else, let _sep_ be ? ToString(_separator_).
1. Let _R_ be the empty String.
@@ -40804,8 +40797,9 @@
%TypedArray%.prototype.join ( _separator_ )
1. Repeat, while _k_ < _len_,
1. If _k_ > 0, set _R_ to the string-concatenation of _R_ and _sep_.
1. Let _element_ be ! Get(_O_, ! ToString(𝔽(_k_))).
- 1. If _element_ is *undefined*, let _next_ be the empty String; otherwise, let _next_ be ! ToString(_element_).
- 1. Set _R_ to the string-concatenation of _R_ and _next_.
+ 1. If _element_ is not *undefined*, then
+ 1. Let _S_ be ! ToString(_element_).
+ 1. Set _R_ to the string-concatenation of _R_ and _S_.
1. Set _k_ to _k_ + 1.
1. Return _R_.
@@ -40828,8 +40822,8 @@
This method performs the following steps when called:
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
+ 1. Let _len_ be TypedArrayLength(_taRecord_).
1. If _len_ = 0, return *-1*𝔽.
1. If _fromIndex_ is present, let _n_ be ? ToIntegerOrInfinity(_fromIndex_); else let _n_ be _len_ - 1.
1. If _n_ = -∞, return *-1*𝔽.
@@ -40855,9 +40849,9 @@
get %TypedArray%.prototype.length
1. Let _O_ be the *this* value.
1. Perform ? RequireInternalSlot(_O_, [[TypedArrayName]]).
1. Assert: _O_ has [[ViewedArrayBuffer]] and [[ArrayLength]] internal slots.
- 1. Let _iieoRecord_ be MakeIntegerIndexedObjectWithBufferWitnessRecord(_O_, ~seq-cst~).
- 1. If IsIntegerIndexedObjectOutOfBounds(_iieoRecord_) is *true*, return *+0*𝔽.
- 1. Let _length_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_O_, ~seq-cst~).
+ 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, return *+0*𝔽.
+ 1. Let _length_ be TypedArrayLength(_taRecord_).
1. Return 𝔽(_length_).
This function is not generic. The *this* value must be an object with a [[TypedArrayName]] internal slot.
This method performs the following steps when called:
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 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. Let _A_ be ? TypedArraySpeciesCreate(_O_, « 𝔽(_len_) »).
1. Let _k_ be 0.
@@ -40891,8 +40885,8 @@
This method performs the following steps when called:
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 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 _len_ = 0 and _initialValue_ is not present, throw a *TypeError* exception.
1. Let _k_ be 0.
@@ -40919,8 +40913,8 @@
This method performs the following steps when called:
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 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 _len_ = 0 and _initialValue_ is not present, throw a *TypeError* exception.
1. Let _k_ be _len_ - 1.
@@ -40947,8 +40941,8 @@
%TypedArray%.prototype.reverse ( )
This method performs the following steps when called:
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
+ 1. Let _len_ be TypedArrayLength(_taRecord_).
1. Let _middle_ be floor(_len_ / 2).
1. Let _lower_ be 0.
1. Repeat, while _lower_ ≠ _middle_,
@@ -40997,13 +40991,13 @@
1. Let _targetBuffer_ be _target_.[[ViewedArrayBuffer]].
- 1. Let _targetRecord_ be MakeIntegerIndexedObjectWithBufferWitnessRecord(_target_, ~seq-cst~).
- 1. If IsIntegerIndexedObjectOutOfBounds(_targetRecord_) is *true*, throw a *TypeError* exception.
- 1. Let _targetLength_ be IntegerIndexedObjectLength(_targetRecord_).
+ 1. Let _targetRecord_ be MakeTypedArrayWithBufferWitnessRecord(_target_, ~seq-cst~).
+ 1. If IsTypedArrayOutOfBounds(_targetRecord_) is *true*, throw a *TypeError* exception.
+ 1. Let _targetLength_ be TypedArrayLength(_targetRecord_).
1. Let _srcBuffer_ be _source_.[[ViewedArrayBuffer]].
- 1. Let _srcRecord_ be MakeIntegerIndexedObjectWithBufferWitnessRecord(_source_, ~seq-cst~).
- 1. If IsIntegerIndexedObjectOutOfBounds(_srcRecord_) is *true*, throw a *TypeError* exception.
- 1. Let _srcLength_ be IntegerIndexedObjectLength(_srcRecord_).
+ 1. Let _srcRecord_ be MakeTypedArrayWithBufferWitnessRecord(_source_, ~seq-cst~).
+ 1. If IsTypedArrayOutOfBounds(_srcRecord_) is *true*, throw a *TypeError* exception.
+ 1. Let _srcLength_ be TypedArrayLength(_srcRecord_).
1. Let _targetType_ be TypedArrayElementType(_target_).
1. Let _targetElementSize_ be TypedArrayElementSize(_target_).
1. Let _targetByteOffset_ be _target_.[[ByteOffset]].
@@ -41015,13 +41009,13 @@
1. If _target_.[[ContentType]] is not _source_.[[ContentType]], throw a *TypeError* exception.
1. If IsSharedArrayBuffer(_srcBuffer_) is *true*, IsSharedArrayBuffer(_targetBuffer_) is *true*, and _srcBuffer_.[[ArrayBufferData]] is _targetBuffer_.[[ArrayBufferData]], let _sameSharedArrayBuffer_ be *true*; otherwise, let _sameSharedArrayBuffer_ be *false*.
1. If SameValue(_srcBuffer_, _targetBuffer_) is *true* or _sameSharedArrayBuffer_ is *true*, then
- 1. Let _srcByteLength_ be IntegerIndexedObjectByteLength(_srcRecord_).
+ 1. Let _srcByteLength_ be TypedArrayByteLength(_srcRecord_).
1. Set _srcBuffer_ to ? CloneArrayBuffer(_srcBuffer_, _srcByteOffset_, _srcByteLength_).
1. Let _srcByteIndex_ be 0.
1. Else,
1. Let _srcByteIndex_ be _srcByteOffset_.
- 1. Let _targetByteIndex_ be _targetOffset_ × _targetElementSize_ + _targetByteOffset_.
- 1. Let _limit_ be _targetByteIndex_ + _targetElementSize_ × _srcLength_.
+ 1. Let _targetByteIndex_ be (_targetOffset_ × _targetElementSize_) + _targetByteOffset_.
+ 1. Let _limit_ be _targetByteIndex_ + (_targetElementSize_ × _srcLength_).
1. If _srcType_ is _targetType_, then
1. NOTE: The transfer must be performed in a manner that preserves the bit-level encoding of the source data.
1. Repeat, while _targetByteIndex_ < _limit_,
@@ -41052,9 +41046,9 @@
It sets multiple values in _target_, starting at index _targetOffset_, reading the values from _source_.
- 1. Let _targetRecord_ be MakeIntegerIndexedObjectWithBufferWitnessRecord(_target_, ~seq-cst~).
- 1. If IsIntegerIndexedObjectOutOfBounds(_targetRecord_) is *true*, throw a *TypeError* exception.
- 1. Let _targetLength_ be IntegerIndexedObjectLength(_targetRecord_).
+ 1. Let _targetRecord_ be MakeTypedArrayWithBufferWitnessRecord(_target_, ~seq-cst~).
+ 1. If IsTypedArrayOutOfBounds(_targetRecord_) is *true*, throw a *TypeError* exception.
+ 1. Let _targetLength_ be TypedArrayLength(_targetRecord_).
1. Let _src_ be ? ToObject(_source_).
1. Let _srcLength_ be ? LengthOfArrayLike(_src_).
1. If _targetOffset_ = +∞, throw a *RangeError* exception.
@@ -41064,7 +41058,7 @@
1. Let _Pk_ be ! ToString(𝔽(_k_)).
1. Let _value_ be ? Get(_src_, _Pk_).
1. Let _targetIndex_ be 𝔽(_targetOffset_ + _k_).
- 1. Perform ? IntegerIndexedElementSet(_target_, _targetIndex_, _value_).
+ 1. Perform ? TypedArraySetElement(_target_, _targetIndex_, _value_).
1. Set _k_ to _k_ + 1.
1. Return ~unused~.
@@ -41077,23 +41071,23 @@
%TypedArray%.prototype.slice ( _start_, _end_ )
This method performs the following steps when called:
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
+ 1. Let _srcArrayLength_ be TypedArrayLength(_taRecord_).
1. Let _relativeStart_ be ? ToIntegerOrInfinity(_start_).
- 1. If _relativeStart_ = -∞, let _k_ be 0.
- 1. Else if _relativeStart_ < 0, let _k_ be max(_len_ + _relativeStart_, 0).
- 1. Else, let _k_ be min(_relativeStart_, _len_).
- 1. If _end_ is *undefined*, let _relativeEnd_ be _len_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_).
- 1. If _relativeEnd_ = -∞, let _final_ be 0.
- 1. Else if _relativeEnd_ < 0, let _final_ be max(_len_ + _relativeEnd_, 0).
- 1. Else, let _final_ be min(_relativeEnd_, _len_).
- 1. Let _count_ be max(_final_ - _k_, 0).
- 1. Let _A_ be ? TypedArraySpeciesCreate(_O_, « 𝔽(_count_) »).
- 1. If _count_ > 0, then
- 1. Set _iieoRecord_ to MakeIntegerIndexedObjectWithBufferWitnessRecord(_O_, ~seq-cst~).
- 1. If IsIntegerIndexedObjectOutOfBounds(_iieoRecord_) is *true*, throw a *TypeError* exception.
- 1. Set _len_ to IntegerIndexedObjectLength(_iieoRecord_).
- 1. Set _final_ to min(_final_, _len_).
+ 1. If _relativeStart_ = -∞, let _startIndex_ be 0.
+ 1. Else if _relativeStart_ < 0, let _startIndex_ be max(_srcArrayLength_ + _relativeStart_, 0).
+ 1. Else, let _startIndex_ be min(_relativeStart_, _srcArrayLength_).
+ 1. If _end_ is *undefined*, let _relativeEnd_ be _srcArrayLength_; else let _relativeEnd_ be ? ToIntegerOrInfinity(_end_).
+ 1. If _relativeEnd_ = -∞, let _endIndex_ be 0.
+ 1. Else if _relativeEnd_ < 0, let _endIndex_ be max(_srcArrayLength_ + _relativeEnd_, 0).
+ 1. Else, let _endIndex_ be min(_relativeEnd_, _srcArrayLength_).
+ 1. Let _countBytes_ be max(_endIndex_ - _startIndex_, 0).
+ 1. Let _A_ be ? TypedArraySpeciesCreate(_O_, « 𝔽(_countBytes_) »).
+ 1. If _countBytes_ > 0, then
+ 1. Set _taRecord_ to MakeTypedArrayWithBufferWitnessRecord(_O_, ~seq-cst~).
+ 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception.
+ 1. Set _endIndex_ to min(_endIndex_, TypedArrayLength(_taRecord_)).
+ 1. Set _countBytes_ to max(_endIndex_ - _startIndex_, 0).
1. Let _srcType_ be TypedArrayElementType(_O_).
1. Let _targetType_ be TypedArrayElementType(_A_).
1. If _srcType_ is _targetType_, then
@@ -41102,17 +41096,18 @@
%TypedArray%.prototype.slice ( _start_, _end_ )
1. Let _targetBuffer_ be _A_.[[ViewedArrayBuffer]].
1. Let _elementSize_ be TypedArrayElementSize(_O_).
1. Let _srcByteOffset_ be _O_.[[ByteOffset]].
- 1. Let _srcByteIndex_ be (_k_ × _elementSize_) + _srcByteOffset_.
+ 1. Let _srcByteIndex_ be (_startIndex_ × _elementSize_) + _srcByteOffset_.
1. Let _targetByteIndex_ be _A_.[[ByteOffset]].
- 1. Let _limit_ be _targetByteIndex_ + min(_count_, _len_) × _elementSize_.
- 1. Repeat, while _targetByteIndex_ < _limit_,
+ 1. Let _endByteIndex_ be _targetByteIndex_ + (_countBytes_ × _elementSize_).
+ 1. Repeat, while _targetByteIndex_ < _endByteIndex_,
1. Let _value_ be GetValueFromBuffer(_srcBuffer_, _srcByteIndex_, ~uint8~, *true*, ~unordered~).
1. Perform SetValueInBuffer(_targetBuffer_, _targetByteIndex_, ~uint8~, _value_, *true*, ~unordered~).
1. Set _srcByteIndex_ to _srcByteIndex_ + 1.
1. Set _targetByteIndex_ to _targetByteIndex_ + 1.
1. Else,
1. Let _n_ be 0.
- 1. Repeat, while _k_ < _final_,
+ 1. Let _k_ be _startIndex_.
+ 1. Repeat, while _k_ < _endIndex_,
1. Let _Pk_ be ! ToString(𝔽(_k_)).
1. Let _kValue_ be ! Get(_O_, _Pk_).
1. Perform ! Set(_A_, ! ToString(𝔽(_n_)), _kValue_, *true*).
@@ -41129,8 +41124,8 @@
This method performs the following steps when called:
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 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. Let _k_ be 0.
1. Repeat, while _k_ < _len_,
@@ -41152,8 +41147,8 @@
%TypedArray%.prototype.sort ( _comparefn_ )
1. If _comparefn_ is not *undefined* and IsCallable(_comparefn_) is *false*, throw a *TypeError* exception.
1. Let _obj_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_obj_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 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_).
@@ -41170,26 +41165,26 @@
This method returns a new _TypedArray_ whose element type is the element type of this _TypedArray_ and whose ArrayBuffer is the ArrayBuffer of this _TypedArray_, referencing the elements in the interval from _begin_ (inclusive) to _end_ (exclusive). If either _begin_ or _end_ is negative, it refers to an index from the end of the array, as opposed to from the beginning.
This method returns a new _TypedArray_ whose element type is the element type of this _TypedArray_ and whose ArrayBuffer is the ArrayBuffer of this _TypedArray_, referencing the elements in the interval from _start_ (inclusive) to _end_ (exclusive). If either _start_ or _end_ is negative, it refers to an index from the end of the array, as opposed to from the beginning.
It performs the following steps when called:
1. Let _O_ be the *this* value.
1. Perform ? RequireInternalSlot(_O_, [[TypedArrayName]]).
1. Assert: _O_ has a [[ViewedArrayBuffer]] internal slot.
1. Let _buffer_ be _O_.[[ViewedArrayBuffer]].
- 1. Let _srcRecord_ be MakeIntegerIndexedObjectWithBufferWitnessRecord(_O_, ~seq-cst~).
- 1. If IsIntegerIndexedObjectOutOfBounds(_srcRecord_) is *true*, then
+ 1. Let _srcRecord_ be MakeTypedArrayWithBufferWitnessRecord(_O_, ~seq-cst~).
+ 1. If IsTypedArrayOutOfBounds(_srcRecord_) is *true*, then
1. Let _srcLength_ be 0.
1. Else,
- 1. Let _srcLength_ be IntegerIndexedObjectLength(_srcRecord_).
- 1. Let _relativeBegin_ be ? ToIntegerOrInfinity(_begin_).
- 1. If _relativeBegin_ = -∞, let _beginIndex_ be 0.
- 1. Else if _relativeBegin_ < 0, let _beginIndex_ be max(_srcLength_ + _relativeBegin_, 0).
- 1. Else, let _beginIndex_ be min(_relativeBegin_, _srcLength_).
+ 1. Let _srcLength_ be TypedArrayLength(_srcRecord_).
+ 1. Let _relativeStart_ be ? ToIntegerOrInfinity(_start_).
+ 1. If _relativeStart_ = -∞, let _startIndex_ be 0.
+ 1. Else if _relativeStart_ < 0, let _startIndex_ be max(_srcLength_ + _relativeStart_, 0).
+ 1. Else, let _startIndex_ be min(_relativeStart_, _srcLength_).
1. Let _elementSize_ be TypedArrayElementSize(_O_).
1. Let _srcByteOffset_ be _O_.[[ByteOffset]].
- 1. Let _beginByteOffset_ be _srcByteOffset_ + _beginIndex_ × _elementSize_.
+ 1. Let _beginByteOffset_ be _srcByteOffset_ + (_startIndex_ × _elementSize_).
1. If _O_.[[ArrayLength]] is ~auto~ and _end_ is *undefined*, then
1. Let _argumentsList_ be « _buffer_, 𝔽(_beginByteOffset_) ».
1. Else,
@@ -41197,7 +41192,7 @@
1. If _relativeEnd_ = -∞, let _endIndex_ be 0.
1. Else if _relativeEnd_ < 0, let _endIndex_ be max(_srcLength_ + _relativeEnd_, 0).
1. Else, let _endIndex_ be min(_relativeEnd_, _srcLength_).
- 1. Let _newLength_ be max(_endIndex_ - _beginIndex_, 0).
+ 1. Let _newLength_ be max(_endIndex_ - _startIndex_, 0).
1. Let _argumentsList_ be « _buffer_, 𝔽(_beginByteOffset_), 𝔽(_newLength_) ».
1. Return ? TypedArraySpeciesCreate(_O_, _argumentsList_).
@@ -41206,7 +41201,7 @@
This is a distinct method that implements the same algorithm as `Array.prototype.toLocaleString` as defined in except that IntegerIndexedObjectLength is called in place of performing a [[Get]] of *"length"*. The implementation of the algorithm may be optimized with the knowledge that the *this* value has a fixed length when the underlying buffer is not resizable and whose integer-indexed properties are not sparse. However, such optimization must not introduce any observable changes in the specified behaviour of the algorithm.
+
This is a distinct method that implements the same algorithm as `Array.prototype.toLocaleString` as defined in except that TypedArrayLength is called in place of performing a [[Get]] of *"length"*. The implementation of the algorithm may be optimized with the knowledge that the *this* value has a fixed length when the underlying buffer is not resizable and whose integer-indexed properties are not sparse. However, such optimization must not introduce any observable changes in the specified behaviour of the algorithm.
This method is not generic. ValidateTypedArray is called with the *this* value and ~seq-cst~ as arguments prior to evaluating the algorithm. If its result is an abrupt completion that exception is thrown instead of evaluating the algorithm.
If the ECMAScript implementation includes the ECMA-402 Internationalization API this method is based upon the algorithm for `Array.prototype.toLocaleString` that is in the ECMA-402 specification.
@@ -41218,8 +41213,8 @@
%TypedArray%.prototype.toReversed ( )
This method performs the following steps when called:
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _length_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
+ 1. Let _length_ be TypedArrayLength(_taRecord_).
1. Let _A_ be ? TypedArrayCreateSameType(_O_, « 𝔽(_length_) »).
1. Let _k_ be 0.
1. Repeat, while _k_ < _length_,
@@ -41238,8 +41233,8 @@
%TypedArray%.prototype.toSorted ( _comparefn_ )
1. If _comparefn_ is not *undefined* and IsCallable(_comparefn_) is *false*, throw a *TypeError* exception.
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 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:
@@ -41273,8 +41268,8 @@
%TypedArray%.prototype.with ( _index_, _value_ )
This method performs the following steps when called:
1. Let _O_ be the *this* value.
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
- 1. Let _len_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 1. Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~).
+ 1. Let _len_ be TypedArrayLength(_taRecord_).
1. Let _relativeIndex_ be ? ToIntegerOrInfinity(_index_).
1. If _relativeIndex_ ≥ 0, let _actualIndex_ be _relativeIndex_.
1. Else, let _actualIndex_ be _len_ + _relativeIndex_.
@@ -41285,7 +41280,7 @@
%TypedArray%.prototype.with ( _index_, _value_ )
1. Let _k_ be 0.
1. Repeat, while _k_ < _len_,
1. Let _Pk_ be ! ToString(𝔽(_k_)).
- 1. If _k_ is _actualIndex_, let _fromValue_ be _numericValue_.
+ 1. If _k_ = _actualIndex_, let _fromValue_ be _numericValue_.
1. Else, let _fromValue_ be ! Get(_O_, _Pk_).
1. Perform ! Set(_A_, _Pk_, _fromValue_, *true*).
1. Set _k_ to _k_ + 1.
@@ -41331,16 +41326,16 @@
1. Let _defaultConstructor_ be the intrinsic object associated with the constructor name _exemplar_.[[TypedArrayName]] in .
1. Let _constructor_ be ? SpeciesConstructor(_exemplar_, _defaultConstructor_).
- 1. Let _result_ be ? TypedArrayCreate(_constructor_, _argumentList_).
+ 1. Let _result_ be ? TypedArrayCreateFromConstructor(_constructor_, _argumentList_).
1. Assert: _result_ has [[TypedArrayName]] and [[ContentType]] internal slots.
1. If _result_.[[ContentType]] is not _exemplar_.[[ContentType]], throw a *TypeError* exception.
1. Return _result_.
-
+
- TypedArrayCreate (
+ TypedArrayCreateFromConstructor (
_constructor_: a constructor,
_argumentList_: a List of ECMAScript language values,
): either a normal completion containing a TypedArray or a throw completion
@@ -41351,10 +41346,10 @@
1. Let _newTypedArray_ be ? Construct(_constructor_, _argumentList_).
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_newTypedArray_, ~seq-cst~).
+ 1. Let _taRecord_ be ? ValidateTypedArray(_newTypedArray_, ~seq-cst~).
1. If the number of elements in _argumentList_ is 1 and _argumentList_[0] is a Number, then
- 1. If IsIntegerIndexedObjectOutOfBounds(_iieoRecord_) is *true*, throw a *TypeError* exception.
- 1. Let _length_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception.
+ 1. Let _length_ be TypedArrayLength(_taRecord_).
1. If _length_ < ℝ(_argumentList_[0]), throw a *TypeError* exception.
1. Return _newTypedArray_.
@@ -41373,7 +41368,7 @@
1. Let _constructor_ be the intrinsic object associated with the constructor name _exemplar_.[[TypedArrayName]] in .
- 1. Let _result_ be ? TypedArrayCreate(_constructor_, _argumentList_).
+ 1. Let _result_ be ? TypedArrayCreateFromConstructor(_constructor_, _argumentList_).
1. Assert: _result_ has [[TypedArrayName]] and [[ContentType]] internal slots.
1. Assert: _result_.[[ContentType]] is _exemplar_.[[ContentType]].
1. Return _result_.
@@ -41385,16 +41380,16 @@
ValidateTypedArray (
_O_: an ECMAScript language value,
_order_: ~seq-cst~ or ~unordered~,
- ): either a normal completion containing an Integer-Indexed Object With Buffer Witness Record or a throw completion
+ ): either a normal completion containing a TypedArray With Buffer Witness Record or a throw completion
1. Perform ? RequireInternalSlot(_O_, [[TypedArrayName]]).
1. Assert: _O_ has a [[ViewedArrayBuffer]] internal slot.
- 1. Let _iieoRecord_ be MakeIntegerIndexedObjectWithBufferWitnessRecord(_O_, _order_).
- 1. If IsIntegerIndexedObjectOutOfBounds(_iieoRecord_) is *true*, throw a *TypeError* exception.
- 1. Return _iieoRecord_.
+ 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_O_, _order_).
+ 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception.
+ 1. Return _taRecord_.
@@ -41516,7 +41511,7 @@
1. Let _proto_ be ? GetPrototypeFromConstructor(_newTarget_, _defaultProto_).
- 1. Let _obj_ be IntegerIndexedObjectCreate(_proto_).
+ 1. Let _obj_ be TypedArrayCreate(_proto_).
1. Assert: _obj_.[[ViewedArrayBuffer]] is *undefined*.
1. Set _obj_.[[TypedArrayName]] to _constructorName_.
1. If _constructorName_ is either *"BigInt64Array"* or *"BigUint64Array"*, set _obj_.[[ContentType]] to ~bigint~.
@@ -41547,9 +41542,9 @@
1. Let _srcType_ be TypedArrayElementType(_srcArray_).
1. Let _srcElementSize_ be TypedArrayElementSize(_srcArray_).
1. Let _srcByteOffset_ be _srcArray_.[[ByteOffset]].
- 1. Let _srcRecord_ be MakeIntegerIndexedObjectWithBufferWitnessRecord(_srcArray_, ~seq-cst~).
- 1. If IsIntegerIndexedObjectOutOfBounds(_srcRecord_) is *true*, throw a *TypeError* exception.
- 1. Let _elementLength_ be IntegerIndexedObjectLength(_srcRecord_).
+ 1. Let _srcRecord_ be MakeTypedArrayWithBufferWitnessRecord(_srcArray_, ~seq-cst~).
+ 1. If IsTypedArrayOutOfBounds(_srcRecord_) is *true*, throw a *TypeError* exception.
+ 1. Let _elementLength_ be TypedArrayLength(_srcRecord_).
1. Let _byteLength_ be _elementSize_ × _elementLength_.
1. If _elementType_ is _srcType_, then
1. Let _data_ be ? CloneArrayBuffer(_srcData_, _srcByteOffset_, _byteLength_).
@@ -41725,13 +41720,13 @@
_TypedArray_.prototype.BYTES_PER_ELEMENT
_TypedArray_.prototype.constructor
-
The initial value of a _TypedArray_`.prototype.constructor` is the corresponding %TypedArray% intrinsic object.
+
The initial value of the *"constructor"* property of the prototype for a given _TypedArray_ constructor is the constructor itself.
Properties of _TypedArray_ Instances
-
_TypedArray_ instances are Integer-Indexed exotic objects. Each _TypedArray_ instance inherits properties from the corresponding _TypedArray_ prototype object. Each _TypedArray_ instance has the following internal slots: [[TypedArrayName]], [[ViewedArrayBuffer]], [[ByteLength]], [[ByteOffset]], and [[ArrayLength]].
+
_TypedArray_ instances are TypedArrays. Each _TypedArray_ instance inherits properties from the corresponding _TypedArray_ prototype object. Each _TypedArray_ instance has the following internal slots: [[TypedArrayName]], [[ViewedArrayBuffer]], [[ByteLength]], [[ByteOffset]], and [[ArrayLength]].
@@ -41787,15 +41782,14 @@
1. Let _iteratorRecord_ be ? GetIterator(_iterable_, ~sync~).
1. Repeat,
- 1. Let _next_ be ? IteratorStep(_iteratorRecord_).
- 1. If _next_ is *false*, return _target_.
- 1. Let _nextItem_ be ? IteratorValue(_next_).
- 1. If _nextItem_ is not an Object, then
+ 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
+ 1. If _next_ is ~done~, return _target_.
+ 1. If _next_ is not an Object, then
1. Let _error_ be ThrowCompletion(a newly created *TypeError* object).
1. Return ? IteratorClose(_iteratorRecord_, _error_).
- 1. Let _k_ be Completion(Get(_nextItem_, *"0"*)).
+ 1. Let _k_ be Completion(Get(_next_, *"0"*)).
1. IfAbruptCloseIterator(_k_, _iteratorRecord_).
- 1. Let _v_ be Completion(Get(_nextItem_, *"1"*)).
+ 1. Let _v_ be Completion(Get(_next_, *"1"*)).
1. IfAbruptCloseIterator(_v_, _iteratorRecord_).
1. Let _status_ be Completion(Call(_adder_, _target_, « _k_, _v_ »)).
1. IfAbruptCloseIterator(_status_, _iteratorRecord_).
@@ -41814,6 +41808,25 @@
Properties of the Map Constructor
has the following properties:
+
+
Map.groupBy ( _items_, _callbackfn_ )
+
+
_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.
+
The return value of `groupBy` is a Map.
+
+
This function performs the following steps when called:
+
+ 1. Let _groups_ be ? GroupBy(_items_, _callbackfn_, ~zero~).
+ 1. Let _map_ be ! Construct(%Map%).
+ 1. For each Record { [[Key]], [[Elements]] } _g_ of _groups_, do
+ 1. Let _elements_ be CreateArrayFromList(_g_.[[Elements]]).
+ 1. Let _entry_ be the Record { [[Key]]: _g_.[[Key]], [[Value]]: _elements_ }.
+ 1. Append _entry_ to _map_.[[MapData]].
+ 1. Return _map_.
+
+
+
Map.prototype
The initial value of `Map.prototype` is the Map prototype object.
@@ -42101,10 +42114,9 @@
Set ( [ _iterable_ ] )
1. If IsCallable(_adder_) is *false*, throw a *TypeError* exception.
1. Let _iteratorRecord_ be ? GetIterator(_iterable_, ~sync~).
1. Repeat,
- 1. Let _next_ be ? IteratorStep(_iteratorRecord_).
- 1. If _next_ is *false*, return _set_.
- 1. Let _nextValue_ be ? IteratorValue(_next_).
- 1. Let _status_ be Completion(Call(_adder_, _set_, « _nextValue_ »)).
+ 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
+ 1. If _next_ is ~done~, return _set_.
+ 1. Let _status_ be Completion(Call(_adder_, _set_, « _next_ »)).
1. IfAbruptCloseIterator(_status_, _iteratorRecord_).
@@ -42540,10 +42552,9 @@
WeakSet ( [ _iterable_ ] )
1. If IsCallable(_adder_) is *false*, throw a *TypeError* exception.
1. Let _iteratorRecord_ be ? GetIterator(_iterable_, ~sync~).
1. Repeat,
- 1. Let _next_ be ? IteratorStep(_iteratorRecord_).
- 1. If _next_ is *false*, return _set_.
- 1. Let _nextValue_ be ? IteratorValue(_next_).
- 1. Let _status_ be Completion(Call(_adder_, _set_, « _nextValue_ »)).
+ 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
+ 1. If _next_ is ~done~, return _set_.
+ 1. Let _status_ be Completion(Call(_adder_, _set_, « _next_ »)).
1. IfAbruptCloseIterator(_status_, _iteratorRecord_).
@@ -42722,6 +42733,40 @@
+
+
+ ArrayBufferCopyAndDetach (
+ _arrayBuffer_: an ECMAScript language value,
+ _newLength_: an ECMAScript language value,
+ _preserveResizability_: ~preserve-resizability~ or ~fixed-length~,
+ ): either a normal completion containing an ArrayBuffer or a throw completion
+
+
+
+
+ 1. Perform ? RequireInternalSlot(_arrayBuffer_, [[ArrayBufferData]]).
+ 1. If IsSharedArrayBuffer(_arrayBuffer_) is *true*, throw a *TypeError* exception.
+ 1. If _newLength_ is *undefined*, then
+ 1. Let _newByteLength_ be _arrayBuffer_.[[ArrayBufferByteLength]].
+ 1. Else,
+ 1. Let _newByteLength_ be ? ToIndex(_newLength_).
+ 1. If IsDetachedBuffer(_arrayBuffer_) is *true*, throw a *TypeError* exception.
+ 1. If _preserveResizability_ is ~preserve-resizability~ and IsFixedLengthArrayBuffer(_arrayBuffer_) is *false*, then
+ 1. Let _newMaxByteLength_ be _arrayBuffer_.[[ArrayBufferMaxByteLength]].
+ 1. Else,
+ 1. Let _newMaxByteLength_ be ~empty~.
+ 1. If _arrayBuffer_.[[ArrayBufferDetachKey]] is not *undefined*, throw a *TypeError* exception.
+ 1. Let _newBuffer_ be ? AllocateArrayBuffer(%ArrayBuffer%, _newByteLength_, _newMaxByteLength_).
+ 1. Let _copyLength_ be min(_newByteLength_, _arrayBuffer_.[[ArrayBufferByteLength]]).
+ 1. Let _fromBlock_ be _arrayBuffer_.[[ArrayBufferData]].
+ 1. Let _toBlock_ be _newBuffer_.[[ArrayBufferData]].
+ 1. Perform CopyDataBlockBytes(_toBlock_, 0, _fromBlock_, 0, _copyLength_).
+ 1. NOTE: Neither creation of the new Data Block nor copying from the old Data Block are observable. Implementations may implement this method as a zero-copy move or a `realloc`.
+ 1. Perform ! DetachArrayBuffer(_arrayBuffer_).
+ 1. Return _newBuffer_.
+
+
+
IsDetachedBuffer (
@@ -42744,6 +42789,8 @@
): either a normal completion containing ~unused~ or a throw completion
+
skip global checks
+
true
1. Assert: IsSharedArrayBuffer(_arrayBuffer_) is *false*.
@@ -43166,6 +43213,17 @@
ArrayBuffer.prototype.constructor
The initial value of `ArrayBuffer.prototype.constructor` is %ArrayBuffer%.
+
+
get ArrayBuffer.prototype.detached
+
`ArrayBuffer.prototype.detached` 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. Perform ? RequireInternalSlot(_O_, [[ArrayBufferData]]).
+ 1. If IsSharedArrayBuffer(_O_) is *true*, throw a *TypeError* exception.
+ 1. Return IsDetachedBuffer(_O_).
+
+
+
get ArrayBuffer.prototype.maxByteLength
`ArrayBuffer.prototype.maxByteLength` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps when called:
The initial value of the @@toStringTag property is the String value *"SharedArrayBuffer"*.
This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
@@ -44218,37 +44294,37 @@
ValidateIntegerTypedArray (
_typedArray_: an ECMAScript language value,
_waitable_: a Boolean,
- ): either a normal completion containing an Integer-Indexed Object With Buffer Witness Record, or a throw completion
+ ): either a normal completion containing a TypedArray With Buffer Witness Record, or a throw completion
- 1. Let _iieoRecord_ be ? ValidateTypedArray(_typedArray_, ~unordered~).
+ 1. Let _taRecord_ be ? ValidateTypedArray(_typedArray_, ~unordered~).
1. NOTE: Bounds checking is not a synchronizing operation when _typedArray_'s backing buffer is a growable SharedArrayBuffer.
1. If _waitable_ is *true*, then
1. If _typedArray_.[[TypedArrayName]] is neither *"Int32Array"* nor *"BigInt64Array"*, throw a *TypeError* exception.
1. Else,
1. Let _type_ be TypedArrayElementType(_typedArray_).
1. If IsUnclampedIntegerElementType(_type_) is *false* and IsBigIntElementType(_type_) is *false*, throw a *TypeError* exception.
- 1. Return _iieoRecord_.
+ 1. Return _taRecord_.
ValidateAtomicAccess (
- _iieoRecord_: an Integer-Indexed Object With Buffer Witness Record,
+ _taRecord_: a TypedArray With Buffer Witness Record,
_requestIndex_: an ECMAScript language value,
): either a normal completion containing an integer or a throw completion
- 1. Let _length_ be IntegerIndexedObjectLength(_iieoRecord_).
+ 1. Let _length_ be TypedArrayLength(_taRecord_).
1. Let _accessIndex_ be ? ToIndex(_requestIndex_).
1. Assert: _accessIndex_ ≥ 0.
1. If _accessIndex_ ≥ _length_, throw a *RangeError* exception.
- 1. Let _typedArray_ be _iieoRecord_.[[Object]].
+ 1. Let _typedArray_ be _taRecord_.[[Object]].
1. Let _elementSize_ be TypedArrayElementSize(_typedArray_).
1. Let _offset_ be _typedArray_.[[ByteOffset]].
1. Return (_accessIndex_ × _elementSize_) + _offset_.
@@ -44267,15 +44343,15 @@
1. If _waitable_ is not present, set _waitable_ to *false*.
- 1. Let _iieoRecord_ be ? ValidateIntegerTypedArray(_typedArray_, _waitable_).
- 1. Return ? ValidateAtomicAccess(_iieoRecord_, _requestIndex_).
+ 1. Let _taRecord_ be ? ValidateIntegerTypedArray(_typedArray_, _waitable_).
+ 1. Return ? ValidateAtomicAccess(_taRecord_, _requestIndex_).
RevalidateAtomicAccess (
- _typedArray_: an Integer-Indexed exotic object,
+ _typedArray_: a TypedArray,
_byteIndexInBuffer_: an integer,
): either a normal completion containing ~unused~ or a throw completion
@@ -44284,11 +44360,11 @@
This operation revalidates the index within the backing buffer for atomic operations after all argument coercions are performed in Atomics methods, as argument coercions can have arbitrary side effects, which could cause the buffer to become out of bounds. This operation does not throw when _typedArray_'s backing buffer is a SharedArrayBuffer.
- 1. Let _iieoRecord_ be MakeIntegerIndexedObjectWithBufferWitnessRecord(_typedArray_, ~unordered~).
+ 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_typedArray_, ~unordered~).
1. NOTE: Bounds checking is not a synchronizing operation when _typedArray_'s backing buffer is a growable SharedArrayBuffer.
- 1. If IsIntegerIndexedObjectOutOfBounds(_iieoRecord_) is *true*, throw a *TypeError* exception.
+ 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception.
1. Assert: _byteIndexInBuffer_ ≥ _typedArray_.[[ByteOffset]].
- 1. If _byteIndexInBuffer_ ≥ _iieoRecord_.[[CachedBufferByteLength]], throw a *RangeError* exception.
+ 1. If _byteIndexInBuffer_ ≥ _taRecord_.[[CachedBufferByteLength]], throw a *RangeError* exception.
1. Return ~unused~.
@@ -44487,10 +44563,10 @@
- 1. Let _iieoRecord_ be ? ValidateIntegerTypedArray(_typedArray_, *true*).
- 1. Let _buffer_ be _iieoRecord_.[[Object]].[[ViewedArrayBuffer]].
+ 1. Let _taRecord_ be ? ValidateIntegerTypedArray(_typedArray_, *true*).
+ 1. Let _buffer_ be _taRecord_.[[Object]].[[ViewedArrayBuffer]].
1. If IsSharedArrayBuffer(_buffer_) is *false*, throw a *TypeError* exception.
- 1. Let _i_ be ? ValidateAtomicAccess(_iieoRecord_, _index_).
+ 1. Let _i_ be ? ValidateAtomicAccess(_taRecord_, _index_).
1. Let _arrayTypeName_ be _typedArray_.[[TypedArrayName]].
1. If _arrayTypeName_ is *"BigInt64Array"*, let _v_ be ? ToBigInt64(_value_).
1. Else, let _v_ be ? ToInt32(_value_).
@@ -44516,7 +44592,7 @@
1. Perform ! CreateDataPropertyOrThrow(_resultObject_, *"async"*, *false*).
1. Perform ! CreateDataPropertyOrThrow(_resultObject_, *"value"*, *"not-equal"*).
1. Return _resultObject_.
- 1. If _t_ is 0 and _mode_ is ~async~, then
+ 1. If _t_ = 0 and _mode_ is ~async~, then
1. NOTE: There is no special handling of synchronous immediate timeouts. Asynchronous immediate timeouts have special handling in order to fail fast and avoid unnecessary Promise jobs.
1. Perform LeaveCriticalSection(_WL_).
1. Perform ! CreateDataPropertyOrThrow(_resultObject_, *"async"*, *false*).
@@ -44906,7 +44982,7 @@
JSON.parse ( _text_ [ , _reviver_ ] )
1. Let _jsonString_ be ? ToString(_text_).
1. [id="step-json-parse-validate"] Parse StringToCodePoints(_jsonString_) as a JSON text as specified in ECMA-404. Throw a *SyntaxError* exception if it is not a valid JSON text as defined in that specification.
1. Let _scriptString_ be the string-concatenation of *"("*, _jsonString_, and *");"*.
- 1. [id="step-json-parse-parse"] Let _script_ be ParseText(StringToCodePoints(_scriptString_), |Script|).
+ 1. [id="step-json-parse-parse"] Let _script_ be ParseText(_scriptString_, |Script|).
1. NOTE: The early error rules defined in have special handling for the above invocation of ParseText.
1. Assert: _script_ is a Parse Node.
1. [id="step-json-parse-eval"] Let _completion_ be Completion(Evaluation of _script_).
@@ -45925,7 +46001,7 @@
%AsyncIteratorPrototype% [ @@asyncIterator ] ( )
Async-from-Sync Iterator Objects
-
An Async-from-Sync Iterator object is an async iterator that adapts a specific synchronous iterator. There is not a named constructor for Async-from-Sync Iterator objects. Instead, Async-from-Sync iterator objects are created by the CreateAsyncFromSyncIterator abstract operation as needed.
+
An Async-from-Sync Iterator object is an async iterator that adapts a specific synchronous iterator. Async-from-Sync Iterator objects are never directly accessible to ECMAScript code. There is not a named constructor for Async-from-Sync Iterator objects. Instead, Async-from-Sync iterator objects are created by the CreateAsyncFromSyncIterator abstract operation as needed.
@@ -45953,6 +46029,7 @@
The %AsyncFromSyncIteratorPrototype% Object
has properties that are inherited by all Async-from-Sync Iterator Objects.
is an ordinary object.
has a [[Prototype]] internal slot whose value is %AsyncIteratorPrototype%.
Async-from-Sync Iterator instances are ordinary objects that inherit properties from the %AsyncFromSyncIteratorPrototype% intrinsic object. Async-from-Sync Iterator instances are initially created with the internal slots listed in . Async-from-Sync Iterator instances are not directly observable from ECMAScript code.
+
Async-from-Sync Iterator instances are ordinary objects that inherit properties from the %AsyncFromSyncIteratorPrototype% intrinsic object. Async-from-Sync Iterator instances are initially created with the internal slots listed in .
@@ -46174,7 +46251,7 @@
IfAbruptRejectPromise ( _value_, _capability_ )
1. Perform ? Call(_capability_.[[Reject]], *undefined*, « _value_.[[Value]] »).
1. Return _capability_.[[Promise]].
1. Else,
- 1. Set _value_ to _value_.[[Value]].
+ 1. Set _value_ to ! _value_.
@@ -46618,21 +46695,15 @@
1. Let _remainingElementsCount_ be the Record { [[Value]]: 1 }.
1. Let _index_ be 0.
1. Repeat,
- 1. Let _next_ be Completion(IteratorStep(_iteratorRecord_)).
- 1. If _next_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_next_).
- 1. If _next_ is *false*, then
- 1. Set _iteratorRecord_.[[Done]] to *true*.
+ 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
+ 1. If _next_ is ~done~, then
1. Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] - 1.
1. If _remainingElementsCount_.[[Value]] = 0, then
1. Let _valuesArray_ be CreateArrayFromList(_values_).
1. Perform ? Call(_resultCapability_.[[Resolve]], *undefined*, « _valuesArray_ »).
1. Return _resultCapability_.[[Promise]].
- 1. Let _nextValue_ be Completion(IteratorValue(_next_)).
- 1. If _nextValue_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_nextValue_).
1. Append *undefined* to _values_.
- 1. Let _nextPromise_ be ? Call(_promiseResolve_, _constructor_, « _nextValue_ »).
+ 1. Let _nextPromise_ be ? Call(_promiseResolve_, _constructor_, « _next_ »).
1. Let _steps_ be the algorithm steps defined in .
1. Let _length_ be the number of non-optional parameters of the function definition in .
1. Let _onFulfilled_ be CreateBuiltinFunction(_steps_, _length_, *""*, « [[AlreadyCalled]], [[Index]], [[Values]], [[Capability]], [[RemainingElements]] »).
@@ -46706,21 +46777,15 @@
1. Let _remainingElementsCount_ be the Record { [[Value]]: 1 }.
1. Let _index_ be 0.
1. Repeat,
- 1. Let _next_ be Completion(IteratorStep(_iteratorRecord_)).
- 1. If _next_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_next_).
- 1. If _next_ is *false*, then
- 1. Set _iteratorRecord_.[[Done]] to *true*.
+ 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
+ 1. If _next_ is ~done~, then
1. Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] - 1.
1. If _remainingElementsCount_.[[Value]] = 0, then
1. Let _valuesArray_ be CreateArrayFromList(_values_).
1. Perform ? Call(_resultCapability_.[[Resolve]], *undefined*, « _valuesArray_ »).
1. Return _resultCapability_.[[Promise]].
- 1. Let _nextValue_ be Completion(IteratorValue(_next_)).
- 1. If _nextValue_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_nextValue_).
1. Append *undefined* to _values_.
- 1. Let _nextPromise_ be ? Call(_promiseResolve_, _constructor_, « _nextValue_ »).
+ 1. Let _nextPromise_ be ? Call(_promiseResolve_, _constructor_, « _next_ »).
1. Let _stepsFulfilled_ be the algorithm steps defined in .
1. Let _lengthFulfilled_ be the number of non-optional parameters of the function definition in .
1. Let _onFulfilled_ be CreateBuiltinFunction(_stepsFulfilled_, _lengthFulfilled_, *""*, « [[AlreadyCalled]], [[Index]], [[Values]], [[Capability]], [[RemainingElements]] »).
@@ -46833,22 +46898,16 @@
1. Let _remainingElementsCount_ be the Record { [[Value]]: 1 }.
1. Let _index_ be 0.
1. Repeat,
- 1. Let _next_ be Completion(IteratorStep(_iteratorRecord_)).
- 1. If _next_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_next_).
- 1. If _next_ is *false*, then
- 1. Set _iteratorRecord_.[[Done]] to *true*.
+ 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
+ 1. If _next_ is ~done~, then
1. Set _remainingElementsCount_.[[Value]] to _remainingElementsCount_.[[Value]] - 1.
1. If _remainingElementsCount_.[[Value]] = 0, then
1. Let _error_ be a newly created *AggregateError* object.
1. Perform ! DefinePropertyOrThrow(_error_, *"errors"*, PropertyDescriptor { [[Configurable]]: *true*, [[Enumerable]]: *false*, [[Writable]]: *true*, [[Value]]: CreateArrayFromList(_errors_) }).
1. Return ThrowCompletion(_error_).
1. Return _resultCapability_.[[Promise]].
- 1. Let _nextValue_ be Completion(IteratorValue(_next_)).
- 1. If _nextValue_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_nextValue_).
1. Append *undefined* to _errors_.
- 1. Let _nextPromise_ be ? Call(_promiseResolve_, _constructor_, « _nextValue_ »).
+ 1. Let _nextPromise_ be ? Call(_promiseResolve_, _constructor_, « _next_ »).
1. Let _stepsRejected_ be the algorithm steps defined in .
1. Let _lengthRejected_ be the number of non-optional parameters of the function definition in .
1. Let _onRejected_ be CreateBuiltinFunction(_stepsRejected_, _lengthRejected_, *""*, « [[AlreadyCalled]], [[Index]], [[Errors]], [[Capability]], [[RemainingElements]] »).
@@ -46929,16 +46988,10 @@
1. Repeat,
- 1. Let _next_ be Completion(IteratorStep(_iteratorRecord_)).
- 1. If _next_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_next_).
- 1. If _next_ is *false*, then
- 1. Set _iteratorRecord_.[[Done]] to *true*.
+ 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_).
+ 1. If _next_ is ~done~, then
1. Return _resultCapability_.[[Promise]].
- 1. Let _nextValue_ be Completion(IteratorValue(_next_)).
- 1. If _nextValue_ is an abrupt completion, set _iteratorRecord_.[[Done]] to *true*.
- 1. ReturnIfAbrupt(_nextValue_).
- 1. Let _nextPromise_ be ? Call(_promiseResolve_, _constructor_, « _nextValue_ »).
+ 1. Let _nextPromise_ be ? Call(_promiseResolve_, _constructor_, « _next_ »).
1. Perform ? Invoke(_nextPromise_, *"then"*, « _resultCapability_.[[Resolve]], _resultCapability_.[[Reject]] »).
@@ -46992,6 +47045,20 @@
+
+
Promise.withResolvers ( )
+
This function returns an object with three properties: a new promise together with the `resolve` and `reject` functions associated with it.
+
+ 1. Let _C_ be the *this* value.
+ 1. Let _promiseCapability_ be ? NewPromiseCapability(_C_).
+ 1. Let _obj_ be OrdinaryObjectCreate(%Object.prototype%).
+ 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"promise"*, _promiseCapability_.[[Promise]]).
+ 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"resolve"*, _promiseCapability_.[[Resolve]]).
+ 1. Perform ! CreateDataPropertyOrThrow(_obj_, *"reject"*, _promiseCapability_.[[Reject]]).
+ 1. Return _obj_.
+
+
+
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:
@@ -47208,7 +47275,7 @@
Properties of Promise Instances
GeneratorFunction Objects
GeneratorFunctions are functions that are usually created by evaluating |GeneratorDeclaration|s, |GeneratorExpression|s, and |GeneratorMethod|s. They may also be created by calling the %GeneratorFunction% intrinsic.
-
+
@@ -47272,7 +47339,7 @@
GeneratorFunction.prototype.constructor
GeneratorFunction.prototype.prototype
-
The initial value of `GeneratorFunction.prototype.prototype` is the Generator prototype object.
+
The initial value of `GeneratorFunction.prototype.prototype` is %GeneratorPrototype%.
This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
@@ -47374,7 +47441,7 @@
AsyncGeneratorFunction.prototype.constructor
AsyncGeneratorFunction.prototype.prototype
-
The initial value of `AsyncGeneratorFunction.prototype.prototype` is the AsyncGenerator prototype object.
+
The initial value of `AsyncGeneratorFunction.prototype.prototype` is %AsyncGeneratorPrototype%.
This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
@@ -47414,12 +47481,12 @@
prototype
Generator Objects
-
A Generator is an instance of a generator function and conforms to both the Iterator and Iterable interfaces.
-
Generator instances directly inherit properties from the object that is the initial value of the *"prototype"* property of the Generator function that created the instance. Generator instances indirectly inherit properties from the Generator Prototype intrinsic, %GeneratorFunction.prototype.prototype%.
+
A Generator is created by calling a generator function and conforms to both the Iterator and Iterable interfaces.
+
Generator instances directly inherit properties from the initial value of the *"prototype"* property of the generator function that created the instance. Generator instances indirectly inherit properties from %GeneratorPrototype%.
-
Properties of the Generator Prototype Object
-
The Generator prototype object:
+
The %GeneratorPrototype% Object
+
The %GeneratorPrototype% object:
is %GeneratorFunction.prototype.prototype%.
is an ordinary object.
@@ -47429,20 +47496,20 @@
Properties of the Generator Prototype Object
-
Generator.prototype.constructor
-
The initial value of `Generator.prototype.constructor` is %GeneratorFunction.prototype%.
+
%GeneratorPrototype%.constructor
+
The initial value of %GeneratorPrototype%`.constructor` is %GeneratorFunction.prototype%.
This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
This method performs the following steps when called:
1. Let _g_ be the *this* value.
@@ -47452,7 +47519,7 @@
Generator.prototype.return ( _value_ )
-
Generator.prototype.throw ( _exception_ )
+
%GeneratorPrototype%.throw ( _exception_ )
This method performs the following steps when called:
1. Let _g_ be the *this* value.
@@ -47462,7 +47529,7 @@
Generator.prototype.throw ( _exception_ )
-
Generator.prototype [ @@toStringTag ]
+
%GeneratorPrototype% [ @@toStringTag ]
The initial value of the @@toStringTag property is the String value *"Generator"*.
This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
@@ -47549,12 +47616,12 @@
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_.[[GeneratorState]] to ~completed~.
1. NOTE: Once a generator enters the ~completed~ state it never leaves it and its associated execution context is never resumed. Any execution state associated with _acGenerator_ can be discarded at this point.
- 1. If _result_.[[Type]] is ~normal~, then
+ 1. If _result_ is a normal completion, then
1. Let _resultValue_ be *undefined*.
- 1. Else if _result_.[[Type]] is ~return~, then
+ 1. Else if _result_ is a return completion, then
1. Let _resultValue_ be _result_.[[Value]].
1. Else,
- 1. Assert: _result_.[[Type]] is ~throw~.
+ 1. Assert: _result_ is a throw completion.
1. Return ? _result_.
1. Return CreateIterResultObject(_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.
@@ -47626,7 +47693,7 @@
1. NOTE: Once a generator enters the ~completed~ state it never leaves it and its associated execution context is never resumed. Any execution state associated with _generator_ can be discarded at this point.
1. Set _state_ to ~completed~.
1. If _state_ is ~completed~, then
- 1. If _abruptCompletion_.[[Type]] is ~return~, then
+ 1. If _abruptCompletion_ is a return completion, then
1. Return CreateIterResultObject(_abruptCompletion_.[[Value]], *true*).
1. Return ? _abruptCompletion_.
1. Assert: _state_ is ~suspended-yield~.
@@ -47724,13 +47791,13 @@
AsyncGenerator Objects
-
An AsyncGenerator is an instance of an async generator function and conforms to both the AsyncIterator and AsyncIterable interfaces.
+
An AsyncGenerator is created by calling an async generator function and conforms to both the AsyncIterator and AsyncIterable interfaces.
-
AsyncGenerator instances directly inherit properties from the object that is the initial value of the *"prototype"* property of the AsyncGenerator function that created the instance. AsyncGenerator instances indirectly inherit properties from the AsyncGenerator Prototype intrinsic, %AsyncGeneratorFunction.prototype.prototype%.
+
AsyncGenerator instances directly inherit properties from the initial value of the *"prototype"* property of the async generator function that created the instance. AsyncGenerator instances indirectly inherit properties from %AsyncGeneratorPrototype%.
-
Properties of the AsyncGenerator Prototype Object
-
The AsyncGenerator prototype object:
+
The %AsyncGeneratorPrototype% Object
+
The %AsyncGeneratorPrototype% object:
is %AsyncGeneratorFunction.prototype.prototype%.
is an ordinary object.
@@ -47740,13 +47807,13 @@
Properties of the AsyncGenerator Prototype Object
-
AsyncGenerator.prototype.constructor
-
The initial value of `AsyncGenerator.prototype.constructor` is %AsyncGeneratorFunction.prototype%.
+
%AsyncGeneratorPrototype%.constructor
+
The initial value of %AsyncGeneratorPrototype%`.constructor` is %AsyncGeneratorFunction.prototype%.
This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
-
AsyncGenerator.prototype.next ( _value_ )
+
%AsyncGeneratorPrototype%.next ( _value_ )
1. Let _generator_ be the *this* value.
1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%).
@@ -47768,7 +47835,7 @@
AsyncGenerator.prototype.next ( _value_ )
-
AsyncGenerator.prototype.return ( _value_ )
+
%AsyncGeneratorPrototype%.return ( _value_ )
1. Let _generator_ be the *this* value.
1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%).
@@ -47789,7 +47856,7 @@
AsyncGenerator.prototype.return ( _value_ )
-
AsyncGenerator.prototype.throw ( _exception_ )
+
%AsyncGeneratorPrototype%.throw ( _exception_ )
1. Let _generator_ be the *this* value.
1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%).
@@ -47813,7 +47880,7 @@
AsyncGenerator.prototype.throw ( _exception_ )
-
AsyncGenerator.prototype [ @@toStringTag ]
+
%AsyncGeneratorPrototype% [ @@toStringTag ]
The initial value of the @@toStringTag property is the String value *"AsyncGenerator"*.
This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
@@ -47905,8 +47972,8 @@
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. If _result_.[[Type]] is ~normal~, set _result_ to NormalCompletion(*undefined*).
- 1. If _result_.[[Type]] is ~return~, set _result_ to NormalCompletion(_result_.[[Value]]).
+ 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*).
1. Perform AsyncGeneratorDrainQueue(_acGenerator_).
1. Return *undefined*.
@@ -47970,10 +48037,10 @@
1. Remove the first element from _generator_.[[AsyncGeneratorQueue]].
1. Let _promiseCapability_ be _next_.[[Capability]].
1. Let _value_ be _completion_.[[Value]].
- 1. If _completion_.[[Type]] is ~throw~, then
+ 1. If _completion_ is a throw completion, then
1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _value_ »).
1. Else,
- 1. Assert: _completion_.[[Type]] is ~normal~.
+ 1. Assert: _completion_ is a normal completion.
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_.
@@ -48018,10 +48085,10 @@
- 1. If _resumptionValue_.[[Type]] is not ~return~, return ? _resumptionValue_.
+ 1. If _resumptionValue_ is not a return completion, return ? _resumptionValue_.
1. Let _awaited_ be Completion(Await(_resumptionValue_.[[Value]])).
- 1. If _awaited_.[[Type]] is ~throw~, return ? _awaited_.
- 1. Assert: _awaited_.[[Type]] is ~normal~.
+ 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~ }.
@@ -48073,7 +48140,7 @@
1. Assert: _queue_ is not empty.
1. Let _next_ be the first element of _queue_.
1. Let _completion_ be Completion(_next_.[[Completion]]).
- 1. Assert: _completion_.[[Type]] is ~return~.
+ 1. Assert: _completion_ is a return completion.
1. Let _promise_ be ? PromiseResolve(%Promise%, _completion_.[[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~.
@@ -48112,12 +48179,12 @@
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_.[[Type]] is ~return~, then
+ 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_.[[Type]] is ~normal~, then
+ 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*.
@@ -48219,7 +48286,7 @@
Properties of the AsyncFunction Prototype Object
AsyncFunction.prototype.constructor
-
The initial value of `AsyncFunction.prototype.constructor` is %AsyncFunction%
+
The initial value of `AsyncFunction.prototype.constructor` is %AsyncFunction%.
This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
@@ -48282,19 +48349,18 @@
- 1. Assert: _promiseCapability_ is a PromiseCapability Record.
1. Let _runningContext_ be the running execution context.
1. Let _closure_ be a new Abstract Closure with no parameters that captures _promiseCapability_ and _asyncBody_ and performs the following steps when called:
1. Let _acAsyncContext_ be the running execution context.
1. Let _result_ be Completion(Evaluation of _asyncBody_).
1. Assert: If we return here, the async function either threw an exception or performed an implicit or explicit return; all awaiting is done.
1. Remove _acAsyncContext_ 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. If _result_.[[Type]] is ~normal~, then
+ 1. If _result_ is a normal completion, then
1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « *undefined* »).
- 1. Else if _result_.[[Type]] is ~return~, then
+ 1. Else if _result_ is a return completion, then
1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _result_.[[Value]] »).
1. Else,
- 1. Assert: _result_.[[Type]] is ~throw~.
+ 1. Assert: _result_ is a throw completion.
1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _result_.[[Value]] »).
1. [id="step-asyncblockstart-return-undefined"] Return ~unused~.
1. Set the code evaluation state of _asyncContext_ such that when evaluation is resumed for that execution context, _closure_ will be called with no arguments.
@@ -49083,7 +49149,7 @@
Tear Free Reads
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_ is not _V_, and _execution_.[[ReadsFrom]] contains (_R_, _V_), then
+ 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. Return *false*.
1. Return *true*.
@@ -49143,7 +49209,7 @@
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*.
- 1. If _E_ is not _D_, then
+ 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 _E_ and _D_ are both WriteSharedMemory or ReadModifyWriteSharedMemory events and _E_ and _D_ do not have disjoint ranges, then
1. Return *true*.
@@ -49693,6 +49759,15 @@
HTML-like Comments
The syntax and semantics of is extended as follows except that this extension is not allowed when parsing source text using the goal symbol |Module|:
1. Else if _k_ + 3 ≤ _len_, then
1. Set _hexDigits_ to the substring of _string_ from _k_ + 1 to _k_ + 3.
1. Set _optionalAdvance_ to 2.
- 1. Let _parseResult_ be ParseText(StringToCodePoints(_hexDigits_), |HexDigits[~Sep]|).
+ 1. Let _parseResult_ be ParseText(_hexDigits_, |HexDigits[~Sep]|).
1. If _parseResult_ is a Parse Node, then
1. Let _n_ be the MV of _parseResult_.
1. Set _C_ to the code unit whose numeric value is _n_.
@@ -50468,7 +50543,7 @@
Changes to FunctionDeclarationInstantiation
1. If _strict_ is *false*, then
1. For each |FunctionDeclaration| _f_ that is directly contained in the |StatementList| of a |Block|, |CaseClause|, or |DefaultClause|, do
- 1. Let _F_ be StringValue of the |BindingIdentifier| of _f_.
+ 1. Let _F_ be the StringValue of the |BindingIdentifier| of _f_.
1. If replacing the |FunctionDeclaration| _f_ with a |VariableStatement| that has _F_ as a |BindingIdentifier| would not produce any Early Errors for _func_ and _parameterNames_ does not contain _F_, then
1. NOTE: A var binding for _F_ is only instantiated here if it is neither a VarDeclaredName, the name of a formal parameter, or another |FunctionDeclaration|.
1. If _instantiatedVarNames_ does not contain _F_ and _F_ is not *"arguments"*, then
@@ -50489,11 +50564,11 @@
Changes to GlobalDeclarationInstantiation
During GlobalDeclarationInstantiation the following steps are performed in place of step :
1. Perform the following steps:
- 1. Let _strict_ be IsStrict of _script_.
+ 1. Let _strict_ be ScriptIsStrict of _script_.
1. If _strict_ is *false*, then
1. Let _declaredFunctionOrVarNames_ be the list-concatenation of _declaredFunctionNames_ and _declaredVarNames_.
1. For each |FunctionDeclaration| _f_ that is directly contained in the |StatementList| of a |Block|, |CaseClause|, or |DefaultClause| Contained within _script_, do
- 1. Let _F_ be StringValue of the |BindingIdentifier| of _f_.
+ 1. Let _F_ be the StringValue of the |BindingIdentifier| of _f_.
1. If replacing the |FunctionDeclaration| _f_ with a |VariableStatement| that has _F_ as a |BindingIdentifier| would not produce any Early Errors for _script_, then
1. If _env_.HasLexicalDeclaration(_F_) is *false*, then
1. Let _fnDefinable_ be ? _env_.CanDeclareGlobalVar(_F_).
@@ -50518,7 +50593,7 @@
Changes to EvalDeclarationInstantiation
1. If _strict_ is *false*, then
1. Let _declaredFunctionOrVarNames_ be the list-concatenation of _declaredFunctionNames_ and _declaredVarNames_.
1. For each |FunctionDeclaration| _f_ that is directly contained in the |StatementList| of a |Block|, |CaseClause|, or |DefaultClause| Contained within _body_, do
- 1. Let _F_ be StringValue of the |BindingIdentifier| of _f_.
+ 1. Let _F_ be the StringValue of the |BindingIdentifier| of _f_.
1. If replacing the |FunctionDeclaration| _f_ with a |VariableStatement| that has _F_ as a |BindingIdentifier| would not produce any Early Errors for _body_, then
1. Let _bindingExists_ be *false*.
1. Let _thisEnv_ be _lexEnv_.
@@ -50560,7 +50635,7 @@
Changes to Block Static Semantics: Early Errors
Block : `{` StatementList `}`
- It is a Syntax Error if the LexicallyDeclaredNames of |StatementList| contains any duplicate entries, unless the source text matched by this production is not strict mode code and the duplicate entries are only bound by FunctionDeclarations.
+ It is a Syntax Error if the LexicallyDeclaredNames of |StatementList| contains any duplicate entries, unless IsStrict(this production) is *false* and the duplicate entries are only bound by FunctionDeclarations.
It is a Syntax Error if any element of the LexicallyDeclaredNames of |StatementList| also occurs in the VarDeclaredNames of |StatementList|.
@@ -50574,7 +50649,7 @@
Changes to `switch` Statement Static Semantics: Early Errors
- It is a Syntax Error if the LexicallyDeclaredNames of |CaseBlock| contains any duplicate entries, unless the source text matched by this production is not strict mode code and the duplicate entries are only bound by FunctionDeclarations.
+ It is a Syntax Error if the LexicallyDeclaredNames of |CaseBlock| contains any duplicate entries, unless IsStrict(this production) is *false* and the duplicate entries are only bound by FunctionDeclarations.
It is a Syntax Error if any element of the LexicallyDeclaredNames of |CaseBlock| also occurs in the VarDeclaredNames of |CaseBlock|.
@@ -50620,7 +50695,7 @@
VariableStatements in Catch Blocks
Catch : `catch` `(` CatchParameter `)` Block
- It is a Syntax Error if BoundNames of |CatchParameter| contains any duplicate elements.
+ It is a Syntax Error if the BoundNames of |CatchParameter| contains any duplicate elements.
It is a Syntax Error if any element of the BoundNames of |CatchParameter| also occurs in the LexicallyDeclaredNames of |Block|.
@@ -50693,7 +50768,7 @@
Initializers in ForIn Statement Heads
The runtime semantics of ForInOfLoopEvaluation in are augmented with the following:
ForInOfStatement : `for` `(` `var` BindingIdentifier Initializer `in` Expression `)` Statement
- 1. Let _bindingId_ be StringValue of |BindingIdentifier|.
+ 1. Let _bindingId_ be the StringValue of |BindingIdentifier|.
1. Let _lhs_ be ? ResolveBinding(_bindingId_).
1. If IsAnonymousFunctionDefinition(|Initializer|) is *true*, then
1. Let _value_ be ? NamedEvaluation of |Initializer| with argument _bindingId_.
@@ -50799,7 +50874,7 @@
The Strict Mode of ECMAScript
Strict mode code may not include a |WithStatement|. The occurrence of a |WithStatement| in such a context is a *SyntaxError* ().
- It is a *SyntaxError* if a |CatchParameter| occurs within strict mode code and BoundNames of |CatchParameter| contains either `eval` or `arguments` ().
+ It is a *SyntaxError* if a |CatchParameter| occurs within strict mode code and the BoundNames of |CatchParameter| contains either `eval` or `arguments` ().
It is a *SyntaxError* if the same |BindingIdentifier| appears more than once in the |FormalParameters| of a strict function. An attempt to create such a function using a Function, Generator, or AsyncFunction constructor is a *SyntaxError* (, ).