]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/fiat-value-to-int52-then-exit-not-double.js
JavaScriptCore-7600.1.4.9.tar.gz
[apple/javascriptcore.git] / tests / stress / fiat-value-to-int52-then-exit-not-double.js
CommitLineData
81345200
A
1function foo() {
2 return fiatInt52(bar(DFGTrue())) + 1;
3}
4
5var thingy = false;
6function bar(p) {
7 if (thingy)
8 return "hello";
9 return p ? 42 : 5.5;
10}
11
12noInline(foo);
13noInline(bar);
14
15for (var i = 0; i < 1000000; ++i) {
16 var result = foo();
17 if (result != 43 && result != 6.5)
18 throw "Error: bad result: " + result;
19}
20
21thingy = true;
22var result = foo();
23if (result != "hello1")
24 throw "Error: bad result at end: " + result;