]>
Commit | Line | Data |
---|---|---|
81345200 A |
1 | function foo(a, b) { |
2 | return a.f + b.f; | |
3 | } | |
4 | ||
5 | noInline(foo); | |
6 | ||
7 | function 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 | ||
13 | for (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. | |
19 | test(true, 2147483647, 2147483648); | |
20 | test(false, 42, 42); | |
21 | test(1, 2, 3); | |
22 | test(true, true, 2); | |
23 | test(1.5, 1.5, 3); | |
24 |