Debian Codegraph @

packages/babel-plugin-transform-block-scoping/test/fixtures/general/closure-in-generator-or-async/exec.js

raw symbols SCIP
1 function* a() {
2 do {
3 let x = yield "iteration";
4 var fn = () => x;
5 } while (false);
6 return fn;
7 }
8
9 async function b() {
10 do {
11 let x = await "iteration";
12 var fn = () => x;
13 } while (false);
14 return fn;
15 }
16
17 async function* c() {
18 do {
19 let x = yield "iteration";
20 var fn = () => x;
21 } while (false);
22 return fn;
23 }
24
25 return (async () => {
26 let it = a();
27 expect(it.next().value).toBe("iteration");
28 expect(it.next("foo").value()).toBe("foo");
29
30 expect((await b())()).toBe("iteration");
31
32 it = c();
33 expect((await it.next()).value).toBe("iteration");
34 expect((await it.next("foo")).value()).toBe("foo");
35 })();
36