summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/proxy/testDirectProxyHas7.js
blob: 096688204a2e06f4b1935a3ac22b9f151b271094 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
load(libdir + "asserts.js");
// Revoked proxies should throw before calling the handler

var called = false;
var target = {};
var handler = { has: () => called = true };
var holder = Proxy.revocable(target, handler);

holder.revoke();

assertThrowsInstanceOf(() => 'foo' in holder.proxy, TypeError);
assertEq(called, false);