summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/fields/private-right-side-1.js
blob: 5be84db09d34ab78d285b014a74729f99f18fd2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
let hit = false;

function f() {
  hit = true;
}

class C {
  #f = 1;
  static m(x) {
    x.#f = f();  // f() should be called before the brand check for x.#f
  }
}

try {
  C.m({});  // throws a TypeError
} catch { }

assertEq(hit, true);