diff options
Diffstat (limited to 'js/src/tests/test262/annexB/built-ins/RegExp/incomplete_hex_unicode_escape.js')
-rw-r--r-- | js/src/tests/test262/annexB/built-ins/RegExp/incomplete_hex_unicode_escape.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/js/src/tests/test262/annexB/built-ins/RegExp/incomplete_hex_unicode_escape.js b/js/src/tests/test262/annexB/built-ins/RegExp/incomplete_hex_unicode_escape.js new file mode 100644 index 0000000000..915c303f3f --- /dev/null +++ b/js/src/tests/test262/annexB/built-ins/RegExp/incomplete_hex_unicode_escape.js @@ -0,0 +1,20 @@ +// Copyright (C) 2015 Zirak. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: An incomplete HexEscape or UnicodeEscape should be treated as an Identity Escape +info: | + An incomplete HexEscape (e.g. /\x/) or UnicodeEscape (/\u/) should fall + through to IdentityEscape +esid: prod-AtomEscape +---*/ + +// Hex escape +assert(/\x/.test("x"), "/\\x/"); +assert(/\xa/.test("xa"), "/\\xa/"); + +// Unicode escape +assert(/\u/.test("u"), "/\\u/"); +assert(/\ua/.test("ua"), "/\\ua/"); + +reportCompare(0, 0); |