summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/proxy/testDirectProxyGetOwnPropertyDescriptor4.js
blob: 9920121f20df8efe0bbf7699775222a23e67334d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
load(libdir + "asserts.js");

/*
 * Throw a TypeError if the trap reports a non-configurable property as
 * non-existent
 */
var target = {};
Object.defineProperty(target, 'foo', {
    configurable: false
});

var handler = { getOwnPropertyDescriptor: () => undefined };
for (let p of [new Proxy(target, handler), Proxy.revocable(target, handler).proxy])
    assertThrowsInstanceOf(() => Object.getOwnPropertyDescriptor(p, 'foo'), TypeError);