Also reproduced in v12 but not in v10 or v11.
async function* gen() {
try {
yield 42
} catch(e) {
console.log('Error caught!')
}
}
(async () => {
const g = gen()
await g.next() // go to yield 42
try {
await g.throw(new Error()) // throw error from the yield
} catch (e) {
console.error('e has been rethrown !')
}
})()
This happens only:
g.throw() should return a result { done: true, value: undefined }
g.throw() rethrows the error.
@nlepage Would you mind opening a bug here: https://bugs.chromium.org/p/v8/issues/list
V8 bug report: https://bugs.chromium.org/p/v8/issues/detail?id=10238
Chromium bug report: https://bugs.chromium.org/p/chromium/issues/detail?id=1053984
Most helpful comment
node bisects to https://github.com/nodejs/node/commit/cfe2484e046f812c762f33b0ecde327d29b2d29d
v8 bisects to https://github.com/v8/v8/commit/b7e935c5af0f7dde968774e3b67dea663a56f806