Justin Ridgewell d6efed5b22
Fix redeclaring private in nested class's superClass (#11424)
If a nested class's `superClass` redeclares the outer class's private field and access it in a computed key, that should fail.

Follow up to #11405.
2020-04-20 16:54:14 +02:00

20 lines
203 B
JavaScript

class Foo {
#foo = 1;
test() {
class Nested {
#foo = 2;
[this.#foo]() {
}
}
return new Nested();
}
}
const f = new Foo();
expect(() => {
f.test();
}).toThrow();