summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/cacheir/windowproxy.js
blob: 994af384e4d9734a8a7ffca9bd8c4bcef30ac23a (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
31
32
var g = newGlobal({
    sameZoneAs: this,
    useWindowProxy: true,
});

g.evaluate(`
    this.data = 7;

    // Getter / Setter
    Object.defineProperty(this, "prop", {
        get: function() { return this.data; },
        set: function(val) { this.data = val; },
    });

    // Getter / Setter ICs
    for (var i = 0; i < 20; ++i) {
        this.data = i;
        assertEq(prop, i);
        prop = i;
        assertEq(this.prop, i);
        this.prop = i;
        assertEq(this.data, i);
    }
`);


// CCW of WindowProxy
for (var i = 0; i < 20; ++i) {
    g.slot = i;
    assertEq(g.slot, i);
}