Debian Codegraph @

js/src/jit-test/tests/proxy/testDirectProxyDefineProperty4.js

raw
1 load(libdir + "asserts.js");
2
3 /*
4 * Throw a TypeError if the trap defines a non-configurable property that does
5 * not exist on the target
6 */
7 var handler = { defineProperty: function (target, name, desc) { return true; } };
8 for (let p of [new Proxy({}, handler), Proxy.revocable({}, handler).proxy]) {
9 assertThrowsInstanceOf(function () {
10 Object.defineProperty(p, 'foo', { configurable: false });
11 }, TypeError);
12 }