王清雨 313ecb579d
fix: fix static private field shadowed by local variable (#13656)
* 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
2021-08-30 12:03:47 +02:00

14 lines
188 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;
}
}