]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/plus-boolean-or-int.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / plus-boolean-or-int.js
CommitLineData
81345200
A
1function foo(a, b) {
2 return a.f + b.f;
3}
4
5noInline(foo);
6
7function test(a, b, c) {
8 var result = foo({f:a}, {f:b});
9 if (result != c)
10 throw "Error: expected " + c + " but got: " + result;
11}
12
13for (var i = 0; i < 100000; ++i) {
14 test(true, 42, 43);
15 test(42, 10, 52);
16}
17
18// Now try some unexpected things, in descending order of possible badness.
19test(true, 2147483647, 2147483648);
20test(false, 42, 42);
21test(1, 2, 3);
22test(true, true, 2);
23test(1.5, 1.5, 3);
24