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

Side by Side Diff: src/js/regexp.js

Issue 1819313002: [regexp, intl] Intl should not cause side effects to the RegExp object. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comment Created 4 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/js/i18n.js ('k') | test/intl/regexp-assert.js » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 (function(global, utils) { 5 (function(global, utils) {
6 6
7 'use strict'; 7 'use strict';
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 utils.InstallGetterSetter(GlobalRegExp, "$'", RegExpGetRightContext, NoOpSetter, 1167 utils.InstallGetterSetter(GlobalRegExp, "$'", RegExpGetRightContext, NoOpSetter,
1168 DONT_ENUM | DONT_DELETE); 1168 DONT_ENUM | DONT_DELETE);
1169 1169
1170 for (var i = 1; i < 10; ++i) { 1170 for (var i = 1; i < 10; ++i) {
1171 utils.InstallGetterSetter(GlobalRegExp, '$' + i, RegExpMakeCaptureGetter(i), 1171 utils.InstallGetterSetter(GlobalRegExp, '$' + i, RegExpMakeCaptureGetter(i),
1172 NoOpSetter, DONT_DELETE); 1172 NoOpSetter, DONT_DELETE);
1173 } 1173 }
1174 %ToFastProperties(GlobalRegExp); 1174 %ToFastProperties(GlobalRegExp);
1175 1175
1176 // ------------------------------------------------------------------- 1176 // -------------------------------------------------------------------
1177 // Internal
1178
1179 var InternalRegExpMatchInfo = new InternalPackedArray(2, "", UNDEFINED, 0, 0);
1180
1181 function InternalRegExpMatch(regexp, subject) {
1182 var matchInfo = %_RegExpExec(regexp, subject, 0, InternalRegExpMatchInfo);
1183 if (!IS_NULL(matchInfo)) {
1184 RETURN_NEW_RESULT_FROM_MATCH_INFO(matchInfo, subject);
1185 }
1186 return null;
1187 }
1188
1189 function InternalRegExpReplace(regexp, subject, replacement) {
1190 return %StringReplaceGlobalRegExpWithString(
1191 subject, regexp, replacement, InternalRegExpMatchInfo);
1192 }
1193
1194 // -------------------------------------------------------------------
1177 // Exports 1195 // Exports
1178 1196
1179 utils.Export(function(to) { 1197 utils.Export(function(to) {
1198 to.InternalRegExpMatch = InternalRegExpMatch;
1199 to.InternalRegExpReplace = InternalRegExpReplace;
1200 to.IsRegExp = IsRegExp;
1180 to.RegExpExec = DoRegExpExec; 1201 to.RegExpExec = DoRegExpExec;
1181 to.RegExpInitialize = RegExpInitialize; 1202 to.RegExpInitialize = RegExpInitialize;
1182 to.RegExpLastMatchInfo = RegExpLastMatchInfo; 1203 to.RegExpLastMatchInfo = RegExpLastMatchInfo;
1183 to.RegExpSubclassExecJS = RegExpSubclassExecJS; 1204 to.RegExpSubclassExecJS = RegExpSubclassExecJS;
1184 to.RegExpSubclassMatch = RegExpSubclassMatch; 1205 to.RegExpSubclassMatch = RegExpSubclassMatch;
1185 to.RegExpSubclassReplace = RegExpSubclassReplace; 1206 to.RegExpSubclassReplace = RegExpSubclassReplace;
1186 to.RegExpSubclassSearch = RegExpSubclassSearch; 1207 to.RegExpSubclassSearch = RegExpSubclassSearch;
1187 to.RegExpSubclassSplit = RegExpSubclassSplit; 1208 to.RegExpSubclassSplit = RegExpSubclassSplit;
1188 to.RegExpSubclassTest = RegExpSubclassTest; 1209 to.RegExpSubclassTest = RegExpSubclassTest;
1189 to.RegExpTest = RegExpTest; 1210 to.RegExpTest = RegExpTest;
1190 to.IsRegExp = IsRegExp;
1191 }); 1211 });
1192 1212
1193 }) 1213 })
OLDNEW
« no previous file with comments | « src/js/i18n.js ('k') | test/intl/regexp-assert.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698