]>
Commit | Line | Data |
---|---|---|
81345200 A |
1 | function foo(a, b, c) { |
2 | return (a|0) + (b|0) + (c|0); | |
3 | } | |
4 | ||
5 | function bar(o) { | |
6 | var a = o.f; | |
7 | var b = o.g; | |
8 | var c = o.h; | |
9 | var d = o.i; | |
10 | var e = o.j; | |
11 | var f = o.k; | |
12 | var g = o.l; | |
13 | return foo(42, void 0, void 0) + a + b + c + d + e + f + g; | |
14 | } | |
15 | ||
16 | noInline(foo); | |
17 | noInline(bar); | |
18 | ||
19 | for (var i = 0; i < 100000; ++i) { | |
20 | var result = bar({ | |
21 | f:i * 3, g:i - 1, h:(i / 2)|0, i:-i, j:13 + ((i / 5)|0), k:14 - ((i / 6)|0), | |
22 | l:1 - i}); | |
23 | ||
24 | var expected = 42 + i * 3 + i - 1 + ((i / 2)|0) - i + 13 + ((i / 5)|0) + 14 - | |
25 | ((i / 6)|0) + 1 - i; | |
26 | ||
27 | if (result != expected) | |
28 | throw "Error: for iteration " + i + " expected " + expected + " but got " + result; | |
29 | } |