-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert #20 and do not await async inputs’ values without mapping ƒ #27
Conversation
spec.html
Outdated
@@ -74,10 +74,10 @@ <h1><ins>Array.fromAsync ( _asyncItems_ [ , _mapfn_ [ , _thisArg_ ] ] )</ins></h | |||
1. If _mapping_ is *true*, then | |||
1. Let _mappedValue_ be Call(_mapfn_, _thisArg_, « _nextValue_, 𝔽(_k_) »). | |||
1. IfAbruptCloseAsyncIterator(_iteratorRecord_, _mappedValue_). | |||
1. Set _mappedValue_ to Await(_mappedValue_). | |||
1. IfAbruptCloseAsyncIterator(_iteratorRecord_, _mappedValue_). | |||
1. Set _mappedValue_ to _mappedValue_.[[Value]]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IfAbruptCloseAsyncIterator
already does this. (It's a macro.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be clear, is the suggestion to remove all three of the highlighted lines? I’m rechecking the definition of IfAbruptCloseAsyncIterator, and it does seem to take care of unwrapping mappedValue into its [[Value]]—but I don’t see where it Awaits mappedValue beforehand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the Set _mappedValue_ to _mappedValue_.[[Value]]
line specifically, sorry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than comments.
Co-authored-by: Kevin Gibbons <[email protected]>
IfAbruptCloseIterator already takes care of this.
Resolves #19.
See #19 (comment).
The intent is to match the behavior of
for await
and iterator-helpers’AsyncIterator.prototype.toArray
.