| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Flags: --stack-size=100 --harmony | 5 // Flags: --stack-size=100 --harmony |
| 6 // Flags: --harmony-simd --harmony-instanceof | 6 // Flags: --harmony-simd --harmony-instanceof |
| 7 | 7 |
| 8 function test(f, expected, type) { | 8 function test(f, expected, type) { |
| 9 try { | 9 try { |
| 10 f(); | 10 f(); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 var iter = generator(); | 140 var iter = generator(); |
| 141 iter.next(); | 141 iter.next(); |
| 142 }, "Generator is already running", TypeError); | 142 }, "Generator is already running", TypeError); |
| 143 | 143 |
| 144 // kIncompatibleMethodReceiver | 144 // kIncompatibleMethodReceiver |
| 145 test(function() { | 145 test(function() { |
| 146 Set.prototype.add.call([]); | 146 Set.prototype.add.call([]); |
| 147 }, "Method Set.prototype.add called on incompatible receiver [object Array]", | 147 }, "Method Set.prototype.add called on incompatible receiver [object Array]", |
| 148 TypeError); | 148 TypeError); |
| 149 | 149 |
| 150 // kInstanceofFunctionExpected | 150 // kNonCallableInInstanceOfCheck |
| 151 test(function() { |
| 152 1 instanceof {}; |
| 153 }, "Right-hand side of 'instanceof' is not callable", TypeError); |
| 154 |
| 155 // kNonObjectInInstanceOfCheck |
| 151 test(function() { | 156 test(function() { |
| 152 1 instanceof 1; | 157 1 instanceof 1; |
| 153 }, "Right-hand side of 'instanceof' is not an object", TypeError); | 158 }, "Right-hand side of 'instanceof' is not an object", TypeError); |
| 154 | 159 |
| 155 // kInstanceofNonobjectProto | 160 // kInstanceofNonobjectProto |
| 156 test(function() { | 161 test(function() { |
| 157 function f() {} | 162 function f() {} |
| 158 var o = new f(); | 163 var o = new f(); |
| 159 f.prototype = 1; | 164 f.prototype = 1; |
| 160 o instanceof f; | 165 o instanceof f; |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 Number(1).toString(100); | 450 Number(1).toString(100); |
| 446 }, "toString() radix argument must be between 2 and 36", RangeError); | 451 }, "toString() radix argument must be between 2 and 36", RangeError); |
| 447 | 452 |
| 448 | 453 |
| 449 // === URIError === | 454 // === URIError === |
| 450 | 455 |
| 451 // kURIMalformed | 456 // kURIMalformed |
| 452 test(function() { | 457 test(function() { |
| 453 decodeURI("%%"); | 458 decodeURI("%%"); |
| 454 }, "URI malformed", URIError); | 459 }, "URI malformed", URIError); |
| OLD | NEW |