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

Unified Diff: src/js/i18n.js

Issue 2339123002: [builtins] Move StringLastIndexOf to a builtin. (Closed)
Patch Set: variable renaming 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 7ccefef928e6990f44396a849d0137938728eda8..16abb8002ce9b67c1e4dfce9fee5f3bcbf5dd0ff 100644
--- a/src/js/i18n.js
+++ b/src/js/i18n.js
@@ -35,7 +35,6 @@ var patternSymbol = utils.ImportNow("intl_pattern_symbol");
var resolvedSymbol = utils.ImportNow("intl_resolved_symbol");
var SetFunctionName = utils.SetFunctionName;
var StringIndexOf;
-var StringLastIndexOf;
var StringSubstr;
var StringSubstring;
@@ -45,7 +44,6 @@ utils.Import(function(from) {
InternalRegExpMatch = from.InternalRegExpMatch;
InternalRegExpReplace = from.InternalRegExpReplace;
StringIndexOf = from.StringIndexOf;
- StringLastIndexOf = from.StringLastIndexOf;
StringSubstr = from.StringSubstr;
StringSubstring = from.StringSubstring;
});
@@ -316,7 +314,7 @@ function lookupSupportedLocalesOf(requestedLocales, availableLocales) {
break;
}
// Truncate locale if possible, if not break.
- var pos = %_Call(StringLastIndexOf, locale, '-');
+ var pos = locale.lastIndexOf('-');
Benedikt Meurer 2016/09/14 17:02:32 This is not correct, because this does a lookup of
petermarshall 2016/09/15 12:19:59 Added the runtime function back in as we discussed
if (pos === -1) {
break;
}
@@ -439,7 +437,7 @@ function lookupMatcher(service, requestedLocales) {
return {'locale': locale, 'extension': extension, 'position': i};
}
// Truncate locale if possible.
- var pos = %_Call(StringLastIndexOf, locale, '-');
+ var pos = locale.lastIndexOf('-');
Benedikt Meurer 2016/09/14 17:02:32 Same here.
if (pos === -1) {
break;
}

Powered by Google App Engine
This is Rietveld 408576698