michael@0: load(libdir + "asserts.js"); michael@0: michael@0: /* michael@0: * Throw a TypeError if the trap sets a non-configurable accessor property that michael@0: * doest not have a setter michael@0: */ michael@0: var target = {}; michael@0: Object.defineProperty(target, 'foo', { michael@0: get: function () { michael@0: return 'bar' michael@0: }, michael@0: configurable: false michael@0: }); michael@0: assertThrowsInstanceOf(function () { michael@0: new Proxy(target, { michael@0: set: function (target, name, val, receiver) { michael@0: return true; michael@0: } michael@0: })['foo'] = 'baz'; michael@0: }, TypeError);