summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/proxy/seal-proxy.js
blob: 74923cde01d2360a05da926e600c6573114cceae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var called = [];
var proxy = new Proxy({a: 1}, {
    getOwnPropertyDescriptor(target, P) {
        called.push("getOwnPropertyDescriptor");
        return Object.getOwnPropertyDescriptor(target, P);
    },
    defineProperty(target, P, desc) {
        called.push("defineProperty");
        assertEq(Object.getOwnPropertyNames(desc).length, 1);
        assertEq(desc.configurable, false);
        return Object.defineProperty(target, P, desc);
    }
});

Object.seal(proxy);
assertEq(called.toString(), "defineProperty");