Debian Codegraph @

js/src/tests/non262/PrivateName/prototype-proxy.js

raw
1 // |reftest| skip-if(!this.hasOwnProperty("wrapWithProto"))
2
3 const o0 = {};
4 const v2 = new Proxy(o0, o0);
5
6 // v8 is a forwarding proxy with "prototype" behaviour;
7 // see the comment for mHasPrototype on BaseProxyHandler
8 // in Proxy.h.
9 //
10 // Private Fields don't interact with the hasPrototype
11 // behaviour (to minimize the overhead, and since private
12 // fields are always own properties).
13 const v8 = this.wrapWithProto(v2, {});
14 function f9(a10) {
15 return v8;
16 }
17 class C11 extends f9 {
18 #b = 12;
19 static {
20 const v13 = new this();
21
22 const val = v8.#b; // Get
23 assertEq(val, 12);
24
25 v8.#b = 0; // Set
26 assertEq(v8.#b, 0);
27
28 assertEq(#b in v8, true); // HasOwn.
29 }
30 }
31
32 if (typeof reportCompare === 'function') reportCompare(0, 0);