blob: 72b2f9e4fe65f780865756fcbefb8d26e3374d35 [file] [log] [blame]
fpizlo@apple.comb7613d12018-05-18 17:29:56 +00001function foo(o, p)
2{
3 return o instanceof p;
4}
5
6noInline(foo);
7
8class Foo { }
9class Bar { }
10class Baz { }
11
12for (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
21var result = foo(new Foo(), Baz);
22if (result)
23 throw "Error: bad result at end: " + result;