| OLD | NEW |
| 1 // Expectation for test: | 1 // Expectation for test: |
| 2 // foo(x, list) { | 2 // foo(x, list) { |
| 3 // var sum = 0; | 3 // var sum = 0; |
| 4 // for (int k = 0; k < 10; k++) { | 4 // for (int k = 0; k < 10; k++) { |
| 5 // // Everything can be hoisted out up to the index access which is | 5 // // Everything can be hoisted out up to the index access which is |
| 6 // // blocked by the bounds check. | 6 // // blocked by the bounds check. |
| 7 // var a = x.left.left; | 7 // var a = x.left.left; |
| 8 // var b = x.left.right; | 8 // var b = x.left.right; |
| 9 // var c = x.right.left; | 9 // var c = x.right.left; |
| 10 // var d = x.right.right; | 10 // var d = x.right.right; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // var y2 = new Branch(x3, x4); | 38 // var y2 = new Branch(x3, x4); |
| 39 // var z = new Root(y1, y2); | 39 // var z = new Root(y1, y2); |
| 40 // print(foo(z, [1,2,3,4,5,6,7,8,9,10])); | 40 // print(foo(z, [1,2,3,4,5,6,7,8,9,10])); |
| 41 // } | 41 // } |
| 42 | 42 |
| 43 function() { | 43 function() { |
| 44 var v0 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], i = 1 + 20, v1 = i * (10 + -10), sum
= 0, k = 0, line; | 44 var v0 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], i = 1 + 20, v1 = i * (10 + -10), sum
= 0, k = 0, line; |
| 45 for (; k < 10; sum += i + v0[v1], ++k) | 45 for (; k < 10; sum += i + v0[v1], ++k) |
| 46 if (v1 < 0 || v1 >= 10) | 46 if (v1 < 0 || v1 >= 10) |
| 47 return H.ioore(v0, v1); | 47 return H.ioore(v0, v1); |
| 48 line = sum === 0 ? 1 / sum < 0 ? "-0.0" : "" + sum : "" + sum; | 48 line = H.S(sum); |
| 49 if (typeof dartPrint == "function") | 49 if (typeof dartPrint == "function") |
| 50 dartPrint(line); | 50 dartPrint(line); |
| 51 else if (typeof console == "object" && typeof console.log != "undefined") | 51 else if (typeof console == "object" && typeof console.log != "undefined") |
| 52 console.log(line); | 52 console.log(line); |
| 53 else if (!(typeof window == "object")) { | 53 else if (!(typeof window == "object")) { |
| 54 if (!(typeof print == "function")) | 54 if (!(typeof print == "function")) |
| 55 throw "Unable to print message: " + String(line); | 55 throw "Unable to print message: " + String(line); |
| 56 print(line); | 56 print(line); |
| 57 } | 57 } |
| 58 } | 58 } |
| OLD | NEW |