Debian Codegraph @

packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-classes--to-es2015/replacement-static-installed-on-correct-class/exec.js

raw symbols SCIP
1 let hasX, hasM, OriginalFoo;
2
3 class Bar {}
4
5 function dec(Foo) {
6 OriginalFoo = Foo;
7 return Bar;
8 }
9
10 @dec
11 class Foo {
12 static #x;
13 static #m() {}
14
15 static x;
16 static m() {}
17
18 static {
19 hasX = o => #x in o;
20 hasM = o => #m in o;
21 }
22 }
23
24 expect(hasX(Bar)).toBe(true);
25 expect(hasM(Bar)).toBe(true);
26 expect(hasX(OriginalFoo)).toBe(false);
27 expect(hasM(OriginalFoo)).toBe(false);
28
29 expect(Bar.hasOwnProperty("x")).toBe(true);
30 expect(OriginalFoo.hasOwnProperty("x")).toBe(false);
31
32 expect(Bar.hasOwnProperty("m")).toBe(false);
33 expect(OriginalFoo.hasOwnProperty("m")).toBe(true);