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 (#1776)
  • Loading branch information
ljharb committed Feb 13, 2020
1 parent 823aad1 commit 45ea73a
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 @@ -38755,7 +38755,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 @@ -38775,7 +38778,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_, &laquo; &raquo;).
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 @@ -38797,7 +38803,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_, &laquo; &raquo;).
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 45ea73a

Please sign in to comment.