Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 37 additions & 33 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -48438,16 +48438,18 @@ <h1>Iterator.prototype.drop ( _limit_ )</h1>
1. If _numLimit_ is *NaN*, then
1. Let _error_ be ThrowCompletion(a newly created *RangeError* object).
1. Return ? IteratorClose(_iterated_, _error_).
1. If _numLimit_ is finite and _numLimit_ > 𝔽(2**53 - 1), then

Check warning on line 48441 in spec.html

View workflow job for this annotation

GitHub Actions / esmeta yet phrases detection

Newly Introduced Unknown Step

This step in INTRINSICS.Iterator.prototype.drop cannot be understood by ESMeta. Type check for this algorithm will not be performed after this line.
1. Let _error_ be ThrowCompletion(a newly created *RangeError* object).
1. Return ? IteratorClose(_iterated_, _error_).
1. Let _integerLimit_ be ! ToIntegerOrInfinity(_numLimit_).
1. If _integerLimit_ &lt; 0, then
1. Let _error_ be ThrowCompletion(a newly created *RangeError* object).
1. Return ? IteratorClose(_iterated_, _error_).
1. Set _iterated_ to ? GetIteratorDirect(_O_).
1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and _integerLimit_ and performs the following steps when called:
1. Let _remaining_ be _integerLimit_.
1. Repeat, while _remaining_ > 0,
1. If _remaining_ ≠ +∞, then
1. Set _remaining_ to _remaining_ - 1.
1. Let _remaining_ be 𝔽(_integerLimit_).
1. Repeat, while _remaining_ > *+0*<sub>𝔽</sub>,
1. Set _remaining_ to _remaining_ - *1*<sub>𝔽</sub>.
1. Let _next_ be ? IteratorStep(_iterated_).
1. If _next_ is ~done~, return ReturnCompletion(*undefined*).
1. Repeat,
Expand All @@ -48472,14 +48474,14 @@ <h1>Iterator.prototype.every ( _predicate_ )</h1>
1. Let _error_ be ThrowCompletion(a newly created *TypeError* object).
1. Return ? IteratorClose(_iterated_, _error_).
1. Set _iterated_ to ? GetIteratorDirect(_O_).
1. Let _counter_ be 0.
1. Let _counter_ be *+0*<sub>𝔽</sub>.
1. Repeat,
1. Let _value_ be ? IteratorStepValue(_iterated_).
1. If _value_ is ~done~, return *true*.
1. Let _result_ be Completion(Call(_predicate_, *undefined*, « _value_, 𝔽(_counter_) »)).
1. Let _result_ be Completion(Call(_predicate_, *undefined*, « _value_, _counter_ »)).
1. IfAbruptCloseIterator(_result_, _iterated_).
1. If ToBoolean(_result_) is *false*, return ? IteratorClose(_iterated_, NormalCompletion(*false*)).
1. Set _counter_ to _counter_ + 1.
1. Set _counter_ to _counter_ + *1*<sub>𝔽</sub>.
</emu-alg>
</emu-clause>

Expand All @@ -48495,16 +48497,16 @@ <h1>Iterator.prototype.filter ( _predicate_ )</h1>
1. Return ? IteratorClose(_iterated_, _error_).
1. Set _iterated_ to ? GetIteratorDirect(_O_).
1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and _predicate_ and performs the following steps when called:
1. Let _counter_ be 0.
1. Let _counter_ be *+0*<sub>𝔽</sub>.
1. Repeat,
1. Let _value_ be ? IteratorStepValue(_iterated_).
1. If _value_ is ~done~, return ReturnCompletion(*undefined*).
1. Let _selected_ be Completion(Call(_predicate_, *undefined*, « _value_, 𝔽(_counter_) »)).
1. Let _selected_ be Completion(Call(_predicate_, *undefined*, « _value_, _counter_ »)).
1. IfAbruptCloseIterator(_selected_, _iterated_).
1. If ToBoolean(_selected_) is *true*, then
1. Let _completion_ be Completion(Yield(_value_)).
1. IfAbruptCloseIterator(_completion_, _iterated_).
1. Set _counter_ to _counter_ + 1.
1. Set _counter_ to _counter_ + *1*<sub>𝔽</sub>.
1. Let _result_ be CreateIteratorFromClosure(_closure_, *"Iterator Helper"*, %IteratorHelperPrototype%, « [[UnderlyingIterators]] »).
1. Set _result_.[[UnderlyingIterators]] to « _iterated_ ».
1. Return _result_.
Expand All @@ -48522,14 +48524,14 @@ <h1>Iterator.prototype.find ( _predicate_ )</h1>
1. Let _error_ be ThrowCompletion(a newly created *TypeError* object).
1. Return ? IteratorClose(_iterated_, _error_).
1. Set _iterated_ to ? GetIteratorDirect(_O_).
1. Let _counter_ be 0.
1. Let _counter_ be *+0*<sub>𝔽</sub>.
1. Repeat,
1. Let _value_ be ? IteratorStepValue(_iterated_).
1. If _value_ is ~done~, return *undefined*.
1. Let _result_ be Completion(Call(_predicate_, *undefined*, « _value_, 𝔽(_counter_) »)).
1. Let _result_ be Completion(Call(_predicate_, *undefined*, « _value_, _counter_ »)).
1. IfAbruptCloseIterator(_result_, _iterated_).
1. If ToBoolean(_result_) is *true*, return ? IteratorClose(_iterated_, NormalCompletion(_value_)).
1. Set _counter_ to _counter_ + 1.
1. Set _counter_ to _counter_ + *1*<sub>𝔽</sub>.
</emu-alg>
</emu-clause>

Expand All @@ -48545,11 +48547,11 @@ <h1>Iterator.prototype.flatMap ( _mapper_ )</h1>
1. Return ? IteratorClose(_iterated_, _error_).
1. Set _iterated_ to ? GetIteratorDirect(_O_).
1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and _mapper_ and performs the following steps when called:
1. Let _counter_ be 0.
1. Let _counter_ be *+0*<sub>𝔽</sub>.
1. Repeat,
1. Let _value_ be ? IteratorStepValue(_iterated_).
1. If _value_ is ~done~, return ReturnCompletion(*undefined*).
1. Let _mapped_ be Completion(Call(_mapper_, *undefined*, « _value_, 𝔽(_counter_) »)).
1. Let _mapped_ be Completion(Call(_mapper_, *undefined*, « _value_, _counter_ »)).
1. IfAbruptCloseIterator(_mapped_, _iterated_).
1. Let _innerIterator_ be Completion(GetIteratorFlattenable(_mapped_, ~reject-primitives~)).
1. IfAbruptCloseIterator(_innerIterator_, _iterated_).
Expand All @@ -48565,7 +48567,7 @@ <h1>Iterator.prototype.flatMap ( _mapper_ )</h1>
1. Let _backupCompletion_ be Completion(IteratorClose(_innerIterator_, _completion_)).
1. IfAbruptCloseIterator(_backupCompletion_, _iterated_).
1. Return ? IteratorClose(_iterated_, _completion_).
1. Set _counter_ to _counter_ + 1.
1. Set _counter_ to _counter_ + *1*<sub>𝔽</sub>.
1. Let _result_ be CreateIteratorFromClosure(_closure_, *"Iterator Helper"*, %IteratorHelperPrototype%, « [[UnderlyingIterators]] »).
1. Set _result_.[[UnderlyingIterators]] to « _iterated_ ».
1. Return _result_.
Expand All @@ -48583,13 +48585,13 @@ <h1>Iterator.prototype.forEach ( _procedure_ )</h1>
1. Let _error_ be ThrowCompletion(a newly created *TypeError* object).
1. Return ? IteratorClose(_iterated_, _error_).
1. Set _iterated_ to ? GetIteratorDirect(_O_).
1. Let _counter_ be 0.
1. Let _counter_ be *+0*<sub>𝔽</sub>.
1. Repeat,
1. Let _value_ be ? IteratorStepValue(_iterated_).
1. If _value_ is ~done~, return *undefined*.
1. Let _result_ be Completion(Call(_procedure_, *undefined*, « _value_, 𝔽(_counter_) »)).
1. Let _result_ be Completion(Call(_procedure_, *undefined*, « _value_, _counter_ »)).
1. IfAbruptCloseIterator(_result_, _iterated_).
1. Set _counter_ to _counter_ + 1.
1. Set _counter_ to _counter_ + *1*<sub>𝔽</sub>.
</emu-alg>
</emu-clause>

Expand All @@ -48605,15 +48607,15 @@ <h1>Iterator.prototype.map ( _mapper_ )</h1>
1. Return ? IteratorClose(_iterated_, _error_).
1. Set _iterated_ to ? GetIteratorDirect(_O_).
1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and _mapper_ and performs the following steps when called:
1. Let _counter_ be 0.
1. Let _counter_ be *+0*<sub>𝔽</sub>.
1. Repeat,
1. Let _value_ be ? IteratorStepValue(_iterated_).
1. If _value_ is ~done~, return ReturnCompletion(*undefined*).
1. Let _mapped_ be Completion(Call(_mapper_, *undefined*, « _value_, 𝔽(_counter_) »)).
1. Let _mapped_ be Completion(Call(_mapper_, *undefined*, « _value_, _counter_ »)).
1. IfAbruptCloseIterator(_mapped_, _iterated_).
1. Let _completion_ be Completion(Yield(_mapped_)).
1. IfAbruptCloseIterator(_completion_, _iterated_).
1. Set _counter_ to _counter_ + 1.
1. Set _counter_ to _counter_ + *1*<sub>𝔽</sub>.
1. Let _result_ be CreateIteratorFromClosure(_closure_, *"Iterator Helper"*, %IteratorHelperPrototype%, « [[UnderlyingIterators]] »).
1. Set _result_.[[UnderlyingIterators]] to « _iterated_ ».
1. Return _result_.
Expand All @@ -48634,17 +48636,17 @@ <h1>Iterator.prototype.reduce ( _reducer_ [ , _initialValue_ ] )</h1>
1. If _initialValue_ is not present, then
1. Let _accumulator_ be ? IteratorStepValue(_iterated_).
1. If _accumulator_ is ~done~, throw a *TypeError* exception.
1. Let _counter_ be 1.
1. Let _counter_ be *1*<sub>𝔽</sub>.
1. Else,
1. Let _accumulator_ be _initialValue_.
1. Let _counter_ be 0.
1. Let _counter_ be *+0*<sub>𝔽</sub>.
1. Repeat,
1. Let _value_ be ? IteratorStepValue(_iterated_).
1. If _value_ is ~done~, return _accumulator_.
1. Let _result_ be Completion(Call(_reducer_, *undefined*, « _accumulator_, _value_, 𝔽(_counter_) »)).
1. Let _result_ be Completion(Call(_reducer_, *undefined*, « _accumulator_, _value_, _counter_ »)).
1. IfAbruptCloseIterator(_result_, _iterated_).
1. Set _accumulator_ to _result_.
1. Set _counter_ to _counter_ + 1.
1. Set _counter_ to _counter_ + *1*<sub>𝔽</sub>.
</emu-alg>
</emu-clause>

Expand All @@ -48659,14 +48661,14 @@ <h1>Iterator.prototype.some ( _predicate_ )</h1>
1. Let _error_ be ThrowCompletion(a newly created *TypeError* object).
1. Return ? IteratorClose(_iterated_, _error_).
1. Set _iterated_ to ? GetIteratorDirect(_O_).
1. Let _counter_ be 0.
1. Let _counter_ be *+0*<sub>𝔽</sub>.
1. Repeat,
1. Let _value_ be ? IteratorStepValue(_iterated_).
1. If _value_ is ~done~, return *false*.
1. Let _result_ be Completion(Call(_predicate_, *undefined*, « _value_, 𝔽(_counter_) »)).
1. Let _result_ be Completion(Call(_predicate_, *undefined*, « _value_, _counter_ »)).
1. IfAbruptCloseIterator(_result_, _iterated_).
1. If ToBoolean(_result_) is *true*, return ? IteratorClose(_iterated_, NormalCompletion(*true*)).
1. Set _counter_ to _counter_ + 1.
1. Set _counter_ to _counter_ + *1*<sub>𝔽</sub>.
</emu-alg>
</emu-clause>

Expand All @@ -48682,18 +48684,20 @@ <h1>Iterator.prototype.take ( _limit_ )</h1>
1. If _numLimit_ is *NaN*, then
1. Let _error_ be ThrowCompletion(a newly created *RangeError* object).
1. Return ? IteratorClose(_iterated_, _error_).
1. If _numLimit_ is finite and _numLimit_ > 𝔽(2**53 - 1), then

Check warning on line 48687 in spec.html

View workflow job for this annotation

GitHub Actions / esmeta yet phrases detection

Newly Introduced Unknown Step

This step in INTRINSICS.Iterator.prototype.take cannot be understood by ESMeta. Type check for this algorithm will not be performed after this line.
1. Let _error_ be ThrowCompletion(a newly created *RangeError* object).
1. Return ? IteratorClose(_iterated_, _error_).
1. Let _integerLimit_ be ! ToIntegerOrInfinity(_numLimit_).
1. If _integerLimit_ &lt; 0, then
1. Let _error_ be ThrowCompletion(a newly created *RangeError* object).
1. Return ? IteratorClose(_iterated_, _error_).
1. Set _iterated_ to ? GetIteratorDirect(_O_).
1. Let _closure_ be a new Abstract Closure with no parameters that captures _iterated_ and _integerLimit_ and performs the following steps when called:
1. Let _remaining_ be _integerLimit_.
1. Let _remaining_ be 𝔽(_integerLimit_).
1. Repeat,
1. If _remaining_ = 0, then
1. If _remaining_ is *+0*<sub>𝔽</sub>, then
1. Return ? IteratorClose(_iterated_, ReturnCompletion(*undefined*)).
1. If _remaining_ ≠ +∞, then
1. Set _remaining_ to _remaining_ - 1.
1. Set _remaining_ to _remaining_ - *1*<sub>𝔽</sub>.
1. Let _value_ be ? IteratorStepValue(_iterated_).
1. If _value_ is ~done~, return ReturnCompletion(*undefined*).
1. Let _completion_ be Completion(Yield(_value_)).
Expand Down
Loading