|
|
|
The abstract operation IteratorValue takes argument iterResult . It performs the following steps when called: 1. : iterResult ) is Object. 2. Return ? iterResult , "value" ). The abstract operation IteratorStep takes argument iteratorRecord . It requests the next value from iteratorRecord . [[Iterator]] by calling iteratorRecord .[[NextMethod]] and returns either false indicating that the iterator has reached its end or the IteratorResult object if a next value is available. It performs the following steps when called: 1. Let result be ? iteratorRecord ). 2. Let done ( result ). 3. If done is true , return false . 4. Return result . The abstract operation IteratorClose takes arguments iteratorRecord and completion . It is used to notify an iterator that it should perform any actions it would normally perform when it has reached its completed state. It performs the 1. : iteratorRecord .[[Iterator]]) is Object. 2. : completion 3. Let iterator be iteratorRecord .[[Iterator]]. 4. Let innerResult ( iterator , "return" ). 5. If innerResult .[[Type]] is normal , then a. Let return be innerResult .[[Value]]. b. If return is undefined , return ( completion ). c. Set innerResult to return , iterator ). 6. If completion .[[Type]] is throw , return ( completion ). 7. If innerResult .[[Type]] is throw , return ( innerResult ). 8. If ( innerResult .[[Value]]) is not Object, throw a TypeError exception. 9. Return ( completion ). The abstract operation AsyncIteratorClose takes arguments iteratorRecord and completion . It is used to notify an async iterator that it should perform any actions it would normally perform when it has reached its completed state. It 1. : iteratorRecord .[[Iterator]]) is Object. 2. : completion 3. Let iterator be iteratorRecord .[[Iterator]]. 4. Let innerResult ( iterator , "return" ). 5. If innerResult .[[Type]] is normal , then a. Let return be innerResult .[[Value]]. 7.4.4 IteratorValue ( iterResult ) 7.4.5 IteratorStep ( iteratorRecord ) 7.4.6 IteratorClose ( iteratorRecord , completion ) 7.4.7 AsyncIteratorClose ( iteratorRecord , completion ) 138 |