Debian Codegraph @

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

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