js/src/jit-test/tests/ion/getprop-cache.js

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:2ec644ed66f8
1 function test1() {
2 function h(node) {
3 var x = 0.1;
4 for (var i=0; i<100; i++) {
5 x += node.parent;
6 }
7 return x;
8 }
9 function build(depth) {
10 if (depth > 10)
11 return {parent: 3.3};
12 return {__proto__: build(depth + 1)};
13 }
14 var tree = build(0);
15 assertEq(h(tree)|0, 330);
16 }
17 test1();
18
19 function test2() {
20 function Foo() {};
21 Foo.prototype.x = 3.3;
22
23 var o = new Foo();
24 for (var i=0; i<100; i++) {
25 assertEq(o.x, 3.3);
26 }
27 }
28 test2();

mercurial