michael@0: load(libdir + "asserts.js"); michael@0: michael@0: /* michael@0: * Throw a TypeError if the trap skips an existing own enumerable property on a michael@0: * non-extensible object michael@0: */ michael@0: var target = {}; michael@0: Object.defineProperty(target, 'foo', { michael@0: enumerable: true, michael@0: configurable: true michael@0: }); michael@0: Object.preventExtensions(target); michael@0: assertThrowsInstanceOf(function () { michael@0: Object.keys(new Proxy(target, { michael@0: keys: function (target) { michael@0: return []; michael@0: } michael@0: })); michael@0: }, TypeError);