Skip to content

Commit

Permalink
fix IteratorNext/Close
Browse files Browse the repository at this point in the history
  • Loading branch information
kmiller68 committed Aug 17, 2017
1 parent 1ededaa commit 18d7f46
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions spec.html
Expand Up @@ -4689,13 +4689,13 @@ <h1>GetIterator ( _obj_ [ , _method_ ] )</h1>

<!-- es6num="7.4.2" -->
<emu-clause id="sec-iteratornext" aoid="IteratorNext">
<h1>IteratorNext ( _iterator_ [ , _value_ ] )</h1>
<p>The abstract operation IteratorNext with argument _iterator_ and optional argument _value_ performs the following steps:</p>
<h1>IteratorNext ( _iteratorRecord_ [ , _value_ ] )</h1>
<p>The abstract operation IteratorNext with argument _iteratorRecord_ and optional argument _value_ performs the following steps:</p>
<emu-alg>
1. If _value_ is not present, then
1. Let _result_ be ? Invoke(_iterator_, `"next"`, &laquo; &raquo;).
1. Let _result_ be ? Call(_iteratorRecord_.[[NextMethod]], _iteratorRecord_.[[Iterator]], &laquo; &raquo;).
1. Else,
1. Let _result_ be ? Invoke(_iterator_, `"next"`, &laquo; _value_ &raquo;).
1. Let _result_ be ? Call(_iteratorRecord_.[[NextMethod]], _iteratorRecord_.[[Iterator]], &laquo; _value_ &raquo;).
1. If Type(_result_) is not Object, throw a *TypeError* exception.
1. Return _result_.
</emu-alg>
Expand Down Expand Up @@ -4723,10 +4723,10 @@ <h1>IteratorValue ( _iterResult_ )</h1>

<!-- es6num="7.4.5" -->
<emu-clause id="sec-iteratorstep" aoid="IteratorStep">
<h1>IteratorStep ( _iterator_ )</h1>
<p>The abstract operation IteratorStep with argument _iterator_ requests the next value from _iterator_ and returns either *false* indicating that the iterator has reached its end or the IteratorResult object if a next value is available. IteratorStep performs the following steps:</p>
<h1>IteratorStep ( _iteratorRecord_ )</h1>
<p>The abstract operation IteratorStep with argument _iteratorRecord_ requests the next value from _iteratorRecord_.[[Iterator]] by calling _iteratorRecord_.[[NextFunction]] and returns either *false* indicating that the iterator has reached its end or the IteratorResult object if a next value is available. IteratorStep performs the following steps:</p>
<emu-alg>
1. Let _result_ be ? IteratorNext(_iterator_).
1. Let _result_ be ? IteratorNext(_iteratorRecord_).
1. Let _done_ be ? IteratorComplete(_result_).
1. If _done_ is *true*, return *false*.
1. Return _result_.
Expand All @@ -4735,11 +4735,12 @@ <h1>IteratorStep ( _iterator_ )</h1>

<!-- es6num="7.4.6" -->
<emu-clause id="sec-iteratorclose" aoid="IteratorClose">
<h1>IteratorClose ( _iterator_, _completion_ )</h1>
<p>The abstract operation IteratorClose with arguments _iterator_ and _completion_ is used to notify an iterator that it should perform any actions it would normally perform when it has reached its completed state:</p>
<h1>IteratorClose ( _iteratorRecord_, _completion_ )</h1>
<p>The abstract operation IteratorClose with arguments _iteratorRecord_ and _completion_ is used to notify an iterator that it should perform any actions it would normally perform when it has reached its completed state:</p>
<emu-alg>
1. Assert: Type(_iterator_) is Object.
1. Assert: Type(_iteratorRecord_.[[Iterator]]) is Object.
1. Assert: _completion_ is a Completion Record.
1. Let _iterator_ be _iteratorRecord_.[[Iterator]].
1. Let _return_ be ? GetMethod(_iterator_, `"return"`).
1. If _return_ is *undefined*, return Completion(_completion_).
1. Let _innerResult_ be Call(_return_, _iterator_, &laquo; &raquo;).
Expand Down

0 comments on commit 18d7f46

Please sign in to comment.