2016-01-29 09:21:09 +00:00
|
|
|
// Copyright 2016 the V8 project authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
// test262/data/test/language/literals/regexp/u-dec-esc
|
2016-02-11 12:28:50 +00:00
|
|
|
assertThrows("/\\1/u", SyntaxError);
|
2016-01-29 09:21:09 +00:00
|
|
|
// test262/language/literals/regexp/u-invalid-char-range-a
|
2016-02-11 12:28:50 +00:00
|
|
|
assertThrows("/[\\w-a]/u", SyntaxError);
|
2016-01-29 09:21:09 +00:00
|
|
|
// test262/language/literals/regexp/u-invalid-char-range-b
|
2016-02-11 12:28:50 +00:00
|
|
|
assertThrows("/[a-\\w]/u", SyntaxError);
|
2016-01-29 09:21:09 +00:00
|
|
|
// test262/language/literals/regexp/u-invalid-char-esc
|
2016-02-11 12:28:50 +00:00
|
|
|
assertThrows("/\\c/u", SyntaxError);
|
|
|
|
assertThrows("/\\c0/u", SyntaxError);
|
2016-01-29 09:21:09 +00:00
|
|
|
// test262/built-ins/RegExp/unicode_restricted_quantifiable_assertion
|
2016-02-11 12:28:50 +00:00
|
|
|
assertThrows("/(?=.)*/u", SyntaxError);
|
2018-02-20 10:50:48 +00:00
|
|
|
assertThrows("/(?=.){1,2}/u", SyntaxError);
|
2016-01-29 09:21:09 +00:00
|
|
|
// test262/built-ins/RegExp/unicode_restricted_octal_escape
|
2016-02-11 12:28:50 +00:00
|
|
|
assertThrows("/[\\1]/u", SyntaxError);
|
|
|
|
assertThrows("/\\00/u", SyntaxError);
|
|
|
|
assertThrows("/\\09/u", SyntaxError);
|
2016-01-29 09:21:09 +00:00
|
|
|
// test262/built-ins/RegExp/unicode_restricted_identity_escape_alpha
|
2016-02-11 12:28:50 +00:00
|
|
|
assertThrows("/[\\c]/u", SyntaxError);
|
2016-01-29 09:21:09 +00:00
|
|
|
// test262/built-ins/RegExp/unicode_restricted_identity_escape_c
|
2016-02-11 12:28:50 +00:00
|
|
|
assertThrows("/[\\c0]/u", SyntaxError);
|
2016-01-29 09:21:09 +00:00
|
|
|
// test262/built-ins/RegExp/unicode_restricted_incomple_quantifier
|
2016-02-11 12:28:50 +00:00
|
|
|
assertThrows("/a{/u", SyntaxError);
|
|
|
|
assertThrows("/a{1,/u", SyntaxError);
|
|
|
|
assertThrows("/{/u", SyntaxError);
|
|
|
|
assertThrows("/}/u", SyntaxError);
|
2016-01-29 09:21:09 +00:00
|
|
|
// test262/data/test/built-ins/RegExp/unicode_restricted_brackets
|
2016-02-11 12:28:50 +00:00
|
|
|
assertThrows("/]/u", SyntaxError);
|
2016-01-29 09:21:09 +00:00
|
|
|
// test262/built-ins/RegExp/unicode_identity_escape
|
|
|
|
/\//u;
|
2016-02-11 12:28:50 +00:00
|
|
|
|
|
|
|
// escaped \0 is allowed inside a character class.
|
|
|
|
assertEquals(["\0"], /[\0]/u.exec("\0"));
|
|
|
|
// unless it is followed by another digit.
|
|
|
|
assertThrows("/[\\00]/u", SyntaxError);
|
|
|
|
assertThrows("/[\\01]/u", SyntaxError);
|
|
|
|
assertThrows("/[\\09]/u", SyntaxError);
|
|
|
|
assertEquals(["\u{0}1\u{0}a\u{0}"], /[1\0a]+/u.exec("b\u{0}1\u{0}a\u{0}2"));
|
|
|
|
// escaped \- is allowed inside a character class.
|
|
|
|
assertEquals(["-"], /[a\-z]/u.exec("12-34"));
|