Debian Codegraph @

packages/babel-plugin-proposal-destructuring-private/test/fixtures/ordering/.array-pattern-side-effect-iterable/exec.js

raw
1 var log = [];
2
3 function push(x, y = x) { log.push(x); return y; }
4
5 class C {
6 static get a() { push(2) }
7 static get b() { push(7) }
8 static get c() { push(11) }
9 static get d() { push(15) }
10 static get #x() { push(4) };
11 static get #y() { return push(9, C) };
12 static {
13 function *iterator() {
14 push(0);
15 yield C;
16 push(13);
17 yield C;
18 }
19
20 var [{ [push(1, "a")]: a = push(3), #x: {
21 [push(6, "b")]: b = push(8),
22 #y: y = push(-1),
23 [push(10, "c")]: c = push(12)
24 } = push(5, C) }, { [push(14, "d")]: d = push(16) }] = iterator();
25 }
26 }
27
28 var nums = Array.from({ length: 16 }, (_, i) => i);
29 expect(log).toStrictEqual(nums);