diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 237f4c9cc3..eda5ecd5b2 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -10,7 +10,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: ljharb/actions/node/install@d9f477827ed71a259056764107f74afc29febcae
- name: 'nvm install lts/* && npm ci'
+ name: 'nvm install lts/* && npm ci --no-audit'
+ env:
+ NPM_CONFIG_AUDIT: false
with:
node-version: lts/*
use-npm-ci: true
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 424c2d3f97..a567db1f65 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -14,7 +14,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: ljharb/actions/node/install@d9f477827ed71a259056764107f74afc29febcae
- name: 'nvm install lts/* && npm ci'
+ name: 'nvm install lts/* && npm ci --no-audit'
+ env:
+ NPM_CONFIG_AUDIT: false
with:
node-version: lts/*
use-npm-ci: true
diff --git a/.github/workflows/enforce-format.yml b/.github/workflows/enforce-format.yml
index d2358e0e47..d40c94ff9b 100644
--- a/.github/workflows/enforce-format.yml
+++ b/.github/workflows/enforce-format.yml
@@ -10,7 +10,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: ljharb/actions/node/install@d9f477827ed71a259056764107f74afc29febcae
- name: 'nvm install lts/* && npm ci'
+ name: 'nvm install lts/* && npm ci --no-audit'
+ env:
+ NPM_CONFIG_AUDIT: false
with:
node-version: lts/*
use-npm-ci: true
diff --git a/.github/workflows/ipr.yml b/.github/workflows/ipr.yml
index 608b514867..cc313dfb42 100644
--- a/.github/workflows/ipr.yml
+++ b/.github/workflows/ipr.yml
@@ -16,7 +16,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: ljharb/actions/node/install@d9f477827ed71a259056764107f74afc29febcae
- name: 'nvm install lts/* && npm ci'
+ name: 'nvm install lts/* && npm ci --no-audit'
+ env:
+ NPM_CONFIG_AUDIT: false
with:
node-version: lts/*
use-npm-ci: true
diff --git a/.github/workflows/preview-build.yml b/.github/workflows/preview-build.yml
index d2dd361ea5..55a4474dc2 100644
--- a/.github/workflows/preview-build.yml
+++ b/.github/workflows/preview-build.yml
@@ -10,7 +10,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: ljharb/actions/node/install@d9f477827ed71a259056764107f74afc29febcae
- name: 'nvm install lts/* && npm ci'
+ name: 'nvm install lts/* && npm ci --no-audit'
+ env:
+ NPM_CONFIG_AUDIT: false
with:
node-version: lts/*
use-npm-ci: true
diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml
index c3ab4f7f83..1f1e69a4b6 100644
--- a/.github/workflows/preview.yml
+++ b/.github/workflows/preview.yml
@@ -20,7 +20,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: ljharb/actions/node/install@d9f477827ed71a259056764107f74afc29febcae
- name: 'nvm install lts/* && npm ci'
+ name: 'nvm install lts/* && npm ci --no-audit'
+ env:
+ NPM_CONFIG_AUDIT: false
with:
node-version: lts/*
use-npm-ci: true
diff --git a/.github/workflows/publish-biblio.yml b/.github/workflows/publish-biblio.yml
index dad842ff86..bca1c1919f 100644
--- a/.github/workflows/publish-biblio.yml
+++ b/.github/workflows/publish-biblio.yml
@@ -24,7 +24,7 @@ jobs:
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
- run: npm ci
+ run: npm ci --no-audit
- name: Publish biblio
run: scripts/publish-biblio.sh
diff --git a/.github/workflows/spellcheck.yml b/.github/workflows/spellcheck.yml
new file mode 100644
index 0000000000..6a02292048
--- /dev/null
+++ b/.github/workflows/spellcheck.yml
@@ -0,0 +1,24 @@
+name: 'ecma-262'
+
+on: [pull_request]
+
+jobs:
+ spellcheck:
+ name: 'check for newly-introduced spelling errors'
+ runs-on: ubuntu-latest
+
+ steps:
+ - run: sudo apt-get install aspell
+ - uses: actions/checkout@v3
+ with:
+ # Number of commits to fetch. 0 indicates all history for all branches and tags.
+ # Default: 1
+ fetch-depth: 0
+ - uses: ljharb/actions/node/install@d9f477827ed71a259056764107f74afc29febcae
+ name: 'nvm install lts/* && npm ci --no-audit'
+ env:
+ NPM_CONFIG_AUDIT: false
+ with:
+ node-version: lts/*
+ use-npm-ci: true
+ - run: node scripts/spellcheck.mjs origin/"${GITHUB_BASE_REF}"
diff --git a/.gitignore b/.gitignore
index 1d3e390a13..21fcbc8f9d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@ node_modules/
out/
vendor/esmeta
test*.js
+aspell.txt
# lockfiles we don't use are ignored
npm-shrinkwrap.json
diff --git a/img/figure-2.svg b/img/figure-2.svg
index fe1ac95e65..ef20a19c0f 100644
--- a/img/figure-2.svg
+++ b/img/figure-2.svg
@@ -83,14 +83,14 @@
-
title: ECMAScript® 2025 Language Specification @@ -686,7 +709,7 @@Grammatical Parameters
ReturnStatement ExpressionStatement -Multiple parameters produce a combinatory number of productions, not all of which are necessarily referenced in a complete grammar.
+Multiple parameters produce a combinatoric number of productions, not all of which are necessarily referenced in a complete grammar.
References to nonterminals on the right-hand side of a production can also be parameterized. For example:
StatementList : @@ -1005,7 +1028,7 @@ ReturnIfAbrupt Shorthands
Implicit Normal Completion
In algorithms within abstract operations which are declared to return a Completion Record, and within all built-in functions, the returned value is first passed to NormalCompletion, and the result is used instead. This rule does not apply within the Completion algorithm or when the value being returned is clearly marked as a Completion Record in that step; these cases are:
-
- when the result of applying Completion, NormalCompletion, or ThrowCompletion is directly returned
+- when the result of applying Completion, NormalCompletion, ThrowCompletion, or ReturnCompletion is directly returned
- when the result of constructing a Completion Record is directly returned
It is an editorial error if a Completion Record is returned from such an abstract operation through any other means. For example, within these abstract operations,
@@ -1056,7 +1079,7 @@Mathematical Operations
In the language of this specification, numerical values are distinguished among different numeric kinds using subscript suffixes. The subscript π½ refers to Numbers, and the subscript β€ refers to BigInts. Numeric values without a subscript suffix refer to mathematical values. This specification denotes most numeric values in base 10; it also uses numeric values of the form 0x followed by digits 0-9 or A-F as base-16 values.
In general, when this specification refers to a numerical value, such as in the phrase, "the length of _y_" or "the integer represented by the four hexadecimal digits ...", without explicitly specifying a numeric kind, the phrase refers to a mathematical value. Phrases which refer to a Number or a BigInt value are explicitly annotated as such; for example, "the Number value for the number of code points in β¦" or "the BigInt value for β¦".
-When the term integer is used in this specification, it refers to a mathematical value which is in the set of integers, unless otherwise stated. When the term integral Number is used in this specification, it refers to a Number value whose mathematical value is in the set of integers.
+When the term integer is used in this specification, it refers to a mathematical value which is in the set of integers, unless otherwise stated. When the term integral Number is used in this specification, it refers to a finite Number value whose mathematical value is in the set of integers.
Numeric operators such as +, Γ, =, and β₯ refer to those operations as determined by the type of the operands. When applied to mathematical values, the operators refer to the usual mathematical operations. When applied to extended mathematical values, the operators refer to the usual mathematical operations over the extended real numbers; indeterminate forms are not defined and their use in this specification should be considered an editorial error. When applied to Numbers, the operators refer to the relevant operations within IEEE 754-2019. When applied to BigInts, the operators refer to the usual mathematical operations applied to the mathematical value of the BigInt. Numeric operators applied to mixed-type operands (such as a Number and a mathematical value) are not defined and should be considered an editorial error in this specification.
Conversions between mathematical values and Numbers or BigInts are always explicit in this document. A conversion from a mathematical value or extended mathematical value _x_ to a Number is denoted as "the Number value for _x_" or
π½(_x_) , and is defined in. A conversion from an integer _x_ to a BigInt is denoted as "the BigInt value for _x_" or β€(_x_) . A conversion from a Number or BigInt _x_ to a mathematical value is denoted as "the mathematical value of _x_", orβ(_x_) . The mathematical value of *+0*π½ and *-0*π½ is the mathematical value 0. The mathematical value of non-finite values is not defined. The extended mathematical value of _x_ is the mathematical value of _x_ for finite values, and is +β and -β for *+β*π½ and *-β*π½ respectively; it is not defined for *NaN*.The mathematical function
@@ -1095,10 +1118,9 @@abs(_x_) produces the absolute value of _x_, which is-_x_ if _x_ < 0 and otherwise is _x_ itself.Identity
-+ ECMAScript Data Types and Values
-Algorithms within this specification manipulate values each of which has an associated type. The possible value types are exactly those defined in this clause. Types are further subclassified into ECMAScript language types and specification types.
-Within this specification, the notation βType(_x_)β is used as shorthand for βthe type of _x_β where βtypeβ refers to the ECMAScript language and specification types defined in this clause.
+Algorithms within this specification manipulate values each of which has an associated type. The possible value types are exactly those defined in this clause. Types are further classified into ECMAScript language types and specification types.
ECMAScript Language Types
@@ -1207,23 +1229,26 @@The Symbol Type
Well-Known Symbols
Well-known symbols are built-in Symbol values that are explicitly referenced by algorithms of this specification. They are typically used as the keys of properties whose values serve as extension points of a specification algorithm. Unless otherwise specified, well-known symbols values are shared by all realms (
-). Within this specification a well-known symbol is referred to by using a notation of the form @@name, where βnameβ is one of the values listed in
+. Within this specification a well-known symbol is referred to using the standard
+intrinsic notation where the intrinsic is one of the values listed in. Previous editions of this specification used a notation of the form @@name, where the current edition would use `%Symbol.name%`. In particular, the following names were used: @@asyncIterator, @@hasInstance, @@isConcatSpreadable, @@iterator, @@match, @@matchAll, @@replace, @@search, @@species, @@split, @@toPrimitive, @@toStringTag, and @@unscopables. -
- + +- Specification Name - -- [[Description]] - -- Value and Purpose - -+ ++ Specification Name + ++ [[Description]] + ++ Value and Purpose + +- @@asyncIterator + %Symbol.asyncIterator% *"Symbol.asyncIterator"* @@ -1234,7 +1259,7 @@ Well-Known Symbols
- @@hasInstance + %Symbol.hasInstance% *"Symbol.hasInstance"* @@ -1245,7 +1270,7 @@ Well-Known Symbols
- @@isConcatSpreadable + %Symbol.isConcatSpreadable% *"Symbol.isConcatSpreadable"* @@ -1256,7 +1281,7 @@ Well-Known Symbols
- @@iterator + %Symbol.iterator% *"Symbol.iterator"* @@ -1267,7 +1292,7 @@ Well-Known Symbols
- @@match + %Symbol.match% *"Symbol.match"* @@ -1278,7 +1303,7 @@ Well-Known Symbols
- @@matchAll + %Symbol.matchAll% *"Symbol.matchAll"* @@ -1289,7 +1314,7 @@ Well-Known Symbols
- @@replace + %Symbol.replace% *"Symbol.replace"* @@ -1300,7 +1325,7 @@ Well-Known Symbols
- @@search + %Symbol.search% *"Symbol.search"* @@ -1311,7 +1336,7 @@ Well-Known Symbols
- @@species + %Symbol.species% *"Symbol.species"* @@ -1322,7 +1347,7 @@ Well-Known Symbols
- @@split + %Symbol.split% *"Symbol.split"* @@ -1333,7 +1358,7 @@ Well-Known Symbols
- @@toPrimitive + %Symbol.toPrimitive% *"Symbol.toPrimitive"* @@ -1344,7 +1369,7 @@ Well-Known Symbols
- @@toStringTag + %Symbol.toStringTag% *"Symbol.toStringTag"* @@ -1355,7 +1380,7 @@ Well-Known Symbols
- @@unscopables + %Symbol.unscopables% *"Symbol.unscopables"* @@ -1374,20 +1399,22 @@ Numeric Types
ECMAScript has two built-in numeric types: Number and BigInt. The following abstract operations are defined over these numeric types. The "Result" column shows the return type, along with an indication if it is possible for some invocations of the operation to return an abrupt completion.
-
- + +- Operation - -- Example source - -- Invoked by the Evaluation semantics of ... - -- Result - -+ ++ Operation + ++ Example source + ++ Invoked by the Evaluation semantics of ... + ++ Result + +@@ -1862,7 +1889,7 @@
1. If _x_ is *NaN*, return *NaN*. - 1. Return the result of negating _x_; that is, compute a Number with the same magnitude but opposite sign. + 1. Return the negation of _x_; that is, compute a Number with the same magnitude but opposite sign. @@ -1876,7 +1903,7 @@
1. Let _oldValue_ be ! ToInt32(_x_). - 1. Return the result of applying bitwise complement to _oldValue_. The mathematical value of the result is exactly representable as a 32-bit two's complement bit string. + 1. Return the bitwise complement of _oldValue_. The mathematical value of the result is exactly representable as a 32-bit two's complement bit string. @@ -2079,10 +2106,10 @@
- 1. Let _lnum_ be ! ToInt32(_x_). - 1. Let _rnum_ be ! ToUint32(_y_). - 1. Let _shiftCount_ be β(_rnum_) modulo 32. - 1. Return the result of left shifting _lnum_ by _shiftCount_ bits. The mathematical value of the result is exactly representable as a 32-bit two's complement bit string. + 1. Let _lNum_ be ! ToInt32(_x_). + 1. Let _rNum_ be ! ToUint32(_y_). + 1. Let _shiftCount_ be β(_rNum_) modulo 32. + 1. Return the result of left shifting _lNum_ by _shiftCount_ bits. The mathematical value of the result is exactly representable as a 32-bit two's complement bit string. @@ -2096,10 +2123,10 @@
- 1. Let _lnum_ be ! ToInt32(_x_). - 1. Let _rnum_ be ! ToUint32(_y_). - 1. Let _shiftCount_ be β(_rnum_) modulo 32. - 1. Return the result of performing a sign-extending right shift of _lnum_ by _shiftCount_ bits. The most significant bit is propagated. The mathematical value of the result is exactly representable as a 32-bit two's complement bit string. + 1. Let _lNum_ be ! ToInt32(_x_). + 1. Let _rNum_ be ! ToUint32(_y_). + 1. Let _shiftCount_ be β(_rNum_) modulo 32. + 1. Return the result of performing a sign-extending right shift of _lNum_ by _shiftCount_ bits. The most significant bit is propagated. The mathematical value of the result is exactly representable as a 32-bit two's complement bit string. @@ -2113,10 +2140,10 @@
- 1. Let _lnum_ be ! ToUint32(_x_). - 1. Let _rnum_ be ! ToUint32(_y_). - 1. Let _shiftCount_ be β(_rnum_) modulo 32. - 1. Return the result of performing a zero-filling right shift of _lnum_ by _shiftCount_ bits. Vacated bits are filled with zero. The mathematical value of the result is exactly representable as a 32-bit unsigned bit string. + 1. Let _lNum_ be ! ToUint32(_x_). + 1. Let _rNum_ be ! ToUint32(_y_). + 1. Let _shiftCount_ be β(_rNum_) modulo 32. + 1. Return the result of performing a zero-filling right shift of _lNum_ by _shiftCount_ bits. Vacated bits are filled with zero. The mathematical value of the result is exactly representable as a 32-bit unsigned bit string. @@ -2210,17 +2237,17 @@
- 1. Let _lnum_ be ! ToInt32(_x_). - 1. Let _rnum_ be ! ToInt32(_y_). - 1. Let _lbits_ be the 32-bit two's complement bit string representing β(_lnum_). - 1. Let _rbits_ be the 32-bit two's complement bit string representing β(_rnum_). + 1. Let _lNum_ be ! ToInt32(_x_). + 1. Let _rNum_ be ! ToInt32(_y_). + 1. Let _lBits_ be the 32-bit two's complement bit string representing β(_lNum_). + 1. Let _rBits_ be the 32-bit two's complement bit string representing β(_rNum_). 1. If _op_ is `&`, then - 1. Let _result_ be the result of applying the bitwise AND operation to _lbits_ and _rbits_. + 1. Let _result_ be the result of applying the bitwise AND operation to _lBits_ and _rBits_. 1. Else if _op_ is `^`, then - 1. Let _result_ be the result of applying the bitwise exclusive OR (XOR) operation to _lbits_ and _rbits_. + 1. Let _result_ be the result of applying the bitwise exclusive OR (XOR) operation to _lBits_ and _rBits_. 1. Else, 1. Assert: _op_ is `|`. - 1. Let _result_ be the result of applying the bitwise inclusive OR operation to _lbits_ and _rbits_. + 1. Let _result_ be the result of applying the bitwise inclusive OR operation to _lBits_ and _rBits_. 1. Return the Number value for the integer represented by the 32-bit two's complement bit string _result_. @@ -2342,7 +2369,7 @@
Implementers of ECMAScript may find useful the paper and code written by David M. Gay for binary-to-decimal conversion of floating-point numbers:
Gay, David M. Correctly Rounded Binary-Decimal and Decimal-Binary Conversions. Numerical Analysis, Manuscript 90-10. AT&T Bell Laboratories (Murray Hill, New Jersey). 30 November 1990. Available as
@@ -2724,13 +2751,15 @@
- http://ampl.com/REFS/abstracts.html#rounding. Associated code available as
+ https://ampl.com/_archive/first-website/REFS/rounding.pdf. Associated code available as
http://netlib.sandia.gov/fp/dtoa.c and as
http://netlib.sandia.gov/fp/g_fmt.c and may also be found at the various `netlib` mirror sites.Property Attributes
Attributes are used in this specification to define and explain the state of Object properties as described in
. Unless specified explicitly, the initial value of each attribute is its Default Value. -
- + +Attribute Name -Types of property for which it is present -Value Domain -Default Value -Description -+ +Attribute Name +Types of property for which it is present +Value Domain +Default Value +Description +[[Value]] @@ -2864,17 +2893,19 @@ Object Internal Methods and Internal Slots
An internal method implicitly returns a Completion Record, either a normal completion that wraps a value of the return type shown in its invocation pattern, or a throw completion.
-
- + +- Internal Method - -- Signature - -- Description - -+ ++ Internal Method + ++ Signature + ++ Description + +[[GetPrototypeOf]] @@ -3001,17 +3032,19 @@ Object Internal Methods and Internal Slots
summarizes additional essential internal methods that are supported by objects that may be called as functions. A function object is an object that supports the [[Call]] internal method. A constructor is an object that supports the [[Construct]] internal method. Every object that supports [[Construct]] must support [[Call]]; that is, every constructor must be a function object. Therefore, a constructor may also be referred to as a constructor function or constructor function object. -
- + +- Internal Method - -- Signature - -- Description - -+ ++ Internal Method + ++ Signature + ++ Description + +[[Call]] @@ -3113,7 +3146,7 @@ [[GetOwnProperty]] ( _P_ )
The normal return type is either Property Descriptor or Undefined.- If the Type of the return value is Property Descriptor, the return value must be a fully populated Property Descriptor. + If the return value is a Property Descriptor, it must be a fully populated Property Descriptor. If _P_ is described as a non-configurable, non-writable own data property, all future calls to [[GetOwnProperty]] ( _P_ ) must return Property Descriptor whose [[Value]] is SameValue as _P_'s [[Value]] attribute. @@ -3202,7 +3235,7 @@ [[OwnPropertyKeys]] ( )
The returned List must not contain any duplicate entries.- The Type of each element of the returned List is either String or Symbol. + Each element of the returned List must be a property key. The returned List must contain at least the keys of all non-configurable own properties that have previously been observed. @@ -3234,17 +3267,19 @@ Well-Known Intrinsic Objects
Within this specification a reference such as %name% means the intrinsic object, associated with the current realm, corresponding to the name. A reference such as %name.a.b% means, as if the *"b"* property of the value of the *"a"* property of the intrinsic object %name% was accessed prior to any ECMAScript code being evaluated. Determination of the current realm and its intrinsics is described in
. The well-known intrinsics are listed in . -
- + +- Intrinsic Name - -- Global Name - -- ECMAScript Language Association - -+ ++ Intrinsic Name + ++ Global Name + ++ ECMAScript Language Association + +%AggregateError% @@ -3999,7 +4034,7 @@ Well-Known Intrinsic Objects
ECMAScript Specification Types
-A specification type corresponds to meta-values that are used within algorithms to describe the semantics of ECMAScript language constructs and ECMAScript language types. The specification types include Reference, List, Completion Record, Property Descriptor, Environment Record, Abstract Closure, and Data Block. Specification type values are specification artefacts that do not necessarily correspond to any specific entity within an ECMAScript implementation. Specification type values may be used to describe intermediate results of ECMAScript expression evaluation but such values cannot be stored as properties of objects or values of ECMAScript language variables.
+A specification type corresponds to meta-values that are used within algorithms to describe the semantics of ECMAScript language constructs and ECMAScript language types. The specification types include Reference Record, List, Completion Record, Property Descriptor, Environment Record, Abstract Closure, and Data Block. Specification type values are specification artefacts that do not necessarily correspond to any specific entity within an ECMAScript implementation. Specification type values may be used to describe intermediate results of ECMAScript expression evaluation but such values cannot be stored as properties of objects or values of ECMAScript language variables.
The Enum Specification Type
@@ -4022,7 +4057,7 @@The List and Record Specification Types
The Set and Relation Specification Types
The Set type is used to explain a collection of unordered elements for use in the memory model. It is distinct from the ECMAScript collection type of the same name. To disambiguate, instances of the ECMAScript collection are consistently referred to as "Set objects" within this specification. Values of the Set type are simple collections of elements, where no element appears more than once. Elements may be added to and removed from Sets. Sets may be unioned, intersected, or subtracted from each other.
-The Relation type is used to explain constraints on Sets. Values of the Relation type are Sets of ordered pairs of values from its value domain. For example, a Relation on events is a set of ordered pairs of events. For a Relation _R_ and two values _a_ and _b_ in the value domain of _R_, _a_ _R_ _b_ is shorthand for saying the ordered pair (_a_, _b_) is a member of _R_. A Relation is least with respect to some conditions when it is the smallest Relation that satisfies those conditions.
+The Relation type is used to explain constraints on Sets. Values of the Relation type are Sets of ordered pairs of values from its value domain. For example, a Relation on events is a set of ordered pairs of events. For a Relation _R_ and two values _a_ and _b_ in the value domain of _R_, _a_ _R_ _b_ is shorthand for saying the ordered pair (_a_, _b_) is a member of _R_. A Relation is the least Relation with respect to some conditions when it is the smallest Relation that satisfies those conditions.
A strict partial order is a Relation value _R_ that satisfies the following.
- @@ -4058,17 +4093,19 @@
The Completion Record Specification Type
Completion Records have the fields defined in
. -
- + +- Field Name - -- Value - -- Meaning - -+ ++ Field Name + ++ Value + ++ Meaning + +[[Type]] @@ -4143,6 +4180,19 @@ +
+ ++ ReturnCompletion ( + _value_: an ECMAScript language value, + ): a return completion +
++
++ 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _value_, [[Target]]: ~empty~ }. + +UpdateEmpty ( @@ -4163,15 +4213,17 @@
The Reference Record Specification Type
The Reference Record type is used to explain the behaviour of such operators as `delete`, `typeof`, the assignment operators, the `super` keyword and other language features. For example, the left-hand operand of an assignment is expected to produce a Reference Record.
-A Reference Record is a resolved name or property binding; its fields are defined by
+. A Reference Record is a resolved name or (possibly not-yet-resolved) property binding; its fields are defined by
. -
- + +Field Name -Value -Meaning -+ +Field Name +Value +Meaning +[[Base]] an ECMAScript language value, an Environment Record, or ~unresolvable~ @@ -4179,8 +4231,8 @@The Reference Record Specification Type
[[ReferencedName]] -a String, a Symbol, or a Private Name -The name of the binding. Always a String if [[Base]] value is an Environment Record. +an ECMAScript language value or a Private Name +The name of the binding. Always a String if [[Base]] value is an Environment Record. Otherwise, may be an ECMAScript language value other than a String or a Symbol until ToPropertyKey is performed. [[Strict]] @@ -4265,6 +4317,8 @@1. [id="step-getvalue-toobject"] Let _baseObj_ be ? ToObject(_V_.[[Base]]). 1. If IsPrivateReference(_V_) is *true*, then 1. Return ? PrivateGet(_baseObj_, _V_.[[ReferencedName]]). + 1. If _V_.[[ReferencedName]] is not a property key, then + 1. Set _V_.[[ReferencedName]] to ? ToPropertyKey(_V_.[[ReferencedName]]). 1. Return ?
_baseObj_.[[Get]] (_V_.[[ReferencedName]], GetThisValue(_V_)). 1. Else, 1. Let _base_ be _V_.[[Base]]. @@ -4296,6 +4350,8 @@1. [id="step-putvalue-toobject"] Let _baseObj_ be ? ToObject(_V_.[[Base]]). 1. If IsPrivateReference(_V_) is *true*, then 1. Return ? PrivateSet(_baseObj_, _V_.[[ReferencedName]], _W_). + 1. If _V_.[[ReferencedName]] is not a property key, then + 1. Set _V_.[[ReferencedName]] to ? ToPropertyKey(_V_.[[ReferencedName]]). 1. Let _succeeded_ be ?
_baseObj_.[[Set]] (_V_.[[ReferencedName]], _W_, GetThisValue(_V_)). 1. If _succeeded_ is *false* and _V_.[[Strict]] is *true*, throw a *TypeError* exception. 1. Return ~unused~. @@ -4350,9 +4406,9 @@
- 1. Let _privEnv_ be the running execution context's PrivateEnvironment. - 1. Assert: _privEnv_ is not *null*. - 1. Let _privateName_ be ResolvePrivateIdentifier(_privEnv_, _privateIdentifier_). + 1. Let _privateEnv_ be the running execution context's PrivateEnvironment. + 1. Assert: _privateEnv_ is not *null*. + 1. Let _privateName_ be ResolvePrivateIdentifier(_privateEnv_, _privateIdentifier_). 1. Return the Reference Record { [[Base]]: _baseValue_, [[ReferencedName]]: _privateName_, [[Strict]]: *true*, [[ThisValue]]: ~empty~ }. @@ -4529,10 +4585,10 @@The Abstract Closure Specification Type
Data Blocks
The Data Block specification type is used to describe a distinct and mutable sequence of byte-sized (8 bit) numeric values. A byte value is an integer in the inclusive interval from 0 to 255. A Data Block value is created with a fixed number of bytes that each have the initial value 0.
-For notational convenience within this specification, an array-like syntax can be used to access the individual bytes of a Data Block value. This notation presents a Data Block value as a 0-origined
+integer-indexed sequence of bytes. For example, if _db_ is a 5 byte Data Block value then _db_[2] can be used to access its 3rd byte.For notational convenience within this specification, an array-like syntax can be used to access the individual bytes of a Data Block value. This notation presents a Data Block value as a 0-based
integer-indexed sequence of bytes. For example, if _db_ is a 5 byte Data Block value then _db_[2] can be used to access its 3rd byte.A data block that resides in memory that can be referenced from multiple agents concurrently is designated a Shared Data Block. A Shared Data Block has an identity (for the purposes of equality testing Shared Data Block values) that is address-free: it is tied not to the virtual addresses the block is mapped to in any process, but to the set of locations in memory that the block represents. Two data blocks are equal only if the sets of the locations they contain are equal; otherwise, they are not equal and the intersection of the sets of locations they contain is empty. Finally, Shared Data Blocks can be distinguished from Data Blocks.
The semantics of Shared Data Blocks is defined using Shared Data Block events by the memory model. Abstract operations below introduce Shared Data Block events and act as the interface between evaluation semantics and the event semantics of the memory model. The events form a candidate execution, on which the memory model acts as a filter. Please consult the memory model for full semantics.
-Shared Data Block events are modeled by Records, defined in the memory model.
+Shared Data Block events are modelled by Records, defined in the memory model.
The following abstract operations are used in this specification to operate upon Data Block values:
@@ -4618,20 +4674,22 @@ The PrivateElement Specification Type
Values of the PrivateElement type are Record values whose fields are defined by
. Such values are referred to as PrivateElements. -
- + +- Field Name - -- Values of the [[Kind]] field for which it is present - -- Value - -- Meaning - -+ ++ Field Name + ++ Values of the [[Kind]] field for which it is present + ++ Value + ++ Meaning + +[[Key]] @@ -4712,17 +4770,19 @@ The ClassFieldDefinition Record Specification Type
Values of the ClassFieldDefinition type are Record values whose fields are defined by
. Such values are referred to as ClassFieldDefinition Records. -
- + +- Field Name - -- Value - -- Meaning - -+ ++ Field Name + ++ Value + ++ Meaning + +[[Name]] @@ -4760,17 +4820,19 @@ The ClassStaticBlockDefinition Record Specification Type
ClassStaticBlockDefinition Records have the fields listed in
. -
- + +- Field Name - -- Value - -- Meaning - -+ ++ Field Name + ++ Value + ++ Meaning + +[[BodyFunction]] @@ -4810,7 +4872,7 @@
1. If _input_ is an Object, then - 1. Let _exoticToPrim_ be ? GetMethod(_input_, @@toPrimitive). + 1. Let _exoticToPrim_ be ? GetMethod(_input_, %Symbol.toPrimitive%). 1. If _exoticToPrim_ is not *undefined*, then 1. If _preferredType_ is not present, then 1. Let _hint_ be *"default"*. @@ -4827,7 +4889,7 @@ 1. Return _input_.
- When ToPrimitive is called without a hint, then it generally behaves as if the hint were ~number~. However, objects may over-ride this behaviour by defining a @@toPrimitive method. Of the objects defined in this specification only Dates (see
+) and Symbol objects (see ) over-ride the default ToPrimitive behaviour. Dates treat the absence of a hint as if the hint were ~string~. When ToPrimitive is called without a hint, then it generally behaves as if the hint were ~number~. However, objects may over-ride this behaviour by defining a %Symbol.toPrimitive% method. Of the objects defined in this specification only Dates (see
) and Symbol objects (see ) over-ride the default ToPrimitive behaviour. Dates treat the absence of a hint as if the hint were ~string~. @@ -5282,14 +5344,16 @@
-
- + +- Argument Type - -- Result - -+ ++ Argument Type + ++ Result + +Undefined @@ -5470,14 +5534,16 @@
-
- + +- Argument Type - -- Result - -+ ++ Argument Type + ++ Result + +Undefined @@ -5589,7 +5655,7 @@
- description
-- If _argument_ is either *"-0"* or exactly matches the result of ToString(_n_) for some Number value _n_, it returns the respective Number value. Otherwise, it returns *undefined*.
+- If _argument_ is either *"-0"* or exactly matches ToString(_n_) for some Number value _n_, it returns the respective Number value. Otherwise, it returns *undefined*.
1. If _argument_ is *"-0"*, return *-0*π½. @@ -5633,14 +5699,16 @@
-
- + +- Argument Type - -- Result - -+ ++ Argument Type + ++ Result + +Undefined @@ -5777,24 +5845,6 @@ -
- -- IsIntegralNumber ( - _argument_: an ECMAScript language value, - ): a Boolean -
--
-- description
-- It determines if _argument_ is a finite integral Number value.
-- 1. If _argument_ is not a Number, return *false*. - 1. If _argument_ is not finite, return *false*. - 1. If truncate(β(_argument_)) β β(_argument_), return *false*. - 1. Return *true*. - -+ IsRegExp ( @@ -5805,7 +5855,7 @@
1. If _argument_ is not an Object, return *false*. - 1. Let _matcher_ be ? Get(_argument_, @@match). + 1. Let _matcher_ be ? Get(_argument_, %Symbol.match%). 1. If _matcher_ is not *undefined*, return ToBoolean(_matcher_). 1. If _argument_ has a [[RegExpMatcher]] internal slot, return *true*. 1. Return *false*. @@ -5833,6 +5883,30 @@
+ ++ SameType ( + _x_: an ECMAScript language value, + _y_: an ECMAScript language value, + ): a Boolean +
++
+- description
+- It determines whether or not the two arguments are the same type.
++ 1. If _x_ is *undefined* and _y_ is *undefined*, return *true*. + 1. If _x_ is *null* and _y_ is *null*, return *true*. + 1. If _x_ is a Boolean and _y_ is a Boolean, return *true*. + 1. If _x_ is a Number and _y_ is a Number, return *true*. + 1. If _x_ is a BigInt and _y_ is a BigInt, return *true*. + 1. If _x_ is a Symbol and _y_ is a Symbol, return *true*. + 1. If _x_ is a String and _y_ is a String, return *true*. + 1. If _x_ is an Object and _y_ is an Object, return *true*. + 1. Return *false*. + +SameValue ( @@ -5845,7 +5919,7 @@
- It determines whether or not the two arguments are the same value.
- 1. If Type(_x_) is not Type(_y_), return *false*. + 1. If SameType(_x_, _y_) is *false*, return *false*. 1. If _x_ is a Number, then 1. Return Number::sameValue(_x_, _y_). 1. Return SameValueNonNumber(_x_, _y_). @@ -5867,7 +5941,7 @@
- It determines whether or not the two arguments are the same value (ignoring the difference between *+0*π½ and *-0*π½).
- 1. If Type(_x_) is not Type(_y_), return *false*. + 1. If SameType(_x_, _y_) is *false*, return *false*. 1. If _x_ is a Number, then 1. Return Number::sameValueZero(_x_, _y_). 1. Return SameValueNonNumber(_x_, _y_). @@ -5887,7 +5961,7 @@
- 1. Assert: Type(_x_) is Type(_y_). + 1. Assert: SameType(_x_, _y_) is *true*. 1. If _x_ is either *null* or *undefined*, return *true*. 1. If _x_ is a BigInt, then 1. Return BigInt::equal(_x_, _y_). @@ -5947,7 +6021,7 @@ 1. NOTE: Because _px_ and _py_ are primitive values, evaluation order is not important. 1. Let _nx_ be ?
ToNumeric(_px_) . 1. Let _ny_ be ?ToNumeric(_py_) . - 1. If Type(_nx_) is Type(_ny_), then + 1. If SameType(_nx_, _ny_) is *true*, then 1. If _nx_ is a Number, then 1. Return Number::lessThan(_nx_, _ny_). 1. Else, @@ -5979,7 +6053,7 @@
- It provides the semantics for the `==` operator.
- 1. If Type(_x_) is Type(_y_), then + 1. If SameType(_x_, _y_) is *true*, then 1. Return IsStrictlyEqual(_x_, _y_). 1. If _x_ is *null* and _y_ is *undefined*, return *true*. 1. If _x_ is *undefined* and _y_ is *null*, return *true*. @@ -6014,7 +6088,7 @@
- It provides the semantics for the `===` operator.
- 1. If Type(_x_) is not Type(_y_), return *false*. + 1. If SameType(_x_, _y_) is *false*, return *false*. 1. If _x_ is a Number, then 1. Return Number::equal(_x_, _y_). 1. Return SameValueNonNumber(_x_, _y_). @@ -6040,7 +6114,9 @@
+ 1. Set _internalSlotsList_ to the list-concatenation of _internalSlotsList_ and Β« [[PrivateElements]] Β». 1. Let _obj_ be a newly created object with an internal slot for each name in _internalSlotsList_. + 1. Set _obj_.[[PrivateElements]] to a new empty List. 1. Set _obj_'s essential internal methods to the default ordinary object definitions specified in . 1. Assert: If the caller will not be overriding both _obj_'s [[GetPrototypeOf]] and [[SetPrototypeOf]] essential internal methods, then _internalSlotsList_ contains [[Prototype]]. 1. Assert: If the caller will not be overriding all of _obj_'s [[SetPrototypeOf]], [[IsExtensible]], and [[PreventExtensions]] essential internal methods, then _internalSlotsList_ contains [[Extensible]]. @@ -6407,7 +6483,7 @@
CreateListFromArrayLike ( _obj_: an ECMAScript language value, - optional _elementTypes_: a List of names of ECMAScript Language Types, + optional _validElementTypes_: ~all~ or ~property-key~, ): either a normal completion containing a List of ECMAScript language values or a throw completion
@@ -6415,7 +6491,7 @@
- It is used to create a List value whose elements are provided by the indexed properties of _obj_. _elementTypes_ contains the names of ECMAScript Language Types that are allowed for element values of the List that is created.
- 1. If _elementTypes_ is not present, set _elementTypes_ to Β« Undefined, Null, Boolean, String, Symbol, Number, BigInt, Object Β». + 1. If _validElementTypes_ is not present, set _validElementTypes_ to ~all~. 1. If _obj_ is not an Object, throw a *TypeError* exception. 1. Let _len_ be ? LengthOfArrayLike(_obj_). 1. Let _list_ be a new empty List. @@ -6423,7 +6499,7 @@ 1. Repeat, while _index_ < _len_, 1. Let _indexName_ be ! ToString(π½(_index_)). 1. Let _next_ be ? Get(_obj_, _indexName_). - 1. If _elementTypes_ does not contain Type(_next_), throw a *TypeError* exception. + 1. If _validElementTypes_ is ~property-key~ and _next_ is not a property key, throw a *TypeError* exception. 1. Append _next_ to _list_. 1. Set _index_ to _index_ + 1. 1. Return _list_. @@ -6485,13 +6561,13 @@
- description
-- It is used to retrieve the constructor that should be used to create new objects that are derived from _O_. _defaultConstructor_ is the constructor to use if a constructor @@species property cannot be found starting from _O_.
+- It is used to retrieve the constructor that should be used to create new objects that are derived from _O_. _defaultConstructor_ is the constructor to use if a constructor %Symbol.species% property cannot be found starting from _O_.
1. Let _C_ be ? Get(_O_, *"constructor"*). 1. If _C_ is *undefined*, return _defaultConstructor_. 1. If _C_ is not an Object, throw a *TypeError* exception. - 1. Let _S_ be ? Get(_C_, @@species). + 1. Let _S_ be ? Get(_C_, %Symbol.species%). 1. If _S_ is either *undefined* or *null*, return _defaultConstructor_. 1. If IsConstructor(_S_) is *true*, return _S_. 1. Throw a *TypeError* exception. @@ -6780,15 +6856,15 @@
GroupBy ( _items_: an ECMAScript language value, - _callbackfn_: an ECMAScript language value, - _keyCoercion_: ~property~ or ~zero~, + _callback_: an ECMAScript language value, + _keyCoercion_: ~property~ or ~collection~, ): either a normal completion containing a List of Records with fields [[Key]] (an ECMAScript language value) and [[Elements]] (a List of ECMAScript language values), or a throw completion
1. Perform ? RequireObjectCoercible(_items_). - 1. If IsCallable(_callbackfn_) is *false*, throw a *TypeError* exception. + 1. If IsCallable(_callback_) 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. @@ -6800,14 +6876,14 @@ @@ -6824,17 +6900,19 @@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. Let _key_ be Completion(Call(_callback_, *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. Assert: _keyCoercion_ is ~collection~. + 1. Set _key_ to CanonicalizeKeyedCollectionKey(_key_). 1. Perform AddValueToKeyedGroup(_groups_, _key_, _value_). 1. Set _k_ to _k_ + 1.
Iterator Records
Iterator Records have the fields listed in
. -
- + +- Field Name - -- Value - -- Meaning - -+ ++ Field Name + ++ Value + ++ Meaning + +[[Iterator]] @@ -6901,14 +6979,14 @@
1. If _kind_ is ~async~, then - 1. Let _method_ be ? GetMethod(_obj_, @@asyncIterator). + 1. Let _method_ be ? GetMethod(_obj_, %Symbol.asyncIterator%). 1. If _method_ is *undefined*, then - 1. Let _syncMethod_ be ? GetMethod(_obj_, @@iterator). + 1. Let _syncMethod_ be ? GetMethod(_obj_, %Symbol.iterator%). 1. If _syncMethod_ is *undefined*, throw a *TypeError* exception. 1. Let _syncIteratorRecord_ be ? GetIteratorFromMethod(_obj_, _syncMethod_). 1. Return CreateAsyncFromSyncIterator(_syncIteratorRecord_). 1. Else, - 1. Let _method_ be ? GetMethod(_obj_, @@iterator). + 1. Let _method_ be ? GetMethod(_obj_, %Symbol.iterator%). 1. If _method_ is *undefined*, throw a *TypeError* exception. 1. Return ? GetIteratorFromMethod(_obj_, _method_). @@ -6942,26 +7020,26 @@
IteratorComplete ( - _iterResult_: an Object, + _iteratorResult_: an Object, ): either a normal completion containing a Boolean or a throw completion
- 1. Return ToBoolean(? Get(_iterResult_, *"done"*)). + 1. Return ToBoolean(? Get(_iteratorResult_, *"done"*)). @@ -7079,7 +7157,7 @@ IteratorValue ( - _iterResult_: an Object, + _iteratorResult_: an Object, ): either a normal completion containing an ECMAScript language value or a throw completion
- 1. Return ? Get(_iterResult_, *"value"*). + 1. Return ? Get(_iteratorResult_, *"value"*).
- CreateIterResultObject ( + CreateIteratorResultObject ( _value_: an ECMAScript language value, _done_: a Boolean, ): an Object that conforms to the IteratorResult interface @@ -7109,7 +7187,7 @@
1. Let _closure_ be a new Abstract Closure with no parameters that captures _list_ and performs the following steps when called: 1. For each element _E_ of _list_, do - 1. Perform ? GeneratorYield(CreateIterResultObject(_E_, *false*)). + 1. Perform ? GeneratorYield(CreateIteratorResultObject(_E_, *false*)). 1. Return NormalCompletion(*undefined*). 1. Let _iterator_ be CreateIteratorFromClosure(_closure_, ~empty~, %IteratorPrototype%). 1. Return the Iterator Record { [[Iterator]]: _iterator_, [[NextMethod]]: %GeneratorFunction.prototype.prototype.next%, [[Done]]: *false* }. @@ -9941,14 +10019,16 @@ The Environment Record Type Hierarchy
The Environment Record abstract class includes the abstract specification methods defined in
. These abstract methods have distinct concrete algorithms for each of the concrete subclasses. -
- + +- Method - -- Purpose - -+ ++ Method + ++ Purpose + +HasBinding(N) @@ -10246,17 +10326,19 @@ Object Environment Records
Object Environment Records have the additional state fields listed in
. -
- + +- Field Name - -- Value - -- Meaning - -+ ++ Field Name + ++ Value + ++ Meaning + +[[BindingObject]] @@ -10301,7 +10383,7 @@ 1. Let _foundBinding_ be ? HasProperty(_bindingObject_, _N_). 1. If _foundBinding_ is *false*, return *false*. 1. If _envRec_.[[IsWithEnvironment]] is *false*, return *true*. - 1. Let _unscopables_ be ? Get(_bindingObject_, @@unscopables). + 1. Let _unscopables_ be ? Get(_bindingObject_, %Symbol.unscopables%). 1. If _unscopables_ is an Object, then 1. Let _blocked_ be ToBoolean(? Get(_unscopables_, _N_)). 1. If _blocked_ is *true*, return *false*. @@ -10474,17 +10556,19 @@
Function Environment Records
Function Environment Records have the additional state fields listed in
. -
- + +- Field Name - -- Value - -- Meaning - -+ ++ Field Name + ++ Value + ++ Meaning + +[[ThisValue]] @@ -10534,14 +10618,16 @@ Function Environment Records
Function Environment Records support all of the Declarative Environment Record methods listed in
and share the same specifications for all of those methods except for HasThisBinding and HasSuperBinding. In addition, Function Environment Records support the methods listed in : -
- + +- Method - -- Purpose - -+ ++ Method + ++ Purpose + +BindThisValue(V) @@ -10648,17 +10734,19 @@ Global Environment Records
Global Environment Records have the additional fields listed in
and the additional methods listed in . -
- + +- Field Name - -- Value - -- Meaning - -+ ++ Field Name + ++ Value + ++ Meaning + +[[ObjectRecord]] @@ -10707,14 +10795,16 @@ Global Environment Records
-
- + +- Method - -- Purpose - -+ ++ Method + ++ Purpose + +GetThisBinding() @@ -11176,14 +11266,16 @@ Module Environment Records
Module Environment Records support all of the Declarative Environment Record methods listed in
and share the same specifications for all of those methods except for GetBindingValue, DeleteBinding, HasThisBinding and GetThisBinding. In addition, Module Environment Records support the methods listed in : -
- + +- Method - -- Purpose - -+ ++ Method + ++ Purpose + +CreateImportBinding(N, M, N2) @@ -11462,34 +11554,34 @@ PrivateEnvironment Record Operations
NewPrivateEnvironment ( - _outerPrivEnv_: a PrivateEnvironment Record or *null*, + _outerPrivateEnv_: a PrivateEnvironment Record or *null*, ): a PrivateEnvironment Record
1. Let _names_ be a new empty List. - 1. Return the PrivateEnvironment Record { [[OuterPrivateEnvironment]]: _outerPrivEnv_, [[Names]]: _names_ }. + 1. Return the PrivateEnvironment Record { [[OuterPrivateEnvironment]]: _outerPrivateEnv_, [[Names]]: _names_ }. @@ -11501,17 +11593,19 @@ ResolvePrivateIdentifier ( - _privEnv_: a PrivateEnvironment Record, + _privateEnv_: a PrivateEnvironment Record, _identifier_: a String, ): a Private Name
- 1. Let _names_ be _privEnv_.[[Names]]. + 1. Let _names_ be _privateEnv_.[[Names]]. 1. For each Private Name _pn_ of _names_, do 1. If _pn_.[[Description]] is _identifier_, then 1. Return _pn_. - 1. Let _outerPrivEnv_ be _privEnv_.[[OuterPrivateEnvironment]]. - 1. Assert: _outerPrivEnv_ is not *null*. - 1. Return ResolvePrivateIdentifier(_outerPrivEnv_, _identifier_). + 1. Let _outerPrivateEnv_ be _privateEnv_.[[OuterPrivateEnvironment]]. + 1. Assert: _outerPrivateEnv_ is not *null*. + 1. Return ResolvePrivateIdentifier(_outerPrivateEnv_, _identifier_). Realms
A realm is represented in this specification as a Realm Record with the fields specified in
: - -
- + +- Field Name - -- Value - -- Meaning - -+ ++ Field Name + ++ Value + ++ Meaning + +[[AgentSignifier]] @@ -11596,18 +11690,35 @@ Realms
- -CreateRealm ( ): a Realm Record
++ @@ -11627,34 +11738,11 @@InitializeHostDefinedRealm ( ): either a normal completion containing ~unused~ or a throw completion
- 1. Let _realmRec_ be a new Realm Record. - 1. Perform CreateIntrinsics(_realmRec_). - 1. Set _realmRec_.[[AgentSignifier]] to AgentSignifier(). - 1. Set _realmRec_.[[GlobalObject]] to *undefined*. - 1. Set _realmRec_.[[GlobalEnv]] to *undefined*. - 1. Set _realmRec_.[[TemplateMap]] to a new empty List. - 1. Return _realmRec_. + 1. Let _realm_ be a new Realm Record. + 1. Perform CreateIntrinsics(_realm_). + 1. Set _realm_.[[AgentSignifier]] to AgentSignifier(). + 1. Set _realm_.[[GlobalObject]] to *undefined*. + 1. Set _realm_.[[GlobalEnv]] to *undefined*. + 1. Set _realm_.[[TemplateMap]] to a new empty List. + 1. Let _newContext_ be a new execution context. + 1. Set the Function of _newContext_ to *null*. + 1. Set the Realm of _newContext_ to _realm_. + 1. Set the ScriptOrModule of _newContext_ to *null*. + 1. Push _newContext_ onto the execution context stack; _newContext_ is now the running execution context. + 1. If the host requires use of an exotic object to serve as _realm_'s global object, then + 1. Let _global_ be such an object created in a host-defined manner. + 1. Else, + 1. Let _global_ be OrdinaryObjectCreate(_realm_.[[Intrinsics]].[[%Object.prototype%]]). + 1. If the host requires that the `this` binding in _realm_'s global scope return an object other than the global object, then + 1. Let _thisValue_ be such an object created in a host-defined manner. + 1. Else, + 1. Let _thisValue_ be _global_. + 1. Set _realm_.[[GlobalObject]] to _global_. + 1. Set _realm_.[[GlobalEnv]] to NewGlobalEnvironment(_global_, _thisValue_). + 1. Perform ? SetDefaultGlobalBindings(_realm_). + 1. Create any host-defined global object properties on _global_. + 1. Return ~unused~.
- -- SetRealmGlobalObject ( - _realmRec_: a Realm Record, - _globalObj_: an Object or *undefined*, - _thisValue_: an Object or *undefined*, - ): ~unused~ -
--
-- 1. If _globalObj_ is *undefined*, then - 1. Let _intrinsics_ be _realmRec_.[[Intrinsics]]. - 1. Set _globalObj_ to OrdinaryObjectCreate(_intrinsics_.[[%Object.prototype%]]). - 1. Assert: _globalObj_ is an Object. - 1. If _thisValue_ is *undefined*, set _thisValue_ to _globalObj_. - 1. Set _realmRec_.[[GlobalObject]] to _globalObj_. - 1. Let _newGlobalEnv_ be NewGlobalEnvironment(_globalObj_, _thisValue_). - 1. Set _realmRec_.[[GlobalEnv]] to _newGlobalEnv_. - 1. Return ~unused~. - -@@ -11676,14 +11764,16 @@ SetDefaultGlobalBindings ( _realmRec_: a Realm Record, - ): either a normal completion containing an Object or a throw completion + ): either a normal completion containing ~unused~ or a throw completion
@@ -11664,7 +11752,7 @@
1. Let _name_ be the String value of the property name. 1. Let _desc_ be the fully populated data Property Descriptor for the property, containing the specified attributes for the property. For properties listed in
, , or the value of the [[Value]] attribute is the corresponding intrinsic object from _realmRec_. 1. Perform ? DefinePropertyOrThrow(_global_, _name_, _desc_). - 1. Return _global_. + 1. Return ~unused~. Execution Contexts
An execution context contains whatever implementation specific state is necessary to track the execution progress of its associated code. Each execution context has at least the state components listed in
. -
- + +- Component - -- Purpose - -+ ++ Component + ++ Purpose + +code evaluation state @@ -11723,14 +11813,16 @@ Execution Contexts
ECMAScript code execution contexts have the additional state components listed in
. -
- + +- Component - -- Purpose - -+ ++ Component + ++ Purpose + +LexicalEnvironment @@ -11761,14 +11853,16 @@ Execution Contexts
Execution contexts representing the evaluation of Generators have the additional state components listed in
. -
- + +- Component - -- Purpose - -+ ++ Component + ++ Purpose + +Generator @@ -11886,7 +11980,7 @@ Jobs and Host Operations to Enqueue Jobs
- At some future point in time, when there is no running context in the agent for which the job is scheduled and that agent's execution context stack is empty, the implementation must:
@@ -11927,17 +12021,19 @@
- Perform any host-defined preparation steps.
-- Invoke the Job Abstract Closure.
+Invoke the Job Abstract Closure.- Perform any host-defined cleanup steps, after which the execution context stack must be empty.
JobCallback Records
JobCallback Records have the fields listed in
. -
- + +- Field Name - -- Value - -- Meaning - -+ ++ Field Name + ++ Value + ++ Meaning + +[[Callback]] @@ -12065,27 +12161,6 @@ -
- -InitializeHostDefinedRealm ( ): either a normal completion containing ~unused~ or a throw completion
--
- -- 1. Let _realm_ be CreateRealm(). - 1. Let _newContext_ be a new execution context. - 1. Set the Function of _newContext_ to *null*. - 1. Set the Realm of _newContext_ to _realm_. - 1. Set the ScriptOrModule of _newContext_ to *null*. - 1. Push _newContext_ onto the execution context stack; _newContext_ is now the running execution context. - 1. If the host requires use of an exotic object to serve as _realm_'s global object, let _global_ be such an object created in a host-defined manner. Otherwise, let _global_ be *undefined*, indicating that an ordinary object should be created as the global object. - 1. If the host requires that the `this` binding in _realm_'s global scope return an object other than the global object, let _thisValue_ be such an object created in a host-defined manner. Otherwise, let _thisValue_ be *undefined*, indicating that _realm_'s global `this` binding should be the global object. - 1. Perform SetRealmGlobalObject(_realm_, _global_, _thisValue_). - 1. Let _globalObj_ be ? SetDefaultGlobalBindings(_realm_). - 1. Create any host-defined global object properties on _globalObj_. - 1. Return ~unused~. - -Agents
@@ -12098,11 +12173,13 @@Agents
An agent signifier is a globally-unique opaque value used to identify an Agent.
-
- + +Field Name -Value -Meaning -+ +Field Name +Value +Meaning +[[LittleEndian]] a Boolean @@ -12530,7 +12607,7 @@1. Return *true*.
- @@ -13035,17 +13112,19 @@The loop in step
+guarantees that there will be no circularities in any prototype chain that only includes objects that use the ordinary object definitions for [[GetPrototypeOf]] and [[SetPrototypeOf]]. The loop in step
guarantees that there will be no cycles in any prototype chain that only includes objects that use the ordinary object definitions for [[GetPrototypeOf]] and [[SetPrototypeOf]]. ECMAScript Function Objects
In addition to [[Extensible]] and [[Prototype]], ECMAScript function objects also have the internal slots listed in
. -
- + +- Internal Slot - -- Type - -- Description - -+ ++ Internal Slot + ++ Type + ++ Description + +[[Environment]] @@ -13356,7 +13435,7 @@ 1. Else, 1. Let _rhs_ be ? Evaluation of |AssignmentExpression|. 1. Let _value_ be ? GetValue(_rhs_). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _value_, [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_value_).
Even though field initializers constitute a function boundary, calling FunctionDeclarationInstantiation does not have any observable effect and so is omitted.
@@ -13896,17 +13975,19 @@Bound Function Exotic Objects
Bound function exotic objects do not have the internal slots of ECMAScript function objects listed in
. Instead they have the internal slots listed in , in addition to [[Prototype]] and [[Extensible]]. -
- + +- Internal Slot - -- Type - -- Description - -+ ++ Internal Slot + ++ Type + ++ Description + +[[BoundTargetFunction]] @@ -14094,7 +14175,7 @@ 1. If _thisRealm_ and _realmC_ are not the same Realm Record, then 1. If SameValue(_C_, _realmC_.[[Intrinsics]].[[%Array%]]) is *true*, set _C_ to *undefined*. 1. If _C_ is an Object, then - 1. Set _C_ to ? Get(_C_, @@species). + 1. Set _C_ to ? Get(_C_, %Symbol.species%). 1. If _C_ is *null*, set _C_ to *undefined*. 1. If _C_ is *undefined*, return ? ArrayCreate(_length_). 1. If IsConstructor(_C_) is *false*, throw a *TypeError* exception. @@ -14260,7 +14341,7 @@
1. If _P_ is not a String, return *undefined*. 1. Let _index_ be CanonicalNumericIndexString(_P_). 1. If _index_ is *undefined*, return *undefined*. - 1. If IsIntegralNumber(_index_) is *false*, return *undefined*. + 1. If _index_ is not an integral Number, return *undefined*. 1. If _index_ is *-0*π½, return *undefined*. 1. Let _str_ be _S_.[[StringData]]. 1. Assert: _str_ is a String. @@ -14438,7 +14519,7 @@
1. Let _val_ be _argumentsList_[_index_]. 1. Perform ! CreateDataPropertyOrThrow(_obj_, ! ToString(π½(_index_)), _val_). 1. Set _index_ to _index_ + 1. - 1. Perform ! DefinePropertyOrThrow(_obj_, @@iterator, PropertyDescriptor { [[Value]]: %Array.prototype.values%, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). + 1. Perform ! DefinePropertyOrThrow(_obj_, %Symbol.iterator%, PropertyDescriptor { [[Value]]: %Array.prototype.values%, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). 1. Perform ! DefinePropertyOrThrow(_obj_, *"callee"*, PropertyDescriptor { [[Get]]: %ThrowTypeError%, [[Set]]: %ThrowTypeError%, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Return _obj_. @@ -14486,7 +14567,7 @@
1. Let _p_ be MakeArgSetter(_name_, _env_). 1. Perform ! _map_.[[DefineOwnProperty]](! ToString(π½(_index_)), PropertyDescriptor { [[Set]]: _p_, [[Get]]: _g_, [[Enumerable]]: *false*, [[Configurable]]: *true* }). 1. Set _index_ to _index_ - 1. - 1. Perform ! DefinePropertyOrThrow(_obj_, @@iterator, PropertyDescriptor { [[Value]]: %Array.prototype.values%, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). + 1. Perform ! DefinePropertyOrThrow(_obj_, %Symbol.iterator%, PropertyDescriptor { [[Value]]: %Array.prototype.values%, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). 1. Perform ! DefinePropertyOrThrow(_obj_, *"callee"*, PropertyDescriptor { [[Value]]: _func_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *true* }). 1. Return _obj_. @@ -14694,17 +14775,19 @@
TypedArray With Buffer Witness Records
TypedArray With Buffer Witness Records have the fields listed in
. -
- + +- Field Name - -- Value - -- Meaning - -+ ++ Field Name + ++ Value + ++ Meaning + +[[Object]] @@ -14853,7 +14936,7 @@
1. If IsDetachedBuffer(_O_.[[ViewedArrayBuffer]]) is *true*, return *false*. - 1. If IsIntegralNumber(_index_) is *false*, return *false*. + 1. If _index_ is not an integral Number, return *false*. 1. If _index_ is *-0*π½, return *false*. 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_O_, ~unordered~). 1. NOTE: Bounds checking is not a synchronizing operation when _O_'s backing buffer is a growable SharedArrayBuffer. @@ -14936,17 +15019,19 @@ Module Namespace Exotic Objects
Module namespace exotic objects have the internal slots defined in
. -
- + +- Internal Slot - -- Type - -- Description - -+ ++ Internal Slot + ++ Type + ++ Description + +[[Module]] @@ -15239,14 +15324,16 @@ Proxy Object Internal Methods and Internal Slots
-
- + +- Internal Method - -- Handler Method - -+ ++ Internal Method + ++ Handler Method + +[[GetPrototypeOf]] @@ -15810,7 +15897,7 @@ [[OwnPropertyKeys]] ( ): either a normal completion containing a List of pro 1. If _trap_ is *undefined*, then 1. Return ?
_target_.[[OwnPropertyKeys]]() . 1. Let _trapResultArray_ be ? Call(_trap_, _handler_, Β« _target_ Β»). - 1. Let _trapResult_ be ? CreateListFromArrayLike(_trapResultArray_, Β« String, Symbol Β»). + 1. Let _trapResult_ be ? CreateListFromArrayLike(_trapResultArray_, ~property-key~). 1. If _trapResult_ contains any duplicate entries, throw a *TypeError* exception. 1. Let _extensibleTarget_ be ? IsExtensible(_target_). 1. Let _targetKeys_ be ?_target_.[[OwnPropertyKeys]]() . @@ -15847,7 +15934,7 @@[[OwnPropertyKeys]] ( ): either a normal completion containing a List of pro The returned List contains no duplicate entries.
- - The Type of each result List element is either String or Symbol. + Each element of the returned List is a property key.
- The result List must contain the keys of all non-configurable own properties of the target object. @@ -16272,17 +16359,19 @@
White Space
The ECMAScript white space code points are listed in
. -
- + +- Code Points - -- Name - -- Abbreviation - -+ ++ Code Points + ++ Name + ++ Abbreviation + +`U+0009` @@ -16364,17 +16453,19 @@ Line Terminators
The ECMAScript line terminator code points are listed in
. -
- + +- Code Point - -- Unicode Name - -- Abbreviation - -+ ++ Code Point + ++ Unicode Name + ++ Abbreviation + +`U+000A` @@ -17193,20 +17284,22 @@ Static Semantics: SV ( ): a String
-
- + +- Escape Sequence - -- Code Unit Value - -- Unicode Character Name - -- Symbol - -+ ++ Escape Sequence + ++ Code Unit Value + ++ Unicode Character Name + ++ Symbol + +`\\b` @@ -19133,8 +19226,8 @@
1. Let _propertyNameReference_ be ? Evaluation of _expression_. 1. Let _propertyNameValue_ be ? GetValue(_propertyNameReference_). - 1. Let _propertyKey_ be ? ToPropertyKey(_propertyNameValue_). - 1. Return the Reference Record { [[Base]]: _baseValue_, [[ReferencedName]]: _propertyKey_, [[Strict]]: _strict_, [[ThisValue]]: ~empty~ }. + 1. NOTE: In most cases, ToPropertyKey will be performed on _propertyNameValue_ immediately after this step. However, in the case of `a[b] = c`, it will not be performed until after evaluation of `c`. + 1. Return the Reference Record { [[Base]]: _baseValue_, [[ReferencedName]]: _propertyNameValue_, [[Strict]]: _strict_, [[ThisValue]]: ~empty~ }. @@ -19266,9 +19359,9 @@Runtime Semantics: Evaluation
1. Let _actualThis_ be ? _env_.GetThisBinding(). 1. Let _propertyNameReference_ be ? Evaluation of |Expression|. 1. Let _propertyNameValue_ be ? GetValue(_propertyNameReference_). - 1. Let _propertyKey_ be ? ToPropertyKey(_propertyNameValue_). 1. Let _strict_ be IsStrict(this |SuperProperty|). - 1. Return ? MakeSuperPropertyReference(_actualThis_, _propertyKey_, _strict_). + 1. NOTE: In most cases, ToPropertyKey will be performed on _propertyNameValue_ immediately after this step. However, in the case of `super[b] = c`, it will not be performed until after evaluation of `c`. + 1. Return ? MakeSuperPropertyReference(_actualThis_, _propertyNameValue_, _strict_).SuperProperty : `super` `.` IdentifierName @@ -19313,7 +19406,7 @@ GetSuperConstructor ( ): an ECMAScript language value
MakeSuperPropertyReference ( _actualThis_: an ECMAScript language value, - _propertyKey_: a property key, + _propertyKey_: an ECMAScript language value, _strict_: a Boolean, ): either a normal completion containing a Super Reference Record or a throw completion
@@ -19555,7 +19648,7 @@1. Let _evaluatePromise_ be _module_.Evaluate(). 1. Let _fulfilledClosure_ be a new Abstract Closure with no parameters that captures _module_ and _promiseCapability_ and performs the following steps when called: 1. Let _namespace_ be GetModuleNamespace(_module_). - 1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, Β« _namespace_ Β»). + 1. Perform !
Call (_promiseCapability_.[[Resolve]], *undefined*, Β« _namespace_ Β»). 1. Return ~unused~. 1. Let _onFulfilled_ be CreateBuiltinFunction(_fulfilledClosure_, 0, *""*, Β« Β»). 1. Perform PerformPromiseThen(_evaluatePromise_, _onFulfilled_, _onRejected_). @@ -19827,6 +19920,8 @@Runtime Semantics: Evaluation
1. Assert: IsPrivateReference(_ref_) is *false*. 1. If IsSuperReference(_ref_) is *true*, throw a *ReferenceError* exception. 1. [id="step-delete-operator-toobject"] Let _baseObj_ be ? ToObject(_ref_.[[Base]]). + 1. If _ref_.[[ReferencedName]] is not a property key, then + 1. Set _ref_.[[ReferencedName]] to ? ToPropertyKey(_ref_.[[ReferencedName]]). 1. Let _deleteStatus_ be ?_baseObj_.[[Delete]] (_ref_.[[ReferencedName]]). 1. If _deleteStatus_ is *false* and _ref_.[[Strict]] is *true*, throw a *TypeError* exception. 1. Return _deleteStatus_. @@ -20131,66 +20226,66 @@Syntax
Runtime Semantics: Evaluation
RelationalExpression : RelationalExpression `<` ShiftExpression - 1. Let _lref_ be ? Evaluation of |RelationalExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |ShiftExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Let _r_ be ? IsLessThan(_lval_, _rval_, *true*). + 1. Let _lRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |ShiftExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Let _r_ be ? IsLessThan(_lVal_, _rVal_, *true*). 1. If _r_ is *undefined*, return *false*. Otherwise, return _r_. RelationalExpression : RelationalExpression `>` ShiftExpression - 1. Let _lref_ be ? Evaluation of |RelationalExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |ShiftExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Let _r_ be ? IsLessThan(_rval_, _lval_, *false*). + 1. Let _lRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |ShiftExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Let _r_ be ? IsLessThan(_rVal_, _lVal_, *false*). 1. If _r_ is *undefined*, return *false*. Otherwise, return _r_. RelationalExpression : RelationalExpression `<=` ShiftExpression - 1. Let _lref_ be ? Evaluation of |RelationalExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |ShiftExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Let _r_ be ? IsLessThan(_rval_, _lval_, *false*). + 1. Let _lRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |ShiftExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Let _r_ be ? IsLessThan(_rVal_, _lVal_, *false*). 1. If _r_ is either *true* or *undefined*, return *false*. Otherwise, return *true*. RelationalExpression : RelationalExpression `>=` ShiftExpression - 1. Let _lref_ be ? Evaluation of |RelationalExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |ShiftExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Let _r_ be ? IsLessThan(_lval_, _rval_, *true*). + 1. Let _lRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |ShiftExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Let _r_ be ? IsLessThan(_lVal_, _rVal_, *true*). 1. If _r_ is either *true* or *undefined*, return *false*. Otherwise, return *true*. RelationalExpression : RelationalExpression `instanceof` ShiftExpression - 1. Let _lref_ be ? Evaluation of |RelationalExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |ShiftExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Return ? InstanceofOperator(_lval_, _rval_). + 1. Let _lRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |ShiftExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Return ? InstanceofOperator(_lVal_, _rVal_). RelationalExpression : RelationalExpression `in` ShiftExpression - 1. Let _lref_ be ? Evaluation of |RelationalExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |ShiftExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. If _rval_ is not an Object, throw a *TypeError* exception. - 1. Return ? HasProperty(_rval_, ? ToPropertyKey(_lval_)). + 1. Let _lRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |ShiftExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. If _rVal_ is not an Object, throw a *TypeError* exception. + 1. Return ? HasProperty(_rVal_, ? ToPropertyKey(_lVal_)). RelationalExpression : PrivateIdentifier `in` ShiftExpression 1. Let _privateIdentifier_ be the StringValue of |PrivateIdentifier|. - 1. Let _rref_ be ? Evaluation of |ShiftExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. If _rval_ is not an Object, throw a *TypeError* exception. + 1. Let _rRef_ be ? Evaluation of |ShiftExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. If _rVal_ is not an Object, throw a *TypeError* exception. 1. Let _privateEnv_ be the running execution context's PrivateEnvironment. 1. Let _privateName_ be ResolvePrivateIdentifier(_privateEnv_, _privateIdentifier_). - 1. If PrivateElementFind(_rval_, _privateName_) is not ~empty~, return *true*. + 1. If PrivateElementFind(_rVal_, _privateName_) is not ~empty~, return *true*. 1. Return *false*. @@ -20204,18 +20299,18 @@
- description
-- It implements the generic algorithm for determining if _V_ is an instance of _target_ either by consulting _target_'s @@hasInstance method or, if absent, determining whether the value of _target_'s *"prototype"* property is present in _V_'s prototype chain.
+- It implements the generic algorithm for determining if _V_ is an instance of _target_ either by consulting _target_'s %Symbol.hasInstance% method or, if absent, determining whether the value of _target_'s *"prototype"* property is present in _V_'s prototype chain.
1. If _target_ is not an Object, throw a *TypeError* exception. - 1. Let _instOfHandler_ be ? GetMethod(_target_, @@hasInstance). + 1. Let _instOfHandler_ be ? GetMethod(_target_, %Symbol.hasInstance%). 1. If _instOfHandler_ is not *undefined*, then 1. Return ToBoolean(? Call(_instOfHandler_, _target_, Β« _V_ Β»)). 1. [id="step-instanceof-check-function"] If IsCallable(_target_) is *false*, throw a *TypeError* exception. 1. [id="step-instanceof-fallback"] Return ? OrdinaryHasInstance(_target_, _V_). - @@ -20239,36 +20334,36 @@Steps
+and provide compatibility with previous editions of ECMAScript that did not use a @@hasInstance method to define the `instanceof` operator semantics. If an object does not define or inherit @@hasInstance it uses the default `instanceof` semantics. Steps
and provide compatibility with previous editions of ECMAScript that did not use a %Symbol.hasInstance% method to define the `instanceof` operator semantics. If an object does not define or inherit %Symbol.hasInstance% it uses the default `instanceof` semantics. Syntax
Runtime Semantics: Evaluation
EqualityExpression : EqualityExpression `==` RelationalExpression - 1. Let _lref_ be ? Evaluation of |EqualityExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |RelationalExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Return ? IsLooselyEqual(_rval_, _lval_). + 1. Let _lRef_ be ? Evaluation of |EqualityExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Return ? IsLooselyEqual(_rVal_, _lVal_). EqualityExpression : EqualityExpression `!=` RelationalExpression - 1. Let _lref_ be ? Evaluation of |EqualityExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |RelationalExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Let _r_ be ? IsLooselyEqual(_rval_, _lval_). + 1. Let _lRef_ be ? Evaluation of |EqualityExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Let _r_ be ? IsLooselyEqual(_rVal_, _lVal_). 1. If _r_ is *true*, return *false*. Otherwise, return *true*. EqualityExpression : EqualityExpression `===` RelationalExpression - 1. Let _lref_ be ? Evaluation of |EqualityExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |RelationalExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Return IsStrictlyEqual(_rval_, _lval_). + 1. Let _lRef_ be ? Evaluation of |EqualityExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Return IsStrictlyEqual(_rVal_, _lVal_). EqualityExpression : EqualityExpression `!==` RelationalExpression - 1. Let _lref_ be ? Evaluation of |EqualityExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |RelationalExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Let _r_ be IsStrictlyEqual(_rval_, _lval_). + 1. Let _lRef_ be ? Evaluation of |EqualityExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |RelationalExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Let _r_ be IsStrictlyEqual(_rVal_, _lVal_). 1. If _r_ is *true*, return *false*. Otherwise, return *true*. @@ -20378,31 +20473,29 @@ Syntax
Runtime Semantics: Evaluation
LogicalANDExpression : LogicalANDExpression `&&` BitwiseORExpression - 1. Let _lref_ be ? Evaluation of |LogicalANDExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _lbool_ be ToBoolean(_lval_). - 1. If _lbool_ is *false*, return _lval_. - 1. Let _rref_ be ? Evaluation of |BitwiseORExpression|. - 1. Return ? GetValue(_rref_). + 1. Let _lRef_ be ? Evaluation of |LogicalANDExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. If ToBoolean(_lVal_) is *false*, return _lVal_. + 1. Let _rRef_ be ? Evaluation of |BitwiseORExpression|. + 1. Return ? GetValue(_rRef_). LogicalORExpression : LogicalORExpression `||` LogicalANDExpression - 1. Let _lref_ be ? Evaluation of |LogicalORExpression|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _lbool_ be ToBoolean(_lval_). - 1. If _lbool_ is *true*, return _lval_. - 1. Let _rref_ be ? Evaluation of |LogicalANDExpression|. - 1. Return ? GetValue(_rref_). + 1. Let _lRef_ be ? Evaluation of |LogicalORExpression|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. If ToBoolean(_lVal_) is *true*, return _lVal_. + 1. Let _rRef_ be ? Evaluation of |LogicalANDExpression|. + 1. Return ? GetValue(_rRef_). CoalesceExpression : CoalesceExpressionHead `??` BitwiseORExpression - 1. Let _lref_ be ? Evaluation of |CoalesceExpressionHead|. - 1. Let _lval_ be ? GetValue(_lref_). - 1. If _lval_ is either *undefined* or *null*, then - 1. Let _rref_ be ? Evaluation of |BitwiseORExpression|. - 1. Return ? GetValue(_rref_). + 1. Let _lRef_ be ? Evaluation of |CoalesceExpressionHead|. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. If _lVal_ is either *undefined* or *null*, then + 1. Let _rRef_ be ? Evaluation of |BitwiseORExpression|. + 1. Return ? GetValue(_rRef_). 1. Else, - 1. Return _lval_. + 1. Return _lVal_. @@ -20423,9 +20516,9 @@Syntax
Runtime Semantics: Evaluation
ConditionalExpression : ShortCircuitExpression `?` AssignmentExpression `:` AssignmentExpression - 1. Let _lref_ be ? Evaluation of |ShortCircuitExpression|. - 1. Let _lval_ be ToBoolean(? GetValue(_lref_)). - 1. If _lval_ is *true*, then + 1. Let _lRef_ be ? Evaluation of |ShortCircuitExpression|. + 1. Let _lVal_ be ToBoolean(? GetValue(_lRef_)). + 1. If _lVal_ is *true*, then 1. Let _trueRef_ be ? Evaluation of the first |AssignmentExpression|. 1. Return ? GetValue(_trueRef_). 1. Else, @@ -20485,32 +20578,35 @@ @@ -22333,17 +22449,19 @@Runtime Semantics: Evaluation
AssignmentExpression : LeftHandSideExpression `=` AssignmentExpression 1. If |LeftHandSideExpression| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then - 1. Let _lref_ be ? Evaluation of |LeftHandSideExpression|. - 1. If IsAnonymousFunctionDefinition(|AssignmentExpression|) and IsIdentifierRef of |LeftHandSideExpression| are both *true*, then - 1. Let _rval_ be ? NamedEvaluation of |AssignmentExpression| with argument _lref_.[[ReferencedName]]. + 1. Let _lRef_ be ? Evaluation of |LeftHandSideExpression|. + 1. If IsAnonymousFunctionDefinition(|AssignmentExpression|) is *true* and IsIdentifierRef of |LeftHandSideExpression| is *true*, then + 1. Let _lhs_ be the StringValue of |LeftHandSideExpression|. + 1. Let _rVal_ be ? NamedEvaluation of |AssignmentExpression| with argument _lhs_. 1. Else, - 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. [id="step-assignmentexpression-evaluation-simple-putvalue"] Perform ? PutValue(_lref_, _rval_). - 1. Return _rval_. + 1. Let _rRef_ be ? Evaluation of |AssignmentExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. [id="step-assignmentexpression-evaluation-simple-putvalue"] Perform ? PutValue(_lRef_, _rVal_). + 1. Return _rVal_. 1. Let _assignmentPattern_ be the |AssignmentPattern| that is covered by |LeftHandSideExpression|. - 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Perform ? DestructuringAssignmentEvaluation of _assignmentPattern_ with argument _rval_. - 1. Return _rval_. + 1. Let _rRef_ be ? Evaluation of |AssignmentExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Perform ? DestructuringAssignmentEvaluation of _assignmentPattern_ with argument _rVal_. + 1. Return _rVal_. AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression - 1. Let _lref_ be ? Evaluation of |LeftHandSideExpression|. - 1. [id="step-assignmentexpression-evaluation-compound-getvalue"] Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. - 1. Let _rval_ be ? GetValue(_rref_). + 1. Let _lRef_ be ? Evaluation of |LeftHandSideExpression|. + 1. [id="step-assignmentexpression-evaluation-compound-getvalue"] Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |AssignmentExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). 1. Let _assignmentOpText_ be the source text matched by |AssignmentOperator|. 1. Let _opText_ be the sequence of Unicode code points associated with _assignmentOpText_ in the following table: - 1. Let _r_ be ? ApplyStringOrNumericBinaryOperator(_lval_, _opText_, _rval_). - 1. [id="step-assignmentexpression-evaluation-compound-putvalue"] Perform ? PutValue(_lref_, _r_). + 1. Let _r_ be ? ApplyStringOrNumericBinaryOperator(_lVal_, _opText_, _rVal_). + 1. [id="step-assignmentexpression-evaluation-compound-putvalue"] Perform ? PutValue(_lRef_, _r_). 1. Return _r_.-
+ + _assignmentOpText_ _opText_ + _assignmentOpText_ _opText_ `**=` `**` `*=` `*` @@ -20525,113 +20621,131 @@ `/=` `/` Runtime Semantics: Evaluation
`|=` `|` AssignmentExpression : LeftHandSideExpression `&&=` AssignmentExpression - 1. Let _lref_ be ? Evaluation of |LeftHandSideExpression|. - 1. [id="step-assignmentexpression-evaluation-lgcl-and-getvalue"] Let _lval_ be ? GetValue(_lref_). - 1. Let _lbool_ be ToBoolean(_lval_). - 1. If _lbool_ is *false*, return _lval_. + 1. Let _lRef_ be ? Evaluation of |LeftHandSideExpression|. + 1. [id="step-assignmentexpression-evaluation-lgcl-and-getvalue"] Let _lVal_ be ? GetValue(_lRef_). + 1. If ToBoolean(_lVal_) is *false*, return _lVal_. 1. If IsAnonymousFunctionDefinition(|AssignmentExpression|) is *true* and IsIdentifierRef of |LeftHandSideExpression| is *true*, then - 1. Let _rval_ be ? NamedEvaluation of |AssignmentExpression| with argument _lref_.[[ReferencedName]]. + 1. Let _lhs_ be the StringValue of |LeftHandSideExpression|. + 1. Let _rVal_ be ? NamedEvaluation of |AssignmentExpression| with argument _lhs_. 1. Else, - 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. [id="step-assignmentexpression-evaluation-lgcl-and-putvalue"] Perform ? PutValue(_lref_, _rval_). - 1. Return _rval_. + 1. Let _rRef_ be ? Evaluation of |AssignmentExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. [id="step-assignmentexpression-evaluation-lgcl-and-putvalue"] Perform ? PutValue(_lRef_, _rVal_). + 1. Return _rVal_. AssignmentExpression : LeftHandSideExpression `||=` AssignmentExpression - 1. Let _lref_ be ? Evaluation of |LeftHandSideExpression|. - 1. [id="step-assignmentexpression-evaluation-lgcl-or-getvalue"] Let _lval_ be ? GetValue(_lref_). - 1. Let _lbool_ be ToBoolean(_lval_). - 1. If _lbool_ is *true*, return _lval_. + 1. Let _lRef_ be ? Evaluation of |LeftHandSideExpression|. + 1. [id="step-assignmentexpression-evaluation-lgcl-or-getvalue"] Let _lVal_ be ? GetValue(_lRef_). + 1. If ToBoolean(_lVal_) is *true*, return _lVal_. 1. If IsAnonymousFunctionDefinition(|AssignmentExpression|) is *true* and IsIdentifierRef of |LeftHandSideExpression| is *true*, then - 1. Let _rval_ be ? NamedEvaluation of |AssignmentExpression| with argument _lref_.[[ReferencedName]]. + 1. Let _lhs_ be the StringValue of |LeftHandSideExpression|. + 1. Let _rVal_ be ? NamedEvaluation of |AssignmentExpression| with argument _lhs_. 1. Else, - 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. [id="step-assignmentexpression-evaluation-lgcl-or-putvalue"] Perform ? PutValue(_lref_, _rval_). - 1. Return _rval_. + 1. Let _rRef_ be ? Evaluation of |AssignmentExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. [id="step-assignmentexpression-evaluation-lgcl-or-putvalue"] Perform ? PutValue(_lRef_, _rVal_). + 1. Return _rVal_. AssignmentExpression : LeftHandSideExpression `??=` AssignmentExpression - 1. Let _lref_ be ? Evaluation of |LeftHandSideExpression|. - 1. [id="step-assignmentexpression-evaluation-lgcl-nullish-getvalue"] Let _lval_ be ? GetValue(_lref_). - 1. If _lval_ is neither *undefined* nor *null*, return _lval_. + 1. Let _lRef_ be ? Evaluation of |LeftHandSideExpression|. + 1. [id="step-assignmentexpression-evaluation-lgcl-nullish-getvalue"] Let _lVal_ be ? GetValue(_lRef_). + 1. If _lVal_ is neither *undefined* nor *null*, return _lVal_. 1. If IsAnonymousFunctionDefinition(|AssignmentExpression|) is *true* and IsIdentifierRef of |LeftHandSideExpression| is *true*, then - 1. Let _rval_ be ? NamedEvaluation of |AssignmentExpression| with argument _lref_.[[ReferencedName]]. + 1. Let _lhs_ be the StringValue of |LeftHandSideExpression|. + 1. Let _rVal_ be ? NamedEvaluation of |AssignmentExpression| with argument _lhs_. 1. Else, - 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. - 1. Let _rval_ be ? GetValue(_rref_). - 1. [id="step-assignmentexpression-evaluation-lgcl-nullish-putvalue"] Perform ? PutValue(_lref_, _rval_). - 1. Return _rval_. + 1. Let _rRef_ be ? Evaluation of |AssignmentExpression|. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. [id="step-assignmentexpression-evaluation-lgcl-nullish-putvalue"] Perform ? PutValue(_lRef_, _rVal_). + 1. Return _rVal_. - When this expression occurs within strict mode code, it is a runtime error if _lref_ in step
+, , , , is an unresolvable reference. If it is, a *ReferenceError* exception is thrown. Additionally, it is a runtime error if the _lref_ in step , , , is a reference to a data property with the attribute value { [[Writable]]: *false* }, to an accessor property with the attribute value { [[Set]]: *undefined* }, or to a non-existent property of an object for which the IsExtensible predicate returns the value *false*. In these cases a *TypeError* exception is thrown. When this expression occurs within strict mode code, it is a runtime error if _lRef_ in step
, , , , is an unresolvable reference. If it is, a *ReferenceError* exception is thrown. Additionally, it is a runtime error if the _lRef_ in step , , , is a reference to a data property with the attribute value { [[Writable]]: *false* }, to an accessor property with the attribute value { [[Set]]: *undefined* }, or to a non-existent property of an object for which the IsExtensible predicate returns the value *false*. In these cases a *TypeError* exception is thrown. @@ -20842,7 +20956,7 @@ ApplyStringOrNumericBinaryOperator ( - _lval_: an ECMAScript language value, + _lVal_: an ECMAScript language value, _opText_: `**`, `*`, `/`, `%`, `+`, `-`, `<<`, `>>`, `>>>`, `&`, `^`, or `|`, - _rval_: an ECMAScript language value, + _rVal_: an ECMAScript language value, ): either a normal completion containing either a String, a BigInt, or a Number, or a throw completion
1. If _opText_ is `+`, then - 1. [id="step-binary-op-toprimitive-lval"] Let _lprim_ be ? ToPrimitive(_lval_). - 1. [id="step-binary-op-toprimitive-rval"] Let _rprim_ be ? ToPrimitive(_rval_). - 1. [id="step-binary-op-string-check"] If _lprim_ is a String or _rprim_ is a String, then - 1. Let _lstr_ be ? ToString(_lprim_). - 1. Let _rstr_ be ? ToString(_rprim_). - 1. Return the string-concatenation of _lstr_ and _rstr_. - 1. Set _lval_ to _lprim_. - 1. Set _rval_ to _rprim_. + 1. [id="step-binary-op-toprimitive-lval"] Let _lPrim_ be ? ToPrimitive(_lVal_). + 1. [id="step-binary-op-toprimitive-rval"] Let _rPrim_ be ? ToPrimitive(_rVal_). + 1. [id="step-binary-op-string-check"] If _lPrim_ is a String or _rPrim_ is a String, then + 1. Let _lStr_ be ? ToString(_lPrim_). + 1. Let _rStr_ be ? ToString(_rPrim_). + 1. Return the string-concatenation of _lStr_ and _rStr_. + 1. Set _lVal_ to _lPrim_. + 1. Set _rVal_ to _rPrim_. 1. NOTE: At this point, it must be a numeric operation. - 1. Let _lnum_ be ? ToNumeric(_lval_). - 1. Let _rnum_ be ? ToNumeric(_rval_). - 1. If Type(_lnum_) is not Type(_rnum_), throw a *TypeError* exception. - 1. If _lnum_ is a BigInt, then - 1. If _opText_ is `**`, return ? BigInt::exponentiate(_lnum_, _rnum_). - 1. If _opText_ is `/`, return ? BigInt::divide(_lnum_, _rnum_). - 1. If _opText_ is `%`, return ? BigInt::remainder(_lnum_, _rnum_). - 1. If _opText_ is `>>>`, return ? BigInt::unsignedRightShift(_lnum_, _rnum_). - 1. Let _operation_ be the abstract operation associated with _opText_ and Type(_lnum_) in the following table: - - -- 1. Return _operation_(_lnum_, _rnum_). + 1. Let _lNum_ be ? ToNumeric(_lVal_). + 1. Let _rNum_ be ? ToNumeric(_rVal_). + 1. If SameType(_lNum_, _rNum_) is *false*, throw a *TypeError* exception. + 1. If _lNum_ is a BigInt, then + 1. If _opText_ is `**`, return ? BigInt::exponentiate(_lNum_, _rNum_). + 1. If _opText_ is `/`, return ? BigInt::divide(_lNum_, _rNum_). + 1. If _opText_ is `%`, return ? BigInt::remainder(_lNum_, _rNum_). + 1. If _opText_ is `>>>`, return ? BigInt::unsignedRightShift(_lNum_, _rNum_). + 1. Let _operation_ be the abstract operation associated with _opText_ in the following table: +-
-- _opText_ Type(_lnum_) _operation_ - `**` Number Number::exponentiate - `*` Number Number::multiply - `*` BigInt BigInt::multiply - `/` Number Number::divide - `%` Number Number::remainder - `+` Number Number::add - `+` BigInt BigInt::add - `-` Number Number::subtract - `-` BigInt BigInt::subtract - `<<` Number Number::leftShift - `<<` BigInt BigInt::leftShift - `>>` Number Number::signedRightShift - `>>` BigInt BigInt::signedRightShift - `>>>` Number Number::unsignedRightShift - `&` Number Number::bitwiseAND - `&` BigInt BigInt::bitwiseAND - `^` Number Number::bitwiseXOR - `^` BigInt BigInt::bitwiseXOR - `|` Number Number::bitwiseOR - `|` BigInt BigInt::bitwiseOR + ++ 1. Else, + 1. Assert: _lNum_ is a Number. + 1. Let _operation_ be the abstract operation associated with _opText_ in the following table: ++ +
++ + + _opText_ _operation_ + `*` BigInt::multiply + `+` BigInt::add + `-` BigInt::subtract + `<<` BigInt::leftShift + `>>` BigInt::signedRightShift + `&` BigInt::bitwiseAND + `^` BigInt::bitwiseXOR + + `|` BigInt::bitwiseOR + ++ 1. Return _operation_(_lNum_, _rNum_).+ +
++ + + _opText_ _operation_ + `**` Number::exponentiate + `*` Number::multiply + `/` Number::divide + `%` Number::remainder + `+` Number::add + `-` Number::subtract + `<<` Number::leftShift + `>>` Number::signedRightShift + `>>>` Number::unsignedRightShift + `&` Number::bitwiseAND + `^` Number::bitwiseXOR + + `|` Number::bitwiseOR No hint is provided in the calls to ToPrimitive in steps
@@ -20652,11 +20766,11 @@and . All standard objects except Dates handle the absence of a hint as if ~number~ were given; Dates handle the absence of a hint as if ~string~ were given. Exotic objects may handle the absence of a hint in some other manner.
- 1. Let _lref_ be ? Evaluation of _leftOperand_. - 1. Let _lval_ be ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of _rightOperand_. - 1. Let _rval_ be ? GetValue(_rref_). - 1. Return ? ApplyStringOrNumericBinaryOperator(_lval_, _opText_, _rval_). + 1. Let _lRef_ be ? Evaluation of _leftOperand_. + 1. Let _lVal_ be ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of _rightOperand_. + 1. Let _rVal_ be ? GetValue(_rRef_). + 1. Return ? ApplyStringOrNumericBinaryOperator(_lVal_, _opText_, _rVal_).
AssignmentProperty : IdentifierReference Initializer? 1. Let _P_ be the StringValue of |IdentifierReference|. - 1. Let _lref_ be ? ResolveBinding(_P_). + 1. Let _lRef_ be ? ResolveBinding(_P_). 1. Let _v_ be ? GetV(_value_, _P_). 1. If |Initializer| is present and _v_ is *undefined*, then 1. If IsAnonymousFunctionDefinition(|Initializer|) is *true*, then @@ -20850,7 +20964,7 @@ @@ -20873,10 +20987,10 @@1. Else, 1. Let _defaultValue_ be ? Evaluation of |Initializer|. 1. Set _v_ to ? GetValue(_defaultValue_). - 1. Perform ? PutValue(_lref_, _v_). + 1. Perform ? PutValue(_lRef_, _v_). 1. Return Β« _P_ Β».
AssignmentRestProperty : `...` DestructuringAssignmentTarget - 1. Let _lref_ be ? Evaluation of |DestructuringAssignmentTarget|. + 1. Let _lRef_ be ? Evaluation of |DestructuringAssignmentTarget|. 1. Let _restObj_ be OrdinaryObjectCreate(%Object.prototype%). 1. Perform ? CopyDataProperties(_restObj_, _value_, _excludedNames_). - 1. Return ? PutValue(_lref_, _restObj_). + 1. Return ? PutValue(_lRef_, _restObj_). @@ -20922,7 +21036,7 @@
AssignmentElement : DestructuringAssignmentTarget Initializer? 1. If |DestructuringAssignmentTarget| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then - 1. Let _lref_ be ? Evaluation of |DestructuringAssignmentTarget|. + 1. Let _lRef_ be ? Evaluation of |DestructuringAssignmentTarget|. 1. Let _value_ be *undefined*. 1. If _iteratorRecord_.[[Done]] is *false*, then 1. Let _next_ be ? IteratorStepValue(_iteratorRecord_). @@ -20930,7 +21044,8 @@ 1. Set _value_ to _next_. 1. If |Initializer| is present and _value_ is *undefined*, then 1. If IsAnonymousFunctionDefinition(|Initializer|) is *true* and IsIdentifierRef of |DestructuringAssignmentTarget| is *true*, then - 1. Let _v_ be ? NamedEvaluation of |Initializer| with argument _lref_.[[ReferencedName]]. + 1. Let _target_ be the StringValue of |DestructuringAssignmentTarget|. + 1. Let _v_ be ? NamedEvaluation of |Initializer| with argument _target_. 1. Else, 1. Let _defaultValue_ be ? Evaluation of |Initializer|. 1. Let _v_ be ? GetValue(_defaultValue_). @@ -20939,7 +21054,7 @@
1. If |DestructuringAssignmentTarget| is either an |ObjectLiteral| or an |ArrayLiteral|, then 1. Let _nestedAssignmentPattern_ be the |AssignmentPattern| that is covered by |DestructuringAssignmentTarget|. 1. Return ? DestructuringAssignmentEvaluation of _nestedAssignmentPattern_ with argument _v_. - 1. Return ? PutValue(_lref_, _v_). + 1. Return ? PutValue(_lRef_, _v_).
Left to right evaluation order is maintained by evaluating a |DestructuringAssignmentTarget| that is not a destructuring pattern prior to accessing the iterator or evaluating the |Initializer|.
@@ -20947,7 +21062,7 @@
AssignmentRestElement : `...` DestructuringAssignmentTarget 1. If |DestructuringAssignmentTarget| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then - 1. Let _lref_ be ? Evaluation of |DestructuringAssignmentTarget|. + 1. Let _lRef_ be ? Evaluation of |DestructuringAssignmentTarget|. 1. Let _A_ be ! ArrayCreate(0). 1. Let _n_ be 0. 1. Repeat, while _iteratorRecord_.[[Done]] is *false*, @@ -20956,7 +21071,7 @@ @@ -20974,11 +21089,12 @@1. Perform ! CreateDataPropertyOrThrow(_A_, ! ToString(π½(_n_)), _next_). 1. Set _n_ to _n_ + 1. 1. If |DestructuringAssignmentTarget| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then - 1. Return ? PutValue(_lref_, _A_). + 1. Return ? PutValue(_lRef_, _A_). 1. Let _nestedAssignmentPattern_ be the |AssignmentPattern| that is covered by |DestructuringAssignmentTarget|. 1. Return ? DestructuringAssignmentEvaluation of _nestedAssignmentPattern_ with argument _A_.
AssignmentElement : DestructuringAssignmentTarget Initializer? 1. If |DestructuringAssignmentTarget| is neither an |ObjectLiteral| nor an |ArrayLiteral|, then - 1. Let _lref_ be ? Evaluation of |DestructuringAssignmentTarget|. + 1. Let _lRef_ be ? Evaluation of |DestructuringAssignmentTarget|. 1. Let _v_ be ? GetV(_value_, _propertyName_). 1. If |Initializer| is present and _v_ is *undefined*, then - 1. If IsAnonymousFunctionDefinition(|Initializer|) and IsIdentifierRef of |DestructuringAssignmentTarget| are both *true*, then - 1. Let _rhsValue_ be ? NamedEvaluation of |Initializer| with argument _lref_.[[ReferencedName]]. + 1. If IsAnonymousFunctionDefinition(|Initializer|) is *true* and IsIdentifierRef of |DestructuringAssignmentTarget| is *true*, then + 1. Let _target_ be the StringValue of |DestructuringAssignmentTarget|. + 1. Let _rhsValue_ be ? NamedEvaluation of |Initializer| with argument _target_. 1. Else, 1. Let _defaultValue_ be ? Evaluation of |Initializer|. 1. Let _rhsValue_ be ? GetValue(_defaultValue_). @@ -20987,7 +21103,7 @@ @@ -21006,10 +21122,10 @@1. If |DestructuringAssignmentTarget| is either an |ObjectLiteral| or an |ArrayLiteral|, then 1. Let _assignmentPattern_ be the |AssignmentPattern| that is covered by |DestructuringAssignmentTarget|. 1. Return ? DestructuringAssignmentEvaluation of _assignmentPattern_ with argument _rhsValue_. - 1. Return ? PutValue(_lref_, _rhsValue_). + 1. Return ? PutValue(_lRef_, _rhsValue_).
Syntax
Runtime Semantics: Evaluation
Expression : Expression `,` AssignmentExpression - 1. Let _lref_ be ? Evaluation of |Expression|. - 1. Perform ? GetValue(_lref_). - 1. Let _rref_ be ? Evaluation of |AssignmentExpression|. - 1. Return ? GetValue(_rref_). + 1. Let _lRef_ be ? Evaluation of |Expression|. + 1. Perform ? GetValue(_lRef_). + 1. Let _rRef_ be ? Evaluation of |AssignmentExpression|. + 1. Return ? GetValue(_rRef_). GetValue must be called even though its value is not used because it may have observable side-effects.
@@ -21332,8 +21448,8 @@Runtime Semantics: Evaluation
VariableDeclaration : BindingPattern Initializer 1. Let _rhs_ be ? Evaluation of |Initializer|. - 1. Let _rval_ be ? GetValue(_rhs_). - 1. Return ? BindingInitialization of |BindingPattern| with arguments _rval_ and *undefined*. + 1. Let _rVal_ be ? GetValue(_rhs_). + 1. Return ? BindingInitialization of |BindingPattern| with arguments _rVal_ and *undefined*. @@ -22319,11 +22435,11 @@%ForInIteratorPrototype%.next ( )
1. Let _desc_ be ?_object_.[[GetOwnProperty]] (_r_). 1. If _desc_ is not *undefined*, then 1. Append _r_ to _O_.[[VisitedKeys]]. - 1. If _desc_.[[Enumerable]] is *true*, return CreateIterResultObject(_r_, *false*). + 1. If _desc_.[[Enumerable]] is *true*, return CreateIteratorResultObject(_r_, *false*). 1. Set _object_ to ?_object_.[[GetPrototypeOf]]() . 1. Set _O_.[[Object]] to _object_. 1. Set _O_.[[ObjectWasVisited]] to *false*. - 1. If _object_ is *null*, return CreateIterResultObject(*undefined*, *true*). + 1. If _object_ is *null*, return CreateIteratorResultObject(*undefined*, *true*).Properties of For-In Iterator Instances
For-In Iterator instances are ordinary objects that inherit properties from the %ForInIteratorPrototype% intrinsic object. For-In Iterator instances are initially created with the internal slots listed in
. -
- + +- Internal Slot - -- Type - -- Description - -+ ++ Internal Slot + ++ Type + ++ Description + +[[Object]] @@ -22481,14 +22599,14 @@ Syntax
Runtime Semantics: Evaluation
ReturnStatement : `return` `;` - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: *undefined*, [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(*undefined*). ReturnStatement : `return` Expression `;` 1. Let _exprRef_ be ? Evaluation of |Expression|. 1. Let _exprValue_ be ? GetValue(_exprRef_). 1. If GetGeneratorKind() is ~async~, set _exprValue_ to ? Await(_exprValue_). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _exprValue_, [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_exprValue_). @@ -23219,7 +23337,7 @@Static Semantics: HasInitializer ( ): a Boolean
- @@ -23913,8 +24031,9 @@Static Semantics: ExpectedArgumentCount ( ): an integer
+Static Semantics: ExpectedArgumentCount ( ): a non-negative integer
@@ -23590,7 +23708,7 @@ Runtime Semantics: Evaluation
1. Let _exprRef_ be ? Evaluation of |AssignmentExpression|. 1. Let _exprValue_ be ? GetValue(_exprRef_). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _exprValue_, [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_exprValue_). 1. Perform ? FunctionDeclarationInstantiation(_functionObject_, _argumentsList_). 1. Let _G_ be ? OrdinaryCreateFromConstructor(_functionObject_, *"%GeneratorFunction.prototype.prototype%"*, Β« [[GeneratorState]], [[GeneratorContext]], [[GeneratorBrand]] Β»). 1. Set _G_.[[GeneratorBrand]] to ~empty~. + 1. Set _G_.[[GeneratorState]] to ~suspended-start~. 1. Perform GeneratorStart(_G_, |FunctionBody|). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _G_, [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_G_). @@ -24054,14 +24173,14 @@
Runtime Semantics: Evaluation
1. Set _value_ to _received_.[[Value]]. 1. If _generatorKind_ is ~async~, then 1. Set _value_ to ? Await(_value_). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _value_, [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_value_). 1. Let _innerReturnResult_ be ? Call(_return_, _iterator_, Β« _received_.[[Value]] Β»). 1. If _generatorKind_ is ~async~, set _innerReturnResult_ to ? Await(_innerReturnResult_). 1. If _innerReturnResult_ is not an Object, throw a *TypeError* exception. 1. Let _done_ be ? IteratorComplete(_innerReturnResult_). 1. If _done_ is *true*, then 1. Set _value_ to ? IteratorValue(_innerReturnResult_). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _value_, [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_value_). 1. If _generatorKind_ is ~async~, set _received_ to Completion(AsyncGeneratorYield(? IteratorValue(_innerReturnResult_))). 1. Else, set _received_ to Completion(GeneratorYield(_innerReturnResult_)). @@ -24140,8 +24259,9 @@1. Perform ? FunctionDeclarationInstantiation(_functionObject_, _argumentsList_). 1. Let _generator_ be ? OrdinaryCreateFromConstructor(_functionObject_, *"%AsyncGeneratorFunction.prototype.prototype%"*, Β« [[AsyncGeneratorState]], [[AsyncGeneratorContext]], [[AsyncGeneratorQueue]], [[GeneratorBrand]] Β»). 1. Set _generator_.[[GeneratorBrand]] to ~empty~. + 1. Set _generator_.[[AsyncGeneratorState]] to ~suspended-start~. 1. Perform AsyncGeneratorStart(_generator_, |FunctionBody|). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _generator_, [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_generator_). @@ -24860,7 +24980,7 @@
1. If NewTarget is *undefined*, throw a *TypeError* exception. 1. Let _F_ be the active function object. 1. If _F_.[[ConstructorKind]] is ~derived~, then - 1. NOTE: This branch behaves similarly to `constructor(...args) { super(...args); }`. The most notable distinction is that while the aforementioned ECMAScript source text observably calls the @@iterator method on `%Array.prototype%`, this function does not. + 1. NOTE: This branch behaves similarly to `constructor(...args) { super(...args); }`. The most notable distinction is that while the aforementioned ECMAScript source text observably calls the %Symbol.iterator% method on `%Array.prototype%`, this function does not. 1. Let _func_ be ! _F_.[[GetPrototypeOf]](). 1. If IsConstructor(_func_) is *false*, throw a *TypeError* exception. 1. Let _result_ be ? Construct(_func_, _args_, NewTarget). @@ -25152,12 +25272,12 @@
1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). - 1. Let _declResult_ be Completion(FunctionDeclarationInstantiation(_functionObject_, _argumentsList_)). - 1. If _declResult_ is an abrupt completion, then - 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, Β« _declResult_.[[Value]] Β»). + 1. Let _completion_ be Completion(FunctionDeclarationInstantiation(_functionObject_, _argumentsList_)). + 1. If _completion_ is an abrupt completion, then + 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, Β« _completion_.[[Value]] Β»). 1. Else, 1. Perform AsyncFunctionStart(_promiseCapability_, |FunctionBody|). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _promiseCapability_.[[Promise]], [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_promiseCapability_.[[Promise]]). @@ -25259,12 +25379,12 @@
1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). - 1. Let _declResult_ be Completion(FunctionDeclarationInstantiation(_functionObject_, _argumentsList_)). - 1. If _declResult_ is an abrupt completion, then - 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, Β« _declResult_.[[Value]] Β»). + 1. Let _completion_ be Completion(FunctionDeclarationInstantiation(_functionObject_, _argumentsList_)). + 1. If _completion_ is an abrupt completion, then + 1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, Β« _completion_.[[Value]] Β»). 1. Else, 1. Perform AsyncFunctionStart(_promiseCapability_, |ExpressionBody|). - 1. Return Completion Record { [[Type]]: ~return~, [[Value]]: _promiseCapability_.[[Promise]], [[Target]]: ~empty~ }. + 1. Return ReturnCompletion(_promiseCapability_.[[Promise]]). @@ -26174,14 +26294,16 @@Abstract Module Records
-
- + +- Method - -- Purpose - -+ ++ Method + ++ Purpose + +LoadRequestedModules( [ _hostDefined_ ] ) @@ -26237,17 +26359,19 @@ Cyclic Module Records
In addition to the fields defined in
Cyclic Module Records have the additional fields listed in -
- + +- Field Name - -- Value Type - -- Meaning - -+ ++ Field Name + ++ Value Type + ++ Meaning + +[[Status]] @@ -26385,14 +26509,16 @@ Cyclic Module Records
In addition to the methods defined in
Cyclic Module Records have the additional methods listed in -
- + +- Method - -- Purpose - -+ ++ Method + ++ Purpose + +InitializeEnvironment() @@ -26415,17 +26541,19 @@ Cyclic Module Records
A GraphLoadingState Record is a Record that contains information about the loading process of a module graph. It's used to continue loading after a call to HostLoadImportedModule. Each GraphLoadingState Record has the fields defined in
: -
- + +- Field Name - -- Value Type - -- Meaning - -+ ++ Field Name + ++ Value Type + ++ Meaning + +[[PromiseCapability]] @@ -26847,6 +26975,7 @@ 1. If _result_ is an abrupt completion, then 1. Perform AsyncModuleExecutionRejected(_m_, _result_.[[Value]]). 1. Else, + 1. Set _m_.[[AsyncEvaluation]] to *false*. 1. Set _m_.[[Status]] to ~evaluated~. 1. If _m_.[[TopLevelCapability]] is not ~empty~, then 1. Assert: _m_.[[CycleRoot]] and _m_ are the same Module Record. @@ -26873,6 +27002,8 @@
1. Assert: _module_.[[EvaluationError]] is ~empty~. 1. Set _module_.[[EvaluationError]] to ThrowCompletion(_error_). 1. Set _module_.[[Status]] to ~evaluated~. + 1. Set _module_.[[AsyncEvaluation]] to *false*. + 1. NOTE: _module_.[[AsyncEvaluation]] is set to *false* for symmetry with AsyncModuleExecutionFulfilled. In InnerModuleEvaluation, the value of a module's [[AsyncEvaluation]] internal slot is unused when its [[EvaluationError]] internal slot is not ~empty~. 1. For each Cyclic Module Record _m_ of _module_.[[AsyncParentModules]], do 1. Perform AsyncModuleExecutionRejected(_m_, _error_). 1. If _module_.[[TopLevelCapability]] is not ~empty~, then @@ -26912,7 +27043,7 @@
Example Cyclic Module Record Graphs
- Evaluation must be only performed once, as it can cause side effects; it is thus important to remember whether evaluation has already been performed, even if unsuccessfully. (In the error case, it makes sense to also remember the exception because otherwise subsequent Evaluate() calls would have to synthesize a new one.)
- Linking, on the other hand, is side-effect-free, and thus even if it fails, it can be retried at a later time with no issues.
-- Loading closely interacts with the host, and it may be desiderable for some of them to allow users to retry failed loads (for example, if the failure is caused by temporarily bad network conditions).
+- Loading closely interacts with the host, and it may be desirable for some of them to allow users to retry failed loads (for example, if the failure is caused by temporarily bad network conditions).
Now, consider a module graph with a cycle:
@@ -26929,7 +27060,7 @@Example Cyclic Module Record Graphs
Now consider a case where _A_ has a linking error; for example, it tries to import a binding from _C_ that does not exist. In that case, the above steps still occur, including the early return from the second call to InnerModuleLinking on _A_. However, once we unwind back to the original InnerModuleLinking on _A_, it fails during InitializeEnvironment, namely right after _C_.ResolveExport(). The thrown *SyntaxError* exception propagates up to _A_.Link, which resets all modules that are currently on its _stack_ (these are always exactly the modules that are still ~linking~). Hence both _A_ and _B_ become ~unlinked~. Note that _C_ is left as ~linked~.
-Alternatively, consider a case where _A_ has an evaluation error; for example, its source code throws an exception. In that case, the evaluation-time analog of the above steps still occurs, including the early return from the second call to InnerModuleEvaluation on _A_. However, once we unwind back to the original InnerModuleEvaluation on _A_, it fails by assumption. The exception thrown propagates up to _A_.Evaluate(), which records the error in all modules that are currently on its _stack_ (i.e., the modules that are still ~evaluating~) as well as via [[AsyncParentModules]], which form a chain for modules which contain or depend on top-level `await` through the whole dependency graph through the AsyncModuleExecutionRejected algorithm. Hence both _A_ and _B_ become ~evaluated~ and the exception is recorded in both _A_ and _B_'s [[EvaluationError]] fields, while _C_ is left as ~evaluated~ with no [[EvaluationError]].
+Alternatively, consider a case where _A_ has an evaluation error; for example, its source code throws an exception. In that case, the evaluation-time analogue of the above steps still occurs, including the early return from the second call to InnerModuleEvaluation on _A_. However, once we unwind back to the original InnerModuleEvaluation on _A_, it fails by assumption. The exception thrown propagates up to _A_.Evaluate(), which records the error in all modules that are currently on its _stack_ (i.e., the modules that are still ~evaluating~) as well as via [[AsyncParentModules]], which form a chain for modules which contain or depend on top-level `await` through the whole dependency graph through the AsyncModuleExecutionRejected algorithm. Hence both _A_ and _B_ become ~evaluated~ and the exception is recorded in both _A_ and _B_'s [[EvaluationError]] fields, while _C_ is left as ~evaluated~ with no [[EvaluationError]].
Lastly, consider a module graph with a cycle, where all modules complete asynchronously:
@@ -26943,58 +27074,65 @@ Example Cyclic Module Record Graphs
@@ -27006,31 +27144,39 @@
- Module -[[DFSIndex]] -[[DFSAncestorIndex]] -[[Status]] -[[AsyncEvaluation]] -[[AsyncParentModules]] -[[PendingAsyncDependencies]] ++ Field + +++ Module +_A_ +_B_ +_C_ +_D_ +_E_ - _A_ +[[DFSIndex]] 0 -0 -~evaluating-async~ -*true* -Β« Β» -2 (_B_ and _C_) +1 +3 +2 +4 - _B_ -1 +[[DFSAncestorIndex]] 0 -~evaluating-async~ -*true* -Β« _A_ Β» -1 (_D_) +0 +0 +0 +4 - _C_ -3 -0 +[[Status]] +~evaluating-async~ +~evaluating-async~ +~evaluating-async~ +~evaluating-async~ ~evaluating-async~ -*true* -Β« _A_ Β» -2 (_D_ and _E_) - _D_ -2 -0 -~evaluating-async~ +[[AsyncEvaluation]] +*true* +*true* +*true* +*true* *true* -Β« _B_, _C_ Β» -0 - +_E_ -4 -4 -~evaluating-async~ -*true* +[[AsyncParentModules]] +Β« Β» +Β« _A_ Β» +Β« _A_ Β» +Β« _B_, _C_ Β» Β« _C_ Β» ++ [[PendingAsyncDependencies]] +2 (_B_ and _C_) +1 (_D_) +2 (_D_ and _E_) +0 0 Example Cyclic Module Record Graphs
@@ -27042,40 +27188,46 @@
- Module -[[DFSIndex]] -[[DFSAncestorIndex]] -[[Status]] -[[AsyncEvaluation]] -[[AsyncParentModules]] -[[PendingAsyncDependencies]] +Fields / Modules +_C_ +_E_ - _C_ +[[DFSIndex]] 3 -0 -~evaluating-async~ -*true* -Β« _A_ Β» -1 (_D_) +4 - +_E_ -4 +[[DFSAncestorIndex]] +0 4 ++ +[[Status]] +~evaluating-async~ ~evaluated~ ++ +[[AsyncEvaluation]] +*true* *true* ++ +[[AsyncParentModules]] +Β« _A_ Β» Β« _C_ Β» ++ [[PendingAsyncDependencies]] +1 (_D_) 0 Example Cyclic Module Record Graphs
@@ -27087,31 +27239,39 @@
- Module -[[DFSIndex]] -[[DFSAncestorIndex]] -[[Status]] -[[AsyncEvaluation]] -[[AsyncParentModules]] -[[PendingAsyncDependencies]] +Fields / Module +_B_ +_C_ +_D_ - +_B_ +[[DFSIndex]] 1 +3 +2 ++ [[DFSAncestorIndex]] +0 0 -~evaluating-async~ -*true* -Β« _A_ Β» 0 - +_C_ -3 -0 +[[Status]] +~evaluating-async~ ~evaluating-async~ +~evaluated~ ++ +[[AsyncEvaluation]] *true* +*true* +*true* ++ [[AsyncParentModules]] Β« _A_ Β» -0 +Β« _A_ Β» +Β« _B_, _C_ Β» - _D_ -2 +[[PendingAsyncDependencies]] +0 0 -~evaluated~ -*true* -Β« _B_, _C_ Β» 0 Example Cyclic Module Record Graphs
@@ -27123,31 +27283,39 @@
- Module -[[DFSIndex]] -[[DFSAncestorIndex]] -[[Status]] -[[AsyncEvaluation]] -[[AsyncParentModules]] -[[PendingAsyncDependencies]] +Fields / Modules +_A_ +_C_ - _A_ +[[DFSIndex]] 0 -0 -~evaluating-async~ -*true* -Β« Β» -1 (_B_) +3 - +_C_ -3 +[[DFSAncestorIndex]] 0 +0 ++ +[[Status]] +~evaluating-async~ ~evaluated~ ++ +[[AsyncEvaluation]] *true* +*true* ++ +[[AsyncParentModules]] +Β« Β» Β« _A_ Β» ++ [[PendingAsyncDependencies]] +1 (_B_) 0 Example Cyclic Module Record Graphs
@@ -27159,22 +27327,32 @@
- Module -[[DFSIndex]] -[[DFSAncestorIndex]] -[[Status]] -[[AsyncEvaluation]] -[[AsyncParentModules]] -[[PendingAsyncDependencies]] +Fields / Modules +_A_ +_B_ - +_A_ +[[DFSIndex]] 0 +1 ++ [[DFSAncestorIndex]] 0 -~evaluating-async~ -*true* -Β« Β» 0 - +_B_ -1 -0 +[[Status]] +~evaluating-async~ ~evaluated~ ++ +[[AsyncEvaluation]] *true* +*true* ++ +[[AsyncParentModules]] +Β« Β» Β« _A_ Β» ++ [[PendingAsyncDependencies]] +0 0 Example Cyclic Module Record Graphs
@@ -27186,34 +27364,44 @@
- Module -[[DFSIndex]] -[[DFSAncestorIndex]] -[[Status]] -[[AsyncEvaluation]] -[[AsyncParentModules]] -[[PendingAsyncDependencies]] +Fields / Modules +_A_ - +_A_ +[[DFSIndex]] 0 ++ +[[DFSAncestorIndex]] 0 ++ +[[Status]] ~evaluated~ ++ +[[AsyncEvaluation]] *true* ++ +[[AsyncParentModules]] Β« Β» ++ [[PendingAsyncDependencies]] 0 Example Cyclic Module Record Graphs
@@ -27225,24 +27413,37 @@
- Module -[[DFSIndex]] -[[DFSAncestorIndex]] -[[Status]] -[[AsyncEvaluation]] -[[AsyncParentModules]] -[[PendingAsyncDependencies]] -[[EvaluationError]] +Fields / Modules +_A_ +_C_ - _A_ +[[DFSIndex]] 0 -0 -~evaluated~ -*true* -Β« Β» -1 (_B_) -~empty~ +3 - +_C_ -3 +[[DFSAncestorIndex]] +0 0 ++ +[[Status]] ~evaluated~ +~evaluated~ ++ +[[AsyncEvaluation]] +*true* *true* ++ +[[AsyncParentModules]] +Β« Β» Β« _A_ Β» ++ +[[PendingAsyncDependencies]] +1 (_B_) 0 ++ [[EvaluationError]] +~empty~ _C_'s evaluation error Example Cyclic Module Record Graphs
@@ -27254,34 +27455,44 @@
- Module -[[DFSIndex]] -[[DFSAncestorIndex]] -[[Status]] -[[AsyncEvaluation]] -[[AsyncParentModules]] -[[PendingAsyncDependencies]] -[[EvaluationError]] +Fields / Modules +_A_ - +_A_ +[[DFSIndex]] 0 ++ +[[DFSAncestorIndex]] 0 ++ +[[Status]] ~evaluated~ ++ +[[AsyncEvaluation]] *true* ++ +[[AsyncParentModules]] Β« Β» ++ +[[PendingAsyncDependencies]] 0 ++ [[EvaluationError]] +_C_'s Evaluation Error Example Cyclic Module Record Graphs
@@ -27299,17 +27510,19 @@
- Module -[[DFSIndex]] -[[DFSAncestorIndex]] -[[Status]] -[[AsyncEvaluation]] -[[AsyncParentModules]] -[[PendingAsyncDependencies]] -[[EvaluationError]] +Fields / Modules +_A_ +_B_ - +_A_ +[[DFSIndex]] +0 +1 ++ +[[DFSAncestorIndex]] 0 0 ++ +[[Status]] ~evaluated~ +~evaluated~ ++ +[[AsyncEvaluation]] +*true* *true* ++ [[AsyncParentModules]] Β« Β» -0 -_C_'s Evaluation Error +Β« _A_ Β» - +_B_ -1 +[[PendingAsyncDependencies]] 0 -~evaluated~ -*true* -Β« _A_ Β» 0 ++ [[EvaluationError]] +_C_'s Evaluation Error ~empty~ Source Text Module Records
In addition to the fields defined in
, Source Text Module Records have the additional fields listed in . Each of these fields is initially set in ParseModule. -
- + +- Field Name - -- Value Type - -- Meaning - -+ ++ Field Name + ++ Value Type + ++ Meaning + +[[ECMAScriptCode]] @@ -27392,17 +27605,19 @@ Source Text Module Records
An ImportEntry Record is a Record that digests information about a single declarative import. Each ImportEntry Record has the fields defined in
: -
- + +- Field Name - -- Value Type - -- Meaning - -+ ++ Field Name + ++ Value Type + ++ Meaning + +[[ModuleRequest]] @@ -27442,20 +27657,22 @@ Source Text Module Records
gives examples of ImportEntry records fields used to represent the syntactic import forms: -
- + +- Import Statement Form - -- [[ModuleRequest]] - -- [[ImportName]] - -- [[LocalName]] - -+ ++ Import Statement Form + ++ [[ModuleRequest]] + ++ [[ImportName]] + ++ [[LocalName]] + +`import v from "mod";` @@ -27526,17 +27743,19 @@ Source Text Module Records
An ExportEntry Record is a Record that digests information about a single declarative export. Each ExportEntry Record has the fields defined in
: -
- + +- Field Name - -- Value Type - -- Meaning - -+ ++ Field Name + ++ Value Type + ++ Meaning + +[[ExportName]] @@ -27587,23 +27806,25 @@ Source Text Module Records
gives examples of the ExportEntry record fields used to represent the syntactic export forms: -
- + +- Export Statement Form - -- [[ExportName]] - -- [[ModuleRequest]] - -- [[ImportName]] - -- [[LocalName]] - -+ ++ Export Statement Form + ++ [[ExportName]] + ++ [[ModuleRequest]] + ++ [[ImportName]] + ++ [[LocalName]] + +`export var v;` @@ -28788,7 +29009,7 @@ ECMAScript Standard Built-in Objects
Each built-in function defined in this specification is created by calling the CreateBuiltinFunction abstract operation (
). The values of the _length_ and _name_ parameters are the initial values of the *"length"* and *"name"* properties as discussed below. The values of the _prefix_ parameter are similarly discussed below. Every built-in function object, including constructors, has a *"length"* property whose value is a non-negative integral Number. Unless otherwise specified, this value is the number of required parameters shown in the subclause heading for the function description. Optional parameters and rest parameters are not included in the parameter count.
- For example, the function object that is the initial value of the *"map"* property of the Array prototype object is described under the subclause heading Β«Array.prototype.map (callbackFn [ , thisArg])Β» which shows the two named arguments callbackFn and thisArg, the latter being optional; therefore the value of the *"length"* property of that function object is *1*π½.
+For example, the function object that is the initial value of the *"map"* property of the Array prototype object is described under the subclause heading Β«Array.prototype.map (callback [ , thisArg])Β» which shows the two named arguments callback and thisArg, the latter being optional; therefore the value of the *"length"* property of that function object is *1*π½.
Unless otherwise specified, the *"length"* property of a built-in function object has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.
Every built-in function object, including constructors, has a *"name"* property whose value is a String. Unless otherwise specified, this value is the name that is given to the function in this specification. Functions that are identified as anonymous functions use the empty String as the value of the *"name"* property. For functions that are specified as properties of objects, the name value is the property name string used to access the function. Functions that are specified as get or set accessor functions of built-in properties have *"get"* or *"set"* (respectively) passed to the _prefix_ parameter when calling CreateBuiltinFunction.
@@ -29761,15 +29982,15 @@Object.getPrototypeOf ( _O_ )
- @@ -30129,7 +30350,7 @@Object.groupBy ( _items_, _callbackfn_ )
+Object.groupBy ( _items_, _callback_ )
- _callbackfn_ should be a function that accepts two arguments. `groupBy` calls _callbackfn_ once for each element in _items_, in ascending order, and constructs a new object. Each value returned by _callbackfn_ is coerced to a property key. For each such property key, the result object has a property whose key is that property key and whose value is an array containing all the elements for which the _callbackfn_ return value coerced to that key.
-_callbackfn_ is called with two arguments: the value of the element and the index of the element.
+_callback_ should be a function that accepts two arguments. `groupBy` calls _callback_ once for each element in _items_, in ascending order, and constructs a new object. Each value returned by _callback_ is coerced to a property key. For each such property key, the result object has a property whose key is that property key and whose value is an array containing all the elements for which the _callback_ return value coerced to that key.
+_callback_ is called with two arguments: the value of the element and the index of the element.
The return value of `groupBy` is an object that does not inherit from %Object.prototype%.
This function performs the following steps when called:
- 1. Let _groups_ be ? GroupBy(_items_, _callbackfn_, ~property~). + 1. Let _groups_ be ? GroupBy(_items_, _callback_, ~property~). 1. Let _obj_ be OrdinaryObjectCreate(*null*). 1. For each Record { [[Key]], [[Elements]] } _g_ of _groups_, do 1. Let _elements_ be CreateArrayFromList(_g_.[[Elements]]). @@ -29981,12 +30202,12 @@ Object.prototype.toString ( )
1. Else if _O_ has a [[DateValue]] internal slot, let _builtinTag_ be *"Date"*. 1. Else if _O_ has a [[RegExpMatcher]] internal slot, let _builtinTag_ be *"RegExp"*. 1. Else, let _builtinTag_ be *"Object"*. - 1. Let _tag_ be ? Get(_O_, @@toStringTag). + 1. Let _tag_ be ? Get(_O_, %Symbol.toStringTag%). 1. If _tag_ is not a String, set _tag_ to _builtinTag_. 1. Return the string-concatenation of *"[object "*, _tag_, and *"]"*.- Historically, this method was occasionally used to access the String value of the [[Class]] internal slot that was used in previous editions of this specification as a nominal type tag for various built-in objects. The above definition of `toString` preserves compatibility for legacy code that uses `toString` as a test for those specific kinds of built-in objects. It does not provide a reliable type testing mechanism for other kinds of built-in or program defined objects. In addition, programs can use @@toStringTag in ways that will invalidate the reliability of such legacy type tests.
+Historically, this method was occasionally used to access the String value of the [[Class]] internal slot that was used in previous editions of this specification as a nominal type tag for various built-in objects. The above definition of `toString` preserves compatibility for legacy code that uses `toString` as a test for those specific kinds of built-in objects. It does not provide a reliable type testing mechanism for other kinds of built-in or program defined objects. In addition, programs can use %Symbol.toStringTag% in ways that will invalidate the reliability of such legacy type tests.
Function ( ..._parameterArgs_, _bodyArg_ )
CreateDynamicFunction ( _constructor_: a constructor, - _newTarget_: a constructor, + _newTarget_: a constructor or *undefined*, _kind_: ~normal~, ~generator~, ~async~, or ~async-generator~, _parameterArgs_: a List of ECMAScript language values, _bodyArg_: an ECMAScript language value, @@ -30205,7 +30426,7 @@
1. Perform ! DefinePropertyOrThrow(_F_, *"prototype"*, PropertyDescriptor { [[Value]]: _prototype_, [[Writable]]: *true*, [[Enumerable]]: *false*, [[Configurable]]: *false* }). 1. Else if _kind_ is ~normal~, then 1. Perform MakeConstructor(_F_). - 1. NOTE: Functions whose _kind_ is ~async~ are not constructible and do not have a [[Construct]] internal method or a *"prototype"* property. + 1. NOTE: Functions whose _kind_ is ~async~ are not constructable and do not have a [[Construct]] internal method or a *"prototype"* property. 1. Return _F_.
@@ -30349,8 +30570,8 @@ Function.prototype.toString ( )
--