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

Unified Diff: src/js/string.js

Issue 2409513003: [regexp] Port remaining JS functions in regexp.js (Closed)
Patch Set: Rebaseline bytecode expectations Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/js/regexp.js ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/string.js
diff --git a/src/js/string.js b/src/js/string.js
index f1a2c6326154053ed5b422406660247ee528df92..5d87ffce9ec9bd937b8eaad62f99f7029d34dfc4 100644
--- a/src/js/string.js
+++ b/src/js/string.js
@@ -13,10 +13,8 @@ var ArrayJoin;
var GetSubstitution;
var GlobalRegExp = global.RegExp;
var GlobalString = global.String;
-var IsRegExp;
var MaxSimple;
var MinSimple;
-var RegExpInitialize;
var matchSymbol = utils.ImportNow("match_symbol");
var replaceSymbol = utils.ImportNow("replace_symbol");
var searchSymbol = utils.ImportNow("search_symbol");
@@ -25,10 +23,8 @@ var splitSymbol = utils.ImportNow("split_symbol");
utils.Import(function(from) {
ArrayJoin = from.ArrayJoin;
GetSubstitution = from.GetSubstitution;
- IsRegExp = from.IsRegExp;
MaxSimple = from.MaxSimple;
MinSimple = from.MinSimple;
- RegExpInitialize = from.RegExpInitialize;
});
//-------------------------------------------------------------------
@@ -60,8 +56,7 @@ function StringMatchJS(pattern) {
var subject = TO_STRING(this);
// Equivalent to RegExpCreate (ES#sec-regexpcreate)
- var regexp = %_NewObject(GlobalRegExp, GlobalRegExp);
- RegExpInitialize(regexp, pattern);
+ var regexp = %RegExpCreate(pattern);
return regexp[matchSymbol](subject);
}
@@ -143,8 +138,7 @@ function StringSearch(pattern) {
var subject = TO_STRING(this);
// Equivalent to RegExpCreate (ES#sec-regexpcreate)
- var regexp = %_NewObject(GlobalRegExp, GlobalRegExp);
- RegExpInitialize(regexp, pattern);
+ var regexp = %RegExpCreate(pattern);
return %_Call(regexp[searchSymbol], regexp, subject);
}
« no previous file with comments | « src/js/regexp.js ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698