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

Unified Diff: src/js/i18n.js

Issue 2023753002: Revert of [builtins] Also migrate String.prototype.toLowerCase/toUpperCase to C++. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@StringTrim
Patch Set: Created 4 years, 7 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/contexts.h ('k') | src/js/string.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/i18n.js
diff --git a/src/js/i18n.js b/src/js/i18n.js
index 7eac76fe1b86b67a56c33661b363e3328c02d53b..233f6c5c6f96514568dd6a5553f57fdf67556a7f 100644
--- a/src/js/i18n.js
+++ b/src/js/i18n.js
@@ -46,8 +46,6 @@
var StringSplit;
var StringSubstr;
var StringSubstring;
-var StringToLowerCase = GlobalString.prototype.toLowerCase;
-var StringToUpperCase = GlobalString.prototype.toUpperCase;
utils.Import(function(from) {
ArrayIndexOf = from.ArrayIndexOf;
@@ -695,8 +693,8 @@
* Returns titlecased word, aMeRricA -> America.
*/
function toTitleCaseWord(word) {
- return %_Call(StringToUpperCase, %_Call(StringSubstr, word, 0, 1)) +
- %_Call(StringToLowerCase, %_Call(StringSubstr, word, 1));
+ return %StringToUpperCase(%_Call(StringSubstr, word, 0, 1)) +
+ %StringToLowerCase(%_Call(StringSubstr, word, 1));
}
/**
@@ -717,7 +715,7 @@
var parts = %_Call(StringSplit, match[2], separator);
for (var i = 1; i < parts.length; i++) {
var part = parts[i]
- var lowercasedPart = %_Call(StringToLowerCase, part);
+ var lowercasedPart = %StringToLowerCase(part);
result = result + separator +
((lowercasedPart !== 'es' &&
lowercasedPart !== 'of' && lowercasedPart !== 'au') ?
@@ -1157,8 +1155,7 @@
var currencyDisplay = getOption(
'currencyDisplay', 'string', ['code', 'symbol', 'name'], 'symbol');
if (internalOptions.style === 'currency') {
- defineWEProperty(internalOptions, 'currency',
- %_Call(StringToUpperCase, currency));
+ defineWEProperty(internalOptions, 'currency', %StringToUpperCase(currency));
defineWEProperty(internalOptions, 'currencyDisplay', currencyDisplay);
}
@@ -1792,7 +1789,7 @@
}
// Special case handling (UTC, GMT).
- var upperID = %_Call(StringToUpperCase, tzID);
+ var upperID = %StringToUpperCase(tzID);
if (upperID === 'UTC' || upperID === 'GMT' ||
upperID === 'ETC/UTC' || upperID === 'ETC/GMT') {
return 'UTC';
« no previous file with comments | « src/contexts.h ('k') | src/js/string.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698