keith_miller@apple.com | cb11fe4 | 2015-12-18 00:37:35 +0000 | [diff] [blame] | 1 | function Constructor(x) {} |
| 2 | |
| 3 | Object.defineProperty(Constructor, Symbol.hasInstance, {value: function() { return false; }}); |
| 4 | |
| 5 | x = new Constructor(); |
| 6 | |
| 7 | function instanceOf(a, b) { |
| 8 | return a instanceof b; |
| 9 | } |
| 10 | noInline(instanceOf); |
| 11 | |
| 12 | function body() { |
| 13 | var result = 0; |
| 14 | for (var i = 0; i < 100000; i++) { |
| 15 | if (instanceOf(x, Constructor)) |
| 16 | result++; |
| 17 | } |
| 18 | |
| 19 | return result; |
| 20 | } |
| 21 | noInline(body); |
| 22 | |
| 23 | if (body()) |
| 24 | throw "result incorrect"; |