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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/proxy/testDirectProxyApply2.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,18 @@
     1.4 +/*
     1.5 + * Call the trap with the handler as the this value, the target as the first
     1.6 + * argument, the original this value as the second argument, and the original
     1.7 + * arguments as the third argument.
     1.8 + */
     1.9 +var target = function () {};
    1.10 +var receiver = {};
    1.11 +var handler = {
    1.12 +    apply: function (target1, receiver1, args) {
    1.13 +        assertEq(this, handler);
    1.14 +        assertEq(target1, target);
    1.15 +        assertEq(receiver1, receiver);
    1.16 +        assertEq(args.length, 2);
    1.17 +        assertEq(args[0], 2);
    1.18 +        assertEq(args[1], 3);
    1.19 +    }
    1.20 +}
    1.21 +new Proxy(target, handler).call(receiver, 2, 3);

mercurial