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

Side by Side Diff: test/mjsunit/harmony/regexp-dotall-disabled.js

Issue 2780173002: [regexp] Add support for dotAll flag (Closed)
Patch Set: Rebase and test disabled dotall Created 3 years, 8 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
« no previous file with comments | « test/mjsunit/harmony/regexp-dotall.js ('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 2017 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 // This tests that RegExp dotall features are not enabled when
6 // --harmony-regexp-dotall is not passed.
7
8 // Construction does not throw.
9 {
10 assertThrows("/./s", SyntaxError);
11 assertThrows(() => RegExp(".", "s"), SyntaxError);
12 assertThrows(() => new RegExp(".", "s"), SyntaxError);
13 assertThrows(() => new RegExp(".", "wtf"), SyntaxError);
14 }
15
16 // The flags accessors.
17 {
18 let re = /./gimyu;
erikcorry 2017/03/30 13:28:30 You could also check ("dotAll" in re) to see if
jgruber 2017/03/31 09:17:00 Done.
19 assertEquals("gimuy", re.flags);
20 assertTrue(re.global);
21 assertTrue(re.ignoreCase);
22 assertTrue(re.multiline);
23 assertTrue(re.sticky);
24 assertTrue(re.unicode);
25 assertEquals(re.dotAll, undefined);
26
27 let callCount = 0;
28 re.__defineGetter__('dotAll', () => { callCount++; return undefined; });
29 assertEquals("gimuy", re.flags);
30 assertEquals(callCount, 0);
31 }
32
33 // Default '.' behavior.
34 {
35 let re = /^.$/;
36 assertTrue(re.test("a"));
37 assertTrue(re.test("3"));
38 assertTrue(re.test("π"));
39 assertTrue(re.test("\u2027"));
40 assertTrue(re.test("\u0085"));
41 assertTrue(re.test("\v"));
42 assertTrue(re.test("\f"));
43 assertTrue(re.test("\u180E"));
44 assertFalse(re.test("\u{10300}")); // Supplementary plane.
45 assertFalse(re.test("\n"));
46 assertFalse(re.test("\r"));
47 assertFalse(re.test("\u2028"));
48 assertFalse(re.test("\u2029"));
49 }
50
51 // Default '.' behavior (unicode).
52 {
53 let re = /^.$/u;
54 assertTrue(re.test("a"));
55 assertTrue(re.test("3"));
56 assertTrue(re.test("π"));
57 assertTrue(re.test("\u2027"));
58 assertTrue(re.test("\u0085"));
59 assertTrue(re.test("\v"));
60 assertTrue(re.test("\f"));
61 assertTrue(re.test("\u180E"));
62 assertTrue(re.test("\u{10300}")); // Supplementary plane.
63 assertFalse(re.test("\n"));
64 assertFalse(re.test("\r"));
65 assertFalse(re.test("\u2028"));
66 assertFalse(re.test("\u2029"));
67 }
OLDNEW
« no previous file with comments | « test/mjsunit/harmony/regexp-dotall.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698