summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/proxy/testDirectProxyOnProtoWithForIn.js
blob: 984e913c0e0b7d5136d03003d4378a9bdcde1911 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
let proxy = new Proxy({
    a: 1,
    b: 2,
    c: 3
}, {
    enumerate() {
        // Should not be invoked.
        assertEq(false, true);
    },

    ownKeys() {
        return ['a', 'b'];
    }
});

let object = Object.create(proxy);
object.d = 4;

let a = [];
for (let x in object) {
  a.push(x);
}
assertEq(a.toString(), "d,a,b");