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

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

Issue 2841633004: [regexp] Fix passing all flags to RegExp construction (Closed)
Patch Set: 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 | « src/objects.cc ('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
1 // Copyright 2017 the V8 project authors. All rights reserved. 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 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-regexp-dotall 5 // Flags: --harmony-regexp-dotall
6 6
7 function toSlowMode(re) { 7 function toSlowMode(re) {
8 re.exec = (str) => RegExp.prototype.exec.call(re, str); 8 re.exec = (str) => RegExp.prototype.exec.call(re, str);
9 return re; 9 return re;
10 } 10 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 re = /./gimyu; 49 re = /./gimyu;
50 assertEquals("gimuy", re.flags); 50 assertEquals("gimuy", re.flags);
51 assertTrue(re.global); 51 assertTrue(re.global);
52 assertTrue(re.ignoreCase); 52 assertTrue(re.ignoreCase);
53 assertTrue(re.multiline); 53 assertTrue(re.multiline);
54 assertTrue(re.sticky); 54 assertTrue(re.sticky);
55 assertTrue(re.unicode); 55 assertTrue(re.unicode);
56 assertFalse(re.dotAll); 56 assertFalse(re.dotAll);
57 } 57 }
58 58
59 // Different construction variants with all flags.
60 {
61 assertEquals("gimsuy", new RegExp("", "yusmig").flags);
62 assertEquals("gimsuy", new RegExp().compile("", "yusmig").flags);
63 }
64
59 // Default '.' behavior. 65 // Default '.' behavior.
60 { 66 {
61 let re = /^.$/; 67 let re = /^.$/;
62 assertTrue(re.test("a")); 68 assertTrue(re.test("a"));
63 assertTrue(re.test("3")); 69 assertTrue(re.test("3"));
64 assertTrue(re.test("π")); 70 assertTrue(re.test("π"));
65 assertTrue(re.test("\u2027")); 71 assertTrue(re.test("\u2027"));
66 assertTrue(re.test("\u0085")); 72 assertTrue(re.test("\u0085"));
67 assertTrue(re.test("\v")); 73 assertTrue(re.test("\v"));
68 assertTrue(re.test("\f")); 74 assertTrue(re.test("\f"));
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 assertTrue(re.test("\u0085")); 126 assertTrue(re.test("\u0085"));
121 assertTrue(re.test("\v")); 127 assertTrue(re.test("\v"));
122 assertTrue(re.test("\f")); 128 assertTrue(re.test("\f"));
123 assertTrue(re.test("\u180E")); 129 assertTrue(re.test("\u180E"));
124 assertTrue(re.test("\u{10300}")); // Supplementary plane. 130 assertTrue(re.test("\u{10300}")); // Supplementary plane.
125 assertTrue(re.test("\n")); 131 assertTrue(re.test("\n"));
126 assertTrue(re.test("\r")); 132 assertTrue(re.test("\r"));
127 assertTrue(re.test("\u2028")); 133 assertTrue(re.test("\u2028"));
128 assertTrue(re.test("\u2029")); 134 assertTrue(re.test("\u2029"));
129 } 135 }
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698