You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All variations of .next throw or reject if the result is not an object except for %WrapForValidAsyncIteratorPrototype%.next.
This is because IteratorNext is used to do that check but IteratorNext only checks if the result is an object, which also returns true for promises.
An example:
letfoo={[Symbol.asyncIterator](){return{asyncnext(){returnnull;}}}}awaitAsyncIterator.from(foo).next();//Should throw TypeError but does not
The text was updated successfully, but these errors were encountered:
All variations of
.next
throw or reject if the result is not an object except for%WrapForValidAsyncIteratorPrototype%.next
.This is because
IteratorNext
is used to do that check butIteratorNext
only checks if the result is an object, which also returnstrue
for promises.An example:
The text was updated successfully, but these errors were encountered: