This repository was archived by the owner on Jan 26, 2022. It is now read-only.
This repository was archived by the owner on Jan 26, 2022. It is now read-only.
Calling return or throw on paused async generator #5
Closed
Description
Consider:
async function* agf() {
try { await new Promise(_=> null) }
catch (x) { print("caught error") }
finally { print("finally!") }
}
var ag = agf();
ag.next();
ag.return();
What should happen in this case? The generator is waiting infinitely on a never-resolved promise. Should "return" and "throw" resume the generator even though it is paused on an await? It seems like it should.
Metadata
Metadata
Assignees
Labels
No labels