1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
var error = undefined; try { eval(`class a { static #x() { } [b.#x] }`); } catch (e) { error = e; } assertEq(error instanceof ReferenceError, true); var error = undefined; try { eval(`class Base {}; class B extends Base { static #x() { } [Base.#x] = 1; constructor() { super(); } }`); } catch (e) { error = e; } assertEq(error instanceof TypeError, true);