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

Side by Side Diff: test/mjsunit/es6/regexp-flags.js

Issue 2438283002: Revert of [regexp] Use consistent map checks for fast paths (Closed)
Patch Set: Created 4 years, 1 month 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/runtime/runtime-regexp.cc ('k') | test/test262/test262.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 var r1 = /abc/gi; 5 var r1 = /abc/gi;
6 assertEquals("abc", r1.source); 6 assertEquals("abc", r1.source);
7 assertTrue(r1.global); 7 assertTrue(r1.global);
8 assertTrue(r1.ignoreCase); 8 assertTrue(r1.ignoreCase);
9 assertFalse(r1.multiline); 9 assertFalse(r1.multiline);
10 assertFalse(r1.sticky); 10 assertFalse(r1.sticky);
(...skipping 27 matching lines...) Expand all
38 assertTrue(r3.global); 38 assertTrue(r3.global);
39 assertEquals(1, get_count); 39 assertEquals(1, get_count);
40 assertTrue(r3.ignoreCase); 40 assertTrue(r3.ignoreCase);
41 assertEquals(2, get_count); 41 assertEquals(2, get_count);
42 // Overridden flag getters affects the flags getter. 42 // Overridden flag getters affects the flags getter.
43 assertEquals("gi", r3.flags); 43 assertEquals("gi", r3.flags);
44 assertEquals(4, get_count); 44 assertEquals(4, get_count);
45 // Overridden flag getters affect string.replace 45 // Overridden flag getters affect string.replace
46 // TODO(adamk): Add more tests here once we've switched 46 // TODO(adamk): Add more tests here once we've switched
47 // to use [[OriginalFlags]] in more cases. 47 // to use [[OriginalFlags]] in more cases.
48 // TODO(jgruber): This exact case actually causes an infinite loop in the spec 48 assertEquals(expected, string.replace(r3, "X"));
49 // (@@replace sees global = true while BuiltinExec sees global = false). 49 assertEquals(5, get_count);
50 // Comment the test for now and remove / fix once this has been resolved on
51 // the spec side.
52 //assertEquals(expected, string.replace(r3, "X"));
53 //assertEquals(5, get_count);
54 50
55 51
56 function testName(name) { 52 function testName(name) {
57 // Test for ES2017 RegExp web compatibility semantics 53 // Test for ES2017 RegExp web compatibility semantics
58 // https://github.com/tc39/ecma262/pull/511 54 // https://github.com/tc39/ecma262/pull/511
59 assertEquals(name === "source" ? "(?:)" : undefined, 55 assertEquals(name === "source" ? "(?:)" : undefined,
60 RegExp.prototype[name]); 56 RegExp.prototype[name]);
61 assertEquals( 57 assertEquals(
62 "get " + name, 58 "get " + name,
63 Object.getOwnPropertyDescriptor(RegExp.prototype, name).get.name); 59 Object.getOwnPropertyDescriptor(RegExp.prototype, name).get.name);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 }, 110 },
115 get unicode() { 111 get unicode() {
116 map.u = counter++; 112 map.u = counter++;
117 }, 113 },
118 get sticky() { 114 get sticky() {
119 map.y = counter++; 115 map.y = counter++;
120 } 116 }
121 }; 117 };
122 testGenericFlags(object); 118 testGenericFlags(object);
123 assertEquals({ g: 0, i: 1, m: 2, u: 3, y: 4 }, map); 119 assertEquals({ g: 0, i: 1, m: 2, u: 3, y: 4 }, map);
OLDNEW
« no previous file with comments | « src/runtime/runtime-regexp.cc ('k') | test/test262/test262.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698