]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/elidable-new-object-roflcopter-then-exit.js
1 function sumOfArithSeries(limit
) {
2 return limit
* (limit
+ 1) / 2;
7 var array
= [42, "hello"];
12 for (var i
= 0; i
< n
; ++i
) {
13 var o
= {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: i
}}}}}}}}}}}}}}}}}}};
14 var p
= {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: {f: i
+ 1}}}}}}}}}}}}}}}}}}};
15 q
= array
[(i
> n
- 100) | 0] + 1;
16 result
+= o
.f
.f
.f
.f
.f
.f
.f
.f
.f
.f
.f
.f
.f
.f
.f
.f
.f
.f
.f
+ p
.f
.f
.f
.f
.f
.f
.f
.f
.f
.f
.f
.f
.f
.f
.f
.f
.f
.f
.f
;
22 if (result
!= "hello" + 1 + (sumOfArithSeries(n
- 1) + sumOfArithSeries(n
)))
23 throw "Error: bad result: " + result
;