12:35 | <Andreu Botella> | I'm looking into https://github.com/whatwg/streams/pull/1083, which allows creating a ReadableStream from a (sync or async) iterable |
12:35 | <Andreu Botella> | This PR wants to call AsyncIteratorClose , but that AO uses Await() |
12:36 | <Andreu Botella> | and given that Await() works by suspending and replacing execution contexts, it's not clear whether that is something a non-TC39 spec can use |
13:37 | <littledan> | I think there isn’t a binary switch that gets flipped between these layers, and that it’s OK to do some TC39-style at the boundaries as long as it doesn’t get too confusing. But this is really a question for WHATWG folks. |
17:02 | <bakkot> | Andreu Botella: we will probably add proper support for built-in async functions soon, which will provide machinery for defining a promise-returning function where the body of the function can use Await without disruption - https://github.com/tc39/ecma262/pull/2942 |
17:05 | <bakkot> | prior to that PR, you're right that things are not really set up for it. my suggestion in the mean time would be, you don't actually need to use AsyncIteratorClose directly; if you trace through all the machinery, all it's really doing is calling the return method and then calling .then on the result with a continuation for remainder of the current function, which you can probably figure out how to do manually |