Source code

Revision control

Copy as Markdown

Other Tools

load(libdir + "asserts.js");
/*
* Throw a TypeError if the trap reports a new own property on a non-extensible
* object
*/
var target = {};
Object.preventExtensions(target);
var handler = { getOwnPropertyDescriptor: () => ({}) };
for (let p of [new Proxy(target, handler), Proxy.revocable(target, handler).proxy])
assertThrowsInstanceOf(() => Object.getOwnPropertyDescriptor(p, 'foo'), TypeError);