summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/PurgeProtoChain.js
blob: b6319464ab06f6ad6e24fe84dd3cb9c6bc115f26 (plain)
1
2
3
4
5
6
7
8
9
10
// In a proto chain A-->B-->C, shadowing C.x with B.x must change C's shape.

var C = {x: 1};
var B = Object.create(C);
var A = Object.create(B);
for (var i = 0; i < 2000; i++) {
    if (i == 1900)
        B.x = 3;
    assertEq(A.x, i < 1900 ? 1 : 3);
}