Debian Codegraph @

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

raw
1 // Return the trap result
2 // Man, wouldn't haskell's "uninfix" be cleaner? (+)
3 function justAdd(x, y) {
4 return x + y;
5 }
6
7 var handler = { apply : function (target, receiver, args) { return args[0] * args[1]; } };
8
9 for (let p of [new Proxy(justAdd, handler), Proxy.revocable(justAdd, handler).proxy])
10 assertEq(p(2,3), 6);