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

Unified Diff: src/js/i18n.js

Issue 2350963004: [builtins] Move StringIndexOf to a C++ builtin. (Closed)
Patch Set: Created 4 years, 3 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
Index: src/js/i18n.js
diff --git a/src/js/i18n.js b/src/js/i18n.js
index 5074404bb13cf65750da294d7f8767387565932c..5948ac40e9fd19d7779e05817975d7d253b16041 100644
--- a/src/js/i18n.js
+++ b/src/js/i18n.js
@@ -33,7 +33,6 @@ var OverrideFunction = utils.OverrideFunction;
var patternSymbol = utils.ImportNow("intl_pattern_symbol");
var resolvedSymbol = utils.ImportNow("intl_resolved_symbol");
var SetFunctionName = utils.SetFunctionName;
-var StringIndexOf;
var StringSubstr;
var StringSubstring;
@@ -42,7 +41,6 @@ utils.Import(function(from) {
ArrayPush = from.ArrayPush;
InternalRegExpMatch = from.InternalRegExpMatch;
InternalRegExpReplace = from.InternalRegExpReplace;
- StringIndexOf = from.StringIndexOf;
StringSubstr = from.StringSubstr;
StringSubstring = from.StringSubstring;
});
@@ -829,7 +827,7 @@ function isStructuallyValidLanguageTag(locale) {
}
// Just return if it's a x- form. It's all private.
- if (%_Call(StringIndexOf, locale, 'x-') === 0) {
+ if (%StringIndexOf(locale, 'x-', 0) === 0) {
return true;
}
@@ -2060,7 +2058,7 @@ function LocaleConvertCase(s, locales, isToUpper) {
}
// StringSplit is slower than this.
- var pos = %_Call(StringIndexOf, language, '-');
+ var pos = %StringIndexOf(language, '-', 0);
if (pos != -1) {
language = %_Call(StringSubstring, language, 0, pos);
}
« no previous file with comments | « src/builtins/builtins-string.cc ('k') | src/js/string.js » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698