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

Unified Diff: src/js/i18n.js

Issue 2683083003: [bootstrapper] Remove Intl experimental natives files (Closed)
Patch Set: Fix a couple minor issues Created 3 years, 10 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 26ebe7e8431a02345348122d8f0c549666f48acc..d58f06a0cc2a6eda60e4894b5b6458c096655e68 100644
--- a/src/js/i18n.js
+++ b/src/js/i18n.js
@@ -2053,6 +2053,7 @@ OverrideFunction(GlobalString.prototype, 'normalize', function() {
}
);
+// TODO(littledan): Rewrite these two functions as direct builtins
function ToLowerCaseI18N() {
CHECK_OBJECT_COERCIBLE(this, "String.prototype.toLowerCase");
return %StringToLowerCaseI18N(TO_STRING(this));
@@ -2077,18 +2078,6 @@ function ToLocaleUpperCaseI18N(locales) {
%FunctionSetLength(ToLocaleUpperCaseI18N, 0);
-%FunctionRemovePrototype(ToLowerCaseI18N);
-%FunctionRemovePrototype(ToUpperCaseI18N);
-%FunctionRemovePrototype(ToLocaleLowerCaseI18N);
-%FunctionRemovePrototype(ToLocaleUpperCaseI18N);
-
-utils.Export(function(to) {
- to.ToLowerCaseI18N = ToLowerCaseI18N;
- to.ToUpperCaseI18N = ToUpperCaseI18N;
- to.ToLocaleLowerCaseI18N = ToLocaleLowerCaseI18N;
- to.ToLocaleUpperCaseI18N = ToLocaleUpperCaseI18N;
-});
-
/**
* Formats a Number object (this) using locale and options values.
@@ -2169,9 +2158,23 @@ OverrideFunction(GlobalDate.prototype, 'toLocaleTimeString', function() {
);
%FunctionRemovePrototype(FormatDateToParts);
+%FunctionRemovePrototype(ToLowerCaseI18N);
+%FunctionRemovePrototype(ToUpperCaseI18N);
+%FunctionRemovePrototype(ToLocaleLowerCaseI18N);
+%FunctionRemovePrototype(ToLocaleUpperCaseI18N);
+
+utils.SetFunctionName(FormatDateToParts, "formatToParts");
+utils.SetFunctionName(ToLowerCaseI18N, "toLowerCase");
+utils.SetFunctionName(ToUpperCaseI18N, "toUpperCase");
+utils.SetFunctionName(ToLocaleLowerCaseI18N, "toLocaleLowerCase");
+utils.SetFunctionName(ToLocaleUpperCaseI18N, "toLocaleUpperCase");
utils.Export(function(to) {
to.FormatDateToParts = FormatDateToParts;
+ to.ToLowerCaseI18N = ToLowerCaseI18N;
+ to.ToUpperCaseI18N = ToUpperCaseI18N;
+ to.ToLocaleLowerCaseI18N = ToLocaleLowerCaseI18N;
+ to.ToLocaleUpperCaseI18N = ToLocaleUpperCaseI18N;
});
})

Powered by Google App Engine
This is Rietveld 408576698