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

/*
 * Throw a TypeError if the trap reports a non-configurable own property as
 * non-existent
 */
var target = {};
Object.defineProperty(target, 'foo', {
    configurable: false
});
var handler = { has: () => false };
for (p of [new Proxy(target, handler), Proxy.revocable(target, handler).proxy])
    assertThrowsInstanceOf(function () { 'foo' in p; }, TypeError);