mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-10 01:56:15 +08:00
A for…of or for await loop over an untyped iterable now tests, once it has its iterator and next method, whether the iterator is one of the program's own generators with its own next method. Each step of such a loop resumes the generator directly and boxes only the value, where the dynamic protocol boxed the result record and its promise and read them back. Every other iterator keeps the dynamic protocol, and early exits still close the iterator through it. The awaits are the protocol's: an async generator's next() promise is awaited, and a sync generator under for await awaits the result and then the value.