Debian Codegraph @

js/src/jit-test/tests/basic/mutable-proto-teleporting.js

raw
1 // The teleporting optimization should work correctly
2 // when we modify an object's proto.
3
4 var A = {x: 1};
5 var B = Object.create(A);
6
7 var C = {};
8 C.__proto__ = B;
9
10 function f() {
11 for (var i=0; i<25; i++) {
12 assertEq(C.x, (i <= 20) ? 1 : 3);
13 if (i === 20) {
14 B.x = 3;
15 }
16 }
17 }
18 f();