michael@0: /* michael@0: * Call the trap with the handler as the this value, the target as the first michael@0: * argument, the name of the property as the second argument, the value as the michael@0: * third argument, and the receiver as the fourth argument michael@0: */ michael@0: var target = {}; michael@0: var called = false; michael@0: var handler = { michael@0: set: function (target1, name, val, receiver) { michael@0: assertEq(this, handler); michael@0: assertEq(target1, target); michael@0: assertEq(name, 'foo'); michael@0: assertEq(val, 'baz'); michael@0: assertEq(receiver, proxy); michael@0: called = true; michael@0: } michael@0: }; michael@0: var proxy = new Proxy(target, handler); michael@0: proxy['foo'] = 'baz'; michael@0: assertEq(called, true);