summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/proxy/testDirectProxyPreventExtensions3.js
blob: 7cb4046185e76c1867c178d8dd9d7ab4f6c03d03 (plain)
1
2
3
4
5
6
7
load(libdir + "asserts.js");

// Throw a TypeError if the trap reports an extensible object as non-extensible

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