* fix: fix static private field shadowed by local variable currently throw an error, maybe we could generate correct code fix #12960 * feat: rename local variable and add test cases * feat: add unshadow to privateIn visitor also add test cases * test: add reference to shadowed variable * refactor: apply suggested changes simplify logic and add comments
18 lines
265 B
JavaScript
18 lines
265 B
JavaScript
class Test {
|
|
|
|
static #x = 1
|
|
|
|
method(other) {
|
|
const Test = 2;
|
|
const func = () => {
|
|
const Test = 3;
|
|
return #x in other && Test;
|
|
}
|
|
return func() + Test;
|
|
}
|
|
}
|
|
|
|
const t = new Test();
|
|
const t2 = new Test();
|
|
expect(t.method(Test)).toBe(5)
|