summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/proxy/testDirectProxyGetOwnPropertyNames1.js
blob: 11618c876f1013cb1b42a44bc9ee08ddf96559c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Forward to the target if the trap is not defined
var objAB = Object.create(null, {
    a: {
        enumerable: true,
        configurable: true
    },
    b: {
        enumerable: false,
        configurable: true
    }
});

var objCD = Object.create(objAB, {
    c: {
        enumerable: true,
        configurable: true
    },
    d: {
        enumerable: false,
        configurable: true
    }
});

objCD[Symbol("moon")] = "something";
for (let p of [new Proxy(objCD, {}), Proxy.revocable(objCD, {}).proxy]) {
    var names = Object.getOwnPropertyNames(p);
    assertEq(names.length, 2);
    assertEq(names[0], 'c');
    assertEq(names[1], 'd');
}