fpizlo@apple.com | 2537f95 | 2014-07-28 20:41:09 +0000 | [diff] [blame] | 1 | function foo(o) { |
2 | if (o.f) | ||||
3 | return "yes"; | ||||
4 | else | ||||
5 | return "no"; | ||||
6 | } | ||||
7 | |||||
8 | noInline(foo); | ||||
9 | |||||
10 | function test(value, expected) { | ||||
11 | var result = foo({f:value}); | ||||
12 | if (result != expected) | ||||
13 | throw "Error: bad result for " + value + ": " + result; | ||||
14 | } | ||||
15 | |||||
16 | for (var i = 0; i < 10000; ++i) { | ||||
17 | test(1, "yes"); | ||||
18 | test(0, "no"); | ||||
19 | test(true, "yes"); | ||||
20 | test(false, "no"); | ||||
21 | } | ||||
22 | |||||
23 | test("yes", "yes"); |