Closed
Description
In the semantics of yield* (14.4.14) in step 5.b.ii.5.b (the throw case), it returns a return completion record.
If I understand correctly, this means that if I define
function* inner() { try {yield 1} catch(e) {return}; yield 2 }
function* outer() { yield* inner(); yield 3 }
x = outer()
then I should get the following interaction:
> x.next()
{value: 1, done: false}
> x.throw("bla")
{value: undefined, done: true}
Is this intended?
V8 and Firefox behave as if 5.b.ii.5.b would just return a normal completion (like in 5.a.iii):
> x.next()
{value: 1, done: false}
> x.throw("bla")
{value: 3, done: false}
Edge does something else entirely:
> x.next()
{value: 1, done: false}
> x.throw("bla")
Exception: bla