00:01 | <jschoi> | o7…It’s a person saluting. |
00:01 | <jschoi> | Also, I’m trying to figure out where it is specified that for await , when given a non-async iterable, performs await on each of the iterable’s items. |
00:01 | <jschoi> | In https://tc39.es/ecma262/#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset, step 6.b, when iteratorKind is async, then Await is called on nextResult itself. But I don’t see any place where Await is called on nextValue… |
00:12 | <bakkot> | jschoi: I believe it's in AsyncFromSyncIteratorPrototype |
00:12 | <bakkot> | i will see if I can find it |
00:13 | <bakkot> | https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asyncfromsynciteratorcontinuation |
00:15 | <bakkot> | that is, the AsyncFromSyncIteratorPrototype wrapper doesn't return Promise.resolve({ value: innerValue, done: false }) directly, as you might expect; rather, it yields Promise.resolve(innerValue).then(unwrapped => ({ value: unwrapped, done: false })) |
00:20 | <bakkot> | incidentally, the fact that Await is not called on
|
01:32 | <jschoi> | bakkot: Aha, thank you very much. This will help me very much. |
02:23 | <jschoi> | (Background for those curious: https://github.com/tc39/proposal-array-from-async/issues/9) |