Skip to content

Commit

Permalink
Normative: make async iterators next/return/throw not pass `undefined…
Browse files Browse the repository at this point in the history
…` when value is absent (tc39#1776)
  • Loading branch information
ljharb committed Apr 2, 2020
1 parent 980e1cc commit 7abcd0a
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -38846,7 +38846,10 @@ <h1>%AsyncFromSyncIteratorPrototype%.next ( _value_ )</h1>
1. Assert: Type(_O_) is Object and _O_ has a [[SyncIteratorRecord]] internal slot.
1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%).
1. Let _syncIteratorRecord_ be _O_.[[SyncIteratorRecord]].
1. Let _result_ be IteratorNext(_syncIteratorRecord_, _value_).
1. If _value_ is present, then
1. Let _result_ be IteratorNext(_syncIteratorRecord_, _value_).
1. Else,
1. Let _result_ be IteratorNext(_syncIteratorRecord_).
1. IfAbruptRejectPromise(_result_, _promiseCapability_).
1. Return ! AsyncFromSyncIteratorContinuation(_result_, _promiseCapability_).
</emu-alg>
Expand All @@ -38866,7 +38869,10 @@ <h1>%AsyncFromSyncIteratorPrototype%.return ( _value_ )</h1>
1. Let _iterResult_ be ! CreateIterResultObject(_value_, *true*).
1. Perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, &laquo; _iterResult_ &raquo;).
1. Return _promiseCapability_.[[Promise]].
1. Let _result_ be Call(_return_, _syncIterator_, &laquo; _value_ &raquo;).
1. If _value_ is present, then
1. Let _result_ be Call(_return_, _syncIterator_, &laquo; _value_ &raquo;).
1. Else,
1. Let _result_ be Call(_return_, _syncIterator_).
1. IfAbruptRejectPromise(_result_, _promiseCapability_).
1. If Type(_result_) is not Object, then
1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, &laquo; a newly created *TypeError* object &raquo;).
Expand All @@ -38888,7 +38894,10 @@ <h1>%AsyncFromSyncIteratorPrototype%.throw ( _value_ )</h1>
1. If _throw_ is *undefined*, then
1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, &laquo; _value_ &raquo;).
1. Return _promiseCapability_.[[Promise]].
1. Let _result_ be Call(_throw_, _syncIterator_, &laquo; _value_ &raquo;).
1. If _value_ is present, then
1. Let _result_ be Call(_throw_, _syncIterator_, &laquo; _value_ &raquo;).
1. Else,
1. Let _result_ be Call(_throw_, _syncIterator_).
1. IfAbruptRejectPromise(_result_, _promiseCapability_).
1. If Type(_result_) is not Object, then
1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, &laquo; a newly created *TypeError* object &raquo;).
Expand Down

0 comments on commit 7abcd0a

Please sign in to comment.