packages/babel-plugin-proposal-do-expressions/test/fixtures/do-expressions/await-yield/exec.js
raw symbols SCIP| 1 | async function* asyncGenerator(x) { |
| 2 | const y = do { |
| 3 | let z; |
| 4 | yield 3; |
| 5 | yield await x; |
| 6 | }; |
| 7 | |
| 8 | return y; |
| 9 | } |
| 10 | |
| 11 | const promise = Promise.resolve(5); |
| 12 | const gen = asyncGenerator(promise); |
| 13 | expect(gen.next()).resolves.toMatchObject({ value: 3, done: false }); |
| 14 | expect(gen.next()).resolves.toMatchObject({ value: 5, done: false }); |
| 15 | expect(gen.next(10)).resolves.toMatchObject({ value: 10, done: true }); |