| 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 --harmony-reflect --harmony-arrays | 5 // Flags: --stack-size=100 --harmony --harmony-reflect --harmony-arrays |
| 6 // Flags: --harmony-regexps --strong-mode | 6 // Flags: --harmony-regexps --strong-mode |
| 7 | 7 |
| 8 function test(f, expected, type) { | 8 function test(f, expected, type) { |
| 9 try { | 9 try { |
| 10 f(); | 10 f(); |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 "use strict"; | 398 "use strict"; |
| 399 o; | 399 o; |
| 400 }, "o is not defined", ReferenceError); | 400 }, "o is not defined", ReferenceError); |
| 401 | 401 |
| 402 // === RangeError === | 402 // === RangeError === |
| 403 | 403 |
| 404 // kArrayLengthOutOfRange | 404 // kArrayLengthOutOfRange |
| 405 test(function() { | 405 test(function() { |
| 406 "use strict"; | 406 "use strict"; |
| 407 Object.defineProperty([], "length", { value: 1E100 }); | 407 Object.defineProperty([], "length", { value: 1E100 }); |
| 408 }, "defineProperty() array length out of range", RangeError); | 408 }, "Invalid array length", RangeError); |
| 409 | 409 |
| 410 // kInvalidArrayBufferLength | 410 // kInvalidArrayBufferLength |
| 411 test(function() { | 411 test(function() { |
| 412 new ArrayBuffer(-1); | 412 new ArrayBuffer(-1); |
| 413 }, "Invalid array buffer length", RangeError); | 413 }, "Invalid array buffer length", RangeError); |
| 414 | 414 |
| 415 // kInvalidArrayLength | 415 // kInvalidArrayLength |
| 416 test(function() { | 416 test(function() { |
| 417 [].length = -1; | 417 [].length = -1; |
| 418 }, "Invalid array length", RangeError); | 418 }, "Invalid array length", RangeError); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 Number(1).toString(100); | 462 Number(1).toString(100); |
| 463 }, "toString() radix argument must be between 2 and 36", RangeError); | 463 }, "toString() radix argument must be between 2 and 36", RangeError); |
| 464 | 464 |
| 465 | 465 |
| 466 // === URIError === | 466 // === URIError === |
| 467 | 467 |
| 468 // kURIMalformed | 468 // kURIMalformed |
| 469 test(function() { | 469 test(function() { |
| 470 decodeURI("%%"); | 470 decodeURI("%%"); |
| 471 }, "URI malformed", URIError); | 471 }, "URI malformed", URIError); |
| OLD | NEW |