michael@0: load(libdir + "asserts.js"); michael@0: michael@0: // Throw a TypeError if the trap sets a non-writable, non-configurable property michael@0: var target = {}; michael@0: Object.defineProperty(target, 'foo', { michael@0: value: 'bar', michael@0: writable: false, 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);