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-regexps | 5 // Flags: --stack-size=100 --harmony --harmony-reflect --harmony-regexps |
6 // Flags: --harmony-simd | 6 // Flags: --harmony-simd |
7 | 7 |
8 function test(f, expected, type) { | 8 function test(f, expected, type) { |
9 try { | 9 try { |
10 f(); | 10 f(); |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 "and a value or writable attribute, #<Object>", TypeError); | 332 "and a value or writable attribute, #<Object>", TypeError); |
333 | 333 |
334 | 334 |
335 // === SyntaxError === | 335 // === SyntaxError === |
336 | 336 |
337 // kInvalidRegExpFlags | 337 // kInvalidRegExpFlags |
338 test(function() { | 338 test(function() { |
339 eval("/a/x.test(\"a\");"); | 339 eval("/a/x.test(\"a\");"); |
340 }, "Invalid regular expression flags", SyntaxError); | 340 }, "Invalid regular expression flags", SyntaxError); |
341 | 341 |
| 342 // kInvalidOrUnexpectedToken |
| 343 test(function() { |
| 344 eval("'\n'"); |
| 345 }, "Invalid or unexpected token", SyntaxError); |
| 346 |
342 //kJsonParseUnexpectedEOS | 347 //kJsonParseUnexpectedEOS |
343 test(function() { | 348 test(function() { |
344 JSON.parse("{") | 349 JSON.parse("{") |
345 }, "Unexpected end of JSON input", SyntaxError); | 350 }, "Unexpected end of JSON input", SyntaxError); |
346 | 351 |
347 // kJsonParseUnexpectedTokenAt | 352 // kJsonParseUnexpectedTokenAt |
348 test(function() { | 353 test(function() { |
349 JSON.parse("/") | 354 JSON.parse("/") |
350 }, "Unexpected token / in JSON at position 0", SyntaxError); | 355 }, "Unexpected token / in JSON at position 0", SyntaxError); |
351 | 356 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 Number(1).toString(100); | 445 Number(1).toString(100); |
441 }, "toString() radix argument must be between 2 and 36", RangeError); | 446 }, "toString() radix argument must be between 2 and 36", RangeError); |
442 | 447 |
443 | 448 |
444 // === URIError === | 449 // === URIError === |
445 | 450 |
446 // kURIMalformed | 451 // kURIMalformed |
447 test(function() { | 452 test(function() { |
448 decodeURI("%%"); | 453 decodeURI("%%"); |
449 }, "URI malformed", URIError); | 454 }, "URI malformed", URIError); |
OLD | NEW |