diff --git a/spec.html b/spec.html index 19b2508938..d0e2291b42 100644 --- a/spec.html +++ b/spec.html @@ -6820,6 +6820,19 @@

+ +

IfAbruptCloseIterator ( _value_, _iteratorRecord_ )

+

IfAbruptCloseIterator is a shorthand for a sequence of algorithm steps that use an Iterator Record. An algorithm step of the form:

+ + 1. IfAbruptCloseIterator(_value_, _iteratorRecord_). + +

means the same thing as:

+ + 1. If _value_ is an abrupt completion, return ? IteratorClose(_iteratorRecord_, _value_). + 1. Else if _value_ is a Completion Record, set _value_ to _value_.[[Value]]. + +
+

AsyncIteratorClose ( @@ -36009,11 +36022,10 @@

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

1. Let _nextValue_ be ? IteratorValue(_next_). 1. If _mapping_ is *true*, then 1. Let _mappedValue_ be Call(_mapfn_, _thisArg_, « _nextValue_, 𝔽(_k_) »). - 1. If _mappedValue_ is an abrupt completion, return ? IteratorClose(_iteratorRecord_, _mappedValue_). - 1. Set _mappedValue_ to _mappedValue_.[[Value]]. + 1. IfAbruptCloseIterator(_mappedValue_, _iteratorRecord_). 1. Else, let _mappedValue_ be _nextValue_. 1. Let _defineStatus_ be CreateDataPropertyOrThrow(_A_, _Pk_, _mappedValue_). - 1. If _defineStatus_ is an abrupt completion, return ? IteratorClose(_iteratorRecord_, _defineStatus_). + 1. IfAbruptCloseIterator(_defineStatus_, _iteratorRecord_). 1. Set _k_ to _k_ + 1. 1. NOTE: _items_ is not an Iterable so assume it is an array-like object. 1. Let _arrayLike_ be ! ToObject(_items_). @@ -38832,11 +38844,11 @@

1. Let _error_ be ThrowCompletion(a newly created *TypeError* object). 1. Return ? IteratorClose(_iteratorRecord_, _error_). 1. Let _k_ be Get(_nextItem_, *"0"*). - 1. If _k_ is an abrupt completion, return ? IteratorClose(_iteratorRecord_, _k_). + 1. IfAbruptCloseIterator(_k_, _iteratorRecord_). 1. Let _v_ be Get(_nextItem_, *"1"*). - 1. If _v_ is an abrupt completion, return ? IteratorClose(_iteratorRecord_, _v_). - 1. Let _status_ be Call(_adder_, _target_, « _k_.[[Value]], _v_.[[Value]] »). - 1. If _status_ is an abrupt completion, return ? IteratorClose(_iteratorRecord_, _status_). + 1. IfAbruptCloseIterator(_v_, _iteratorRecord_). + 1. Let _status_ be Call(_adder_, _target_, « _k_, _v_ »). + 1. IfAbruptCloseIterator(_status_, _iteratorRecord_).

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

@@ -39141,7 +39153,7 @@

Set ( [ _iterable_ ] )

1. If _next_ is *false*, return _set_. 1. Let _nextValue_ be ? IteratorValue(_next_). 1. Let _status_ be Call(_adder_, _set_, « _nextValue_ »). - 1. If _status_ is an abrupt completion, return ? IteratorClose(_iteratorRecord_, _status_). + 1. IfAbruptCloseIterator(_status_, _iteratorRecord_). @@ -39581,7 +39593,7 @@

WeakSet ( [ _iterable_ ] )

1. If _next_ is *false*, return _set_. 1. Let _nextValue_ be ? IteratorValue(_next_). 1. Let _status_ be Call(_adder_, _set_, « _nextValue_ »). - 1. If _status_ is an abrupt completion, return ? IteratorClose(_iteratorRecord_, _status_). + 1. IfAbruptCloseIterator(_status_, _iteratorRecord_).