summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/proxy/testDirectProxyGetOwnPropertyDescriptor9.js
blob: 7a07f74f6ed0b79518d1c896741deabfd6248219 (plain)
1
2
3
4
5
6
7
8
9
load(libdir + "asserts.js");

/*
 * Throw a TypeError if the trap returns a non-configurable descriptor for a
 * non-existent property
 */
var handler = { getOwnPropertyDescriptor: () => ({ configurable: false }) };
for (let p of [new Proxy({}, handler), Proxy.revocable({}, handler).proxy])
    assertThrowsInstanceOf(() => Object.getOwnPropertyDescriptor(p, 'foo'), TypeError);