diff --git a/spec.html b/spec.html index 6ac0cd65f2..388fdc5ea6 100644 --- a/spec.html +++ b/spec.html @@ -12637,51 +12637,57 @@

Syntax

`...` AssignmentExpression[+In, ?Yield, ?Await] - -

Static Semantics: ElisionWidth

+ +

Runtime Semantics: ArrayAccumulation

+

With parameters _array_ and _nextIndex_.

Elision : `,` - 1. Return the numeric value 1. + 1. Let _len_ be _nextIndex_ + 1. + 1. Perform ? Set(_array_, `"length"`, _len_, *true*). + 1. NOTE: The above Set throws if _len_ exceeds 232-1. + 1. Return _len_. Elision : Elision `,` - 1. Let _preceding_ be the ElisionWidth of |Elision|. - 1. Return _preceding_ + 1. + 1. Return the result of performing ArrayAccumulation for |Elision| with arguments _array_ and _nextIndex_ + 1. -
- - -

Runtime Semantics: ArrayAccumulation

-

With parameters _array_ and _nextIndex_.

ElementList : Elision? AssignmentExpression - 1. Let _padding_ be the ElisionWidth of |Elision|; if |Elision| is not present, use the numeric value zero. + 1. If |Elision| is present, then + 1. Let _nextIndex_ be the result of performing ArrayAccumulation for |Elision| with arguments _array_ and _nextIndex_. + 1. ReturnIfAbrupt(_nextIndex_). 1. Let _initResult_ be the result of evaluating |AssignmentExpression|. 1. Let _initValue_ be ? GetValue(_initResult_). - 1. Let _created_ be CreateDataProperty(_array_, ToString(ToUint32(_nextIndex_ + _padding_)), _initValue_). - 1. Assert: _created_ is *true*. - 1. Return _nextIndex_ + _padding_ + 1. + 1. Let _created_ be ! CreateDataPropertyOrThrow(_array_, ! ToString(_nextIndex_), _initValue_). + 1. Return _nextIndex_ + 1. ElementList : Elision? SpreadElement - 1. Let _padding_ be the ElisionWidth of |Elision|; if |Elision| is not present, use the numeric value zero. - 1. Return the result of performing ArrayAccumulation for |SpreadElement| with arguments _array_ and _nextIndex_ + _padding_. + 1. If |Elision| is present, then + 1. Let _nextIndex_ be the result of performing ArrayAccumulation for |Elision| with arguments _array_ and _nextIndex_. + 1. ReturnIfAbrupt(_nextIndex_). + 1. Return the result of performing ArrayAccumulation for |SpreadElement| with arguments _array_ and _nextIndex_. ElementList : ElementList `,` Elision? AssignmentExpression - 1. Let _postIndex_ be ? ArrayAccumulation of |ElementList| with arguments _array_ and _nextIndex_. - 1. Let _padding_ be the ElisionWidth of |Elision|; if |Elision| is not present, use the numeric value zero. + 1. Let _nextIndex_ be the result of performing ArrayAccumulation for |ElementList| with arguments _array_ and _nextIndex_. + 1. ReturnIfAbrupt(_nextIndex_). + 1. If |Elision| is present, then + 1. Let _nextIndex_ be the result of performing ArrayAccumulation for |Elision| with arguments _array_ and _nextIndex_. + 1. ReturnIfAbrupt(_nextIndex_). 1. Let _initResult_ be the result of evaluating |AssignmentExpression|. 1. Let _initValue_ be ? GetValue(_initResult_). - 1. Let _created_ be CreateDataProperty(_array_, ToString(ToUint32(_postIndex_ + _padding_)), _initValue_). - 1. Assert: _created_ is *true*. - 1. Return _postIndex_ + _padding_ + 1. + 1. Let _created_ be ! CreateDataPropertyOrThrow(_array_, ! ToString(_nextIndex_), _initValue_). + 1. Return _nextIndex_+1. ElementList : ElementList `,` Elision? SpreadElement - 1. Let _postIndex_ be ? ArrayAccumulation of |ElementList| with arguments _array_ and _nextIndex_. - 1. Let _padding_ be the ElisionWidth of |Elision|; if |Elision| is not present, use the numeric value zero. - 1. Return the result of performing ArrayAccumulation for |SpreadElement| with arguments _array_ and _postIndex_ + _padding_. + 1. Let _nextIndex_ be the result of performing ArrayAccumulation for |ElementList| with arguments _array_ and _nextIndex_. + 1. ReturnIfAbrupt(_nextIndex_). + 1. If |Elision| is present, then + 1. Let _nextIndex_ be the result of performing ArrayAccumulation for |Elision| with arguments _array_ and _nextIndex_. + 1. ReturnIfAbrupt(_nextIndex_). + 1. Return the result of performing ArrayAccumulation for |SpreadElement| with arguments _array_ and _nextIndex_. SpreadElement : `...` AssignmentExpression @@ -12692,8 +12698,7 @@

Runtime Semantics: ArrayAccumulation

1. Let _next_ be ? IteratorStep(_iteratorRecord_). 1. If _next_ is *false*, return _nextIndex_. 1. Let _nextValue_ be ? IteratorValue(_next_). - 1. Let _status_ be CreateDataProperty(_array_, ToString(ToUint32(_nextIndex_)), _nextValue_). - 1. Assert: _status_ is *true*. + 1. Let _status_ be ! CreateDataPropertyOrThrow(_array_, ! ToString(_nextIndex_), _nextValue_). 1. Set _nextIndex_ to _nextIndex_ + 1.
@@ -12706,26 +12711,26 @@

Runtime Semantics: Evaluation

ArrayLiteral : `[` Elision? `]` 1. Let _array_ be ! ArrayCreate(0). - 1. Let _pad_ be the ElisionWidth of |Elision|; if |Elision| is not present, use the numeric value zero. - 1. Perform Set(_array_, `"length"`, ToUint32(_pad_), *false*). - 1. NOTE: The above Set cannot fail because of the nature of the object returned by ArrayCreate. + 1. If |Elision| is present, then + 1. Let _len_ be the result of performing ArrayAccumulation for |Elision| with arguments _array_ and 0. + 1. ReturnIfAbrupt(_len_). 1. Return _array_. ArrayLiteral : `[` ElementList `]` 1. Let _array_ be ! ArrayCreate(0). - 1. Let _len_ be ? ArrayAccumulation of |ElementList| with arguments _array_ and 0. - 1. Perform Set(_array_, `"length"`, ToUint32(_len_), *false*). - 1. NOTE: The above Set cannot fail because of the nature of the object returned by ArrayCreate. + 1. Let _len_ be the result of performing ArrayAccumulation for |ElementList| with arguments _array_ and 0. + 1. ReturnIfAbrupt(_len_). 1. Return _array_. ArrayLiteral : `[` ElementList `,` Elision? `]` 1. Let _array_ be ! ArrayCreate(0). - 1. Let _len_ be ? ArrayAccumulation of |ElementList| with arguments _array_ and 0. - 1. Let _padding_ be the ElisionWidth of |Elision|; if |Elision| is not present, use the numeric value zero. - 1. Perform Set(_array_, `"length"`, ToUint32(_padding_ + _len_), *false*). - 1. NOTE: The above Set cannot fail because of the nature of the object returned by ArrayCreate. + 1. Let _nextIndex_ be the result of performing ArrayAccumulation for |ElementList| with arguments _array_ and 0. + 1. ReturnIfAbrupt(_nextIndex_). + 1. If |Elision| is present, then + 1. Let _len_ be the result of performing ArrayAccumulation for |Elision| with arguments _array_ and _nextIndex_. + 1. ReturnIfAbrupt(_len_). 1. Return _array_.