blob: d6ebb15b5ed2a5740ab32dc347867b0ad61b1981 (
plain)
1
2
3
4
5
6
7
|
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.getOwnPropertyNames(p), TypeError);
|