Debian Codegraph @

js/src/jit-test/tests/fields/private-right-side-1.js

raw
1 let hit = false;
2
3 function f() {
4 hit = true;
5 }
6
7 class C {
8 #f = 1;
9 static m(x) {
10 x.#f = f(); // f() should be called before the brand check for x.#f
11 }
12 }
13
14 try {
15 C.m({}); // throws a TypeError
16 } catch { }
17
18 assertEq(hit, true);