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

Unified Diff: src/js/i18n.js

Issue 2683083003: [bootstrapper] Remove Intl experimental natives files (Closed)
Patch Set: Changes based on review 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
« no previous file with comments | « src/js/datetime-format-to-parts.js ('k') | src/js/icu-case-mapping.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 680f67ad3a082dd7b2e9d18b53f119ad289f4264..a4761f70696a5bf8978936e7ce4a948af89ad95c 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 C++ 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;
});
})
« no previous file with comments | « src/js/datetime-format-to-parts.js ('k') | src/js/icu-case-mapping.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698