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

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

holder.revoke();

var p = holder.proxy;
assertThrowsInstanceOf(() => Object.defineProperty(p, 'foo', {}), TypeError);
assertEq(called, false);