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

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

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