| //@ skip if $model == "Apple Watch Series 3" # added by mark-jsc-stress-test.py |
| // This tests that we do not constantly OSR on instanceof where the RHS is a bound function. |
| // While this bound functions are unlikely to be passed to instanceof often C-API users use |
| // the same method of overriding instanceof expressions. |
| function Constructor(x) { |
| Constructor.prototype = {} |
| BoundConstructor = Constructor.bind(); |
| foo = new Constructor(1); |
| bar = new BoundConstructor(1); |
| if (!(foo instanceof BoundConstructor)) { |
| throw new Error("foo should be an instanceof BoundConstructor"); |
| for (i = 0; i < 50000; i++) |