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

/*
 * Throw a TypeError if the trap skips an existing own property on a
 * non-extensible object
 */
var target = {};
Object.defineProperty(target, 'foo', {
    configurable: true
});
Object.preventExtensions(target);

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