OLD | NEW |
---|---|
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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: --harmony-unicode-regexps | 5 // Flags: --harmony-unicode-regexps |
6 | 6 |
7 // test262/data/test/language/literals/regexp/u-dec-esc | 7 // test262/data/test/language/literals/regexp/u-dec-esc |
8 assertThrows("/\\1/u"); | 8 assertThrows("/\\1/u"); |
9 // test262/language/literals/regexp/u-invalid-char-range-a | 9 // test262/language/literals/regexp/u-invalid-char-range-a |
10 assertThrows("/[\\w-a]/u"); | 10 assertThrows("/[\\w-a]/u"); |
(...skipping 14 matching lines...) Loading... | |
25 assertThrows("/[\\c0]/u"); | 25 assertThrows("/[\\c0]/u"); |
26 // test262/built-ins/RegExp/unicode_restricted_incomple_quantifier | 26 // test262/built-ins/RegExp/unicode_restricted_incomple_quantifier |
27 assertThrows("/a{/u"); | 27 assertThrows("/a{/u"); |
28 assertThrows("/a{1,/u"); | 28 assertThrows("/a{1,/u"); |
29 assertThrows("/{/u"); | 29 assertThrows("/{/u"); |
30 assertThrows("/}/u"); | 30 assertThrows("/}/u"); |
31 // test262/data/test/built-ins/RegExp/unicode_restricted_brackets | 31 // test262/data/test/built-ins/RegExp/unicode_restricted_brackets |
32 assertThrows("/]/u"); | 32 assertThrows("/]/u"); |
33 // test262/built-ins/RegExp/unicode_identity_escape | 33 // test262/built-ins/RegExp/unicode_identity_escape |
34 /\//u; | 34 /\//u; |
35 | |
36 // escaped \0 is allowed inside a character class. | |
37 assertEquals(["\0"], /[\0]/u.exec("\0")); | |
38 // unless it is followed by another digit. | |
39 assertThrows("/[\\00]/u"); | |
Dan Ehrenberg
2016/02/11 09:07:51
Optional: Assert it throws a SyntaxError?
Yang
2016/02/11 12:02:36
Done.
| |
40 assertThrows("/[\\01]/u"); | |
41 assertThrows("/[\\09]/u"); | |
42 assertEquals(["\u{0}1\u{0}a\u{0}"], /[1\0a]+/u.exec("b\u{0}1\u{0}a\u{0}2")); | |
43 // escaped \- is allowed inside a character class. | |
44 assertEquals(["-"], /[a\-z]/u.exec("12-34")); | |
OLD | NEW |