Debian Codegraph @

packages/babel-plugin-proposal-class-properties/test/fixtures/private/constructor-collision/exec.js

raw
1 var foo = "bar";
2
3 class Foo {
4 #bar = foo;
5
6 constructor() {
7 var foo = "foo";
8 }
9
10 test() {
11 return this.#bar;
12 }
13 }
14
15 const f = new Foo;
16 expect(f.test()).toBe(foo);
17 expect("bar" in f).toBe(false);