Debian Codegraph @

js/src/jit-test/tests/proxy/testDirectProxyGetOwnPropertyNames6.js

raw
1 load(libdir + "asserts.js");
2
3 // Throw a TypeError if the trap skips a non-configurable property
4 var target = {};
5 Object.defineProperty(target, 'foo', {
6 configurable: false
7 });
8
9 var handler = { ownKeys: () => [] };
10 for (let p of [new Proxy(target, handler), Proxy.revocable(target, handler).proxy])
11 assertThrowsInstanceOf(() => Object.getOwnPropertyNames(p), TypeError);