summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/proxy/testDirectProxyConstruct4.js
blob: 35a44deac09d6c199f5c0205506c1a767a914d09 (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 = function () { };
var handler = { construct: () => called = true };
var holder = Proxy.revocable(target, handler);

holder.revoke();

assertThrowsInstanceOf(() => new holder.proxy(), TypeError);
assertEq(called, false);