summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/proxy/testDirectProxyDefineProperty4.js
blob: 30e8d6316176f4c6614610e0c220733c10f0a577 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
load(libdir + "asserts.js");

/*
 * Throw a TypeError if the trap defines a non-configurable property that does
 * not exist on the target
 */
var handler = { defineProperty: function (target, name, desc) { return true; } };
for (let p of [new Proxy({}, handler), Proxy.revocable({}, handler).proxy]) {
    assertThrowsInstanceOf(function () {
        Object.defineProperty(p, 'foo', { configurable: false });
    }, TypeError);
}