Reproducer (js test):
function* g() {
try {
throw 1;
} finally {
yield 0;
}
}
a = g();
console.log(a.next()); // { "value": 0, "done": false } from the finalizer
expect(a.next).toThrow();
Cause:
Yield::execute_impl
calls interpreter.do_return(value)
which clears the current exception, which means the finally will not pick it up when execution continues.
But not clearing the exception would instead shadow the return value and bubble up the exception on the first iteration,
so we need to find a way to save the exception in the generator state and restore in on re-entry
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too