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

var target = {};
var handler = {
    getOwnPropertyDescriptor: function () { return { value: 2, configurable: true}; }
};

for (let p of [new Proxy(target, handler), Proxy.revocable(target, handler).proxy])
    Object.getOwnPropertyDescriptor(p, 'foo');

Object.preventExtensions(target);
for (let p of [new Proxy(target, handler), Proxy.revocable(target, handler).proxy])
    assertThrowsInstanceOf(() => Object.getOwnPropertyDescriptor(p, 'foo'), TypeError);