]> git.saurik.com Git - apple/javascriptcore.git/blame_incremental - tests/stress/no-abc-skippy-loop.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / no-abc-skippy-loop.js
... / ...
CommitLineData
1function foo(array) {
2 var result = 0;
3 for (var i = 0; i != array.length; i += 2) {
4 var element = array[i];
5 if (element === void 0)
6 break;
7 result += array[i];
8 }
9 return result;
10}
11
12noInline(foo);
13
14var array = [1, 2, 3, 4];
15for (var i = 0; i < 10000; ++i) {
16 var result = foo(array);
17 if (result != 4)
18 throw "Error: bad result in loop: " + result;
19}
20
21var array = [1, 2, 3];
22var result = foo(array);
23if (result != 4)
24 throw "Error: bad result at end: " + result;