Source code
Revision control
Copy as Markdown
Other Tools
load(libdir + "asserts.js");
// Throw TypeError if trap returns a property key multiple times.
var handler = { ownKeys: () => [ 'foo', 'foo' ] };
for (let p of [new Proxy({}, handler), Proxy.revocable({}, handler).proxy])
assertThrowsInstanceOf(() => Object.keys(p), TypeError);