michael@0: // Return the trap result michael@0: var proxy = (new Proxy(function (x, y) { michael@0: this.foo = x + y; michael@0: }, { michael@0: construct: function (target, args) { michael@0: return { michael@0: foo: args[0] * args[1] michael@0: }; michael@0: } michael@0: })); michael@0: var obj1 = new proxy(2, 3); michael@0: assertEq(obj1.foo, 6); michael@0: obj1.bar = proxy; michael@0: var obj2 = new obj1.bar(2, 3); michael@0: assertEq(obj2.foo, 6);