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.
20 lines
203 B
JavaScript
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();
|