fpizlo@apple.com | b7613d1 | 2018-05-18 17:29:56 +0000 | [diff] [blame] | 1 | function foo(o, p) |
| 2 | { |
| 3 | return o instanceof p; |
| 4 | } |
| 5 | |
| 6 | noInline(foo); |
| 7 | |
| 8 | class Foo { } |
| 9 | class Bar { } |
| 10 | class Baz { } |
| 11 | |
| 12 | for (var i = 0; i < 10000; ++i) { |
| 13 | var result = foo(new Foo(), Foo); |
| 14 | if (!result) |
| 15 | throw "Error: bad result in loop (1): " + result; |
| 16 | var result = foo(new Foo(), Bar); |
| 17 | if (result) |
| 18 | throw "Error: bad result in loop (2): " + result; |
| 19 | } |
| 20 | |
| 21 | var result = foo(new Foo(), Baz); |
| 22 | if (result) |
| 23 | throw "Error: bad result at end: " + result; |