]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/double-rep-with-non-cell.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / double-rep-with-non-cell.js
1 // Only bool, undefined and null
2 function addNullBoolUndefined(a, b) {
3 return a + b;
4 }
5 noInline(addNullBoolUndefined);
6
7 for (var i = 0; i < 1e4; ++i) {
8 var value = addNullBoolUndefined(0.5, null);
9 if (value !== 0.5)
10 throw "addNullBoolUndefined(0.5, null) failed with i = " + i + " returned value = " + value;
11
12 var value = addNullBoolUndefined(null, undefined);
13 if (value === value)
14 throw "addNullBoolUndefined(null, undefined) failed with i = " + i + " returned value = " + value;
15
16 var value = addNullBoolUndefined(true, null);
17 if (value !== 1)
18 throw "addNullBoolUndefined(true, null) failed with i = " + i + " returned value = " + value;
19
20 var value = addNullBoolUndefined(undefined, false);
21 if (value === value)
22 throw "addNullBoolUndefined(undefined, false) failed with i = " + i + " returned value = " + value;
23
24 var value = addNullBoolUndefined(false, true);
25 if (value !== 1)
26 throw "addNullBoolUndefined(false, true) failed with i = " + i + " returned value = " + value;
27
28 var value = addNullBoolUndefined(null, 42);
29 if (value !== 42)
30 throw "addNullBoolUndefined(null, 42) failed with i = " + i + " returned value = " + value;
31
32 }