Tan Li Hau 6b57145d38
Support yield in do expression (#10101)
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2021-04-06 17:09:14 +02:00

14 lines
225 B
JavaScript

function * generator() {
yield 1;
const y = do {
let z;
yield 2;
};
return y;
}
const gen = generator();
expect(gen.next().value).toBe(1);
expect(gen.next().value).toBe(2);
expect(gen.next(3).value).toBe(3);