Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: test/mjsunit/harmony/unicode-regexp-last-index.js

Issue 1608693003: [regexp] step back if starting unicode regexp within surrogate pair. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@unicodeclass
Patch Set: rebase to ToT Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« src/regexp/jsregexp.cc ('K') | « src/regexp/regexp-ast.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // Flags: --harmony-unicode-regexps --harmony-regexp-lookbehind
6
7 var r = /./ug;
erikcorry 2016/01/22 10:10:10 All these tests should be duplicated without the /
Yang 2016/01/25 07:38:41 Done.
8 assertEquals(["\ud800\udc00"], r.exec("\ud800\udc00\ud801\udc01"));
9 assertEquals(2, r.lastIndex);
10 r.lastIndex = 1;
11 assertEquals(["\ud800\udc00"], r.exec("\ud800\udc00\ud801\udc01"));
12 assertEquals(2, r.lastIndex);
13 assertEquals(["\ud801\udc01"], r.exec("\ud800\udc00\ud801\udc01"));
14 r.lastIndex = 3;
15 assertEquals(["\ud801\udc01"], r.exec("\ud800\udc00\ud801\udc01"));
16 r.lastIndex = 4;
17 assertNull(r.exec("\ud800\udc00\ud801\udc01"));
18 r.lastIndex = 5;
19 assertNull(r.exec("\ud800\udc00\ud801\udc01"));
20
21 r.lastIndex = 3;
22 assertEquals(["\ud802"], r.exec("\ud800\udc00\ud801\ud802"));
23 r.lastIndex = 4;
24 assertNull(r.exec("\ud800\udc00\ud801\ud802"));
25
26 r = /^./ug;
27 assertEquals(["\ud800\udc00"], r.exec("\ud800\udc00\ud801\udc01"));
28 assertEquals(2, r.lastIndex);
29 r.lastIndex = 1;
30 assertEquals(["\ud800\udc00"], r.exec("\ud800\udc00\ud801\udc01"));
31 assertEquals(2, r.lastIndex);
32 assertNull(r.exec("\ud800\udc00\ud801\udc01"));
33 r.lastIndex = 3;
34 assertNull(r.exec("\ud800\udc00\ud801\udc01"));
35 r.lastIndex = 4;
36 assertNull(r.exec("\ud800\udc00\ud801\udc01"));
37 r.lastIndex = 5;
38 assertNull(r.exec("\ud800\udc00\ud801\udc01"));
39
40 r = /(?:(^.)|.)/ug;
41 assertEquals(["\ud800\udc00", "\ud800\udc00"],
42 r.exec("\ud800\udc00\ud801\udc01"));
43 assertEquals(2, r.lastIndex);
44 r.lastIndex = 1;
45 assertEquals(["\ud800\udc00", "\ud800\udc00"],
46 r.exec("\ud800\udc00\ud801\udc01"));
47 assertEquals(2, r.lastIndex);
48 assertEquals(["\ud801\udc01", undefined], r.exec("\ud800\udc00\ud801\udc01"));
49 r.lastIndex = 3;
50 assertEquals(["\ud801\udc01", undefined], r.exec("\ud800\udc00\ud801\udc01"));
51 r.lastIndex = 4;
52 assertNull(r.exec("\ud800\udc00\ud801\udc01"));
53 r.lastIndex = 5;
54 assertNull(r.exec("\ud800\udc00\ud801\udc01"));
55
56 r.lastIndex = 3;
57 assertEquals(["\ud802", undefined], r.exec("\ud800\udc00\ud801\ud802"));
58 r.lastIndex = 4;
59 assertNull(r.exec("\ud800\udc00\ud801\ud802"));
OLDNEW
« src/regexp/jsregexp.cc ('K') | « src/regexp/regexp-ast.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698