js/src/jit-test/tests/proxy/testDirectProxyConstruct3.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/testDirectProxyConstruct3.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,15 @@
     1.4 +// Return the trap result
     1.5 +var proxy = (new Proxy(function (x, y) {
     1.6 +    this.foo = x + y;
     1.7 +}, {
     1.8 +    construct: function (target, args) {
     1.9 +        return {
    1.10 +            foo: args[0] * args[1]
    1.11 +        };
    1.12 +    }
    1.13 +}));
    1.14 +var obj1 = new proxy(2, 3);
    1.15 +assertEq(obj1.foo, 6);
    1.16 +obj1.bar = proxy;
    1.17 +var obj2 = new obj1.bar(2, 3);
    1.18 +assertEq(obj2.foo, 6);

mercurial