Debian Codegraph @

js/src/jit-test/tests/proxy/testDirectProxyGet2.js

raw
1 /*
2 * Call the trap with the handler as the this value, the target as the first
3 * argument, the name of the property as the second argument, and the receiver
4 * as the third argument
5 */
6 var target = {};
7 for (var key of ['foo', Symbol.iterator]) {
8 handler = {};
9 for (let p of [new Proxy(target, handler), Proxy.revocable(target, handler).proxy]) {
10 handler.get =
11 function (target1, name, receiver) {
12 assertEq(this, handler);
13 assertEq(target1, target);
14 assertEq(name, key);
15 assertEq(receiver, p);
16 called = true;
17 };
18 var called = false;
19 assertEq(p[key], undefined);
20 assertEq(called, true);
21 }
22 }