Yields are ignored in finally block when async generator delegation is used #45400
Labels
Fix Available
A PR has been opened for this issue
Needs Investigation
This issue needs a team member to investigate its status.
Rescheduled
This issue was previously scheduled to an earlier milestone
Milestone
Bug Report
🔎 Search Terms
🕗 Version & Regression Information
Version:
Version 4.3.5
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
The output of the above program is:
This behavior can be observed for any compilation target lower than
es2018
. Fores2018
and above there's no code transformation at all, and so the native implementation of async generators is used upon execution. This suggests that something is wrong with the corresponding polyfill. Indeed, after a closer examination:seems to be ignoring the fact that calling
it.return()
does not necessarily result in{ done: true }
, which is effectively enforced bydone: n === "return"
.What is worth mentioning is the same problem doesn't occur for synchronous generators at all, which indicates that this is specific to how asynchronous generators are being handled.
🙂 Expected behavior
The output of the above program should be:
which is in line with the behavior observed when native async generator implementation is used.
The text was updated successfully, but these errors were encountered: