haikuwebkit/JSTests/stress/class-fields-private-cached...

17 lines
218 B
JavaScript

function assert(a, e) {
if (a !== e)
throw new Error("Expected: " + e + " but got: " + a);
}
class C {
#f = 3;
method() {
return this.#f;
}
}
let c = new C();
assert(c.method(), 3);