Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/literals/regexp/u-unicode-esc.js

raw
1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 description: Unicode escape interpreted as the Mathematical Value of HexDigits
6 es6id: 21.2.2.10
7 info: |
8 21.2.2.10 CharacterEscape
9
10 The production RegExpUnicodeEscapeSequence :: u{ HexDigits } evaluates as
11 follows:
12
13 1. Return the character whose code is the MV of HexDigits.
14 ---*/
15
16 assert(/\u{0}/u.test('\u0000'), 'Minimum value (U+0000)');
17 assert(/\u{1}/u.test('\u0001'), 'U+0001');
18 assert.sameValue(/\u{1}/u.test('u'), false);
19 assert(/\u{3f}/u.test('?'));
20 assert(/\u{000000003f}/u.test('?'), 'Leading zeros');
21 assert(/\u{3F}/u.test('?'), 'Case insensitivity');
22 assert(/\u{10ffff}/u.test('\udbff\udfff'), 'Maxiumum value (U+10ffff)');