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

Unified Diff: src/js/i18n.js

Issue 2533983006: Optimize case conversion with icu_case_mapping (Closed)
Patch Set: drop an unused variable: -Wunused-variable Created 4 years 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 | « BUILD.gn ('k') | src/runtime/runtime-i18n.cc » ('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 b051b090bcee57af0da4a558eb4c79fa824ba426..678f5ce490bb6cb8bd739a3c2cfaab6ebca0bd05 100644
--- a/src/js/i18n.js
+++ b/src/js/i18n.js
@@ -2121,27 +2121,16 @@ OverrideFunction(GlobalString.prototype, 'normalize', function() {
);
function ToLowerCaseI18N() {
- if (!IS_UNDEFINED(new.target)) {
- throw %make_type_error(kOrdinaryFunctionCalledAsConstructor);
- }
CHECK_OBJECT_COERCIBLE(this, "String.prototype.toLowerCase");
- var s = TO_STRING(this);
- return %StringToLowerCaseI18N(s);
+ return %StringToLowerCaseI18N(TO_STRING(this));
}
function ToUpperCaseI18N() {
- if (!IS_UNDEFINED(new.target)) {
- throw %make_type_error(kOrdinaryFunctionCalledAsConstructor);
- }
CHECK_OBJECT_COERCIBLE(this, "String.prototype.toUpperCase");
- var s = TO_STRING(this);
- return %StringToUpperCaseI18N(s);
+ return %StringToUpperCaseI18N(TO_STRING(this));
}
function ToLocaleLowerCaseI18N(locales) {
- if (!IS_UNDEFINED(new.target)) {
- throw %make_type_error(kOrdinaryFunctionCalledAsConstructor);
- }
CHECK_OBJECT_COERCIBLE(this, "String.prototype.toLocaleLowerCase");
return LocaleConvertCase(TO_STRING(this), locales, false);
}
@@ -2149,9 +2138,6 @@ function ToLocaleLowerCaseI18N(locales) {
%FunctionSetLength(ToLocaleLowerCaseI18N, 0);
function ToLocaleUpperCaseI18N(locales) {
- if (!IS_UNDEFINED(new.target)) {
- throw %make_type_error(kOrdinaryFunctionCalledAsConstructor);
- }
CHECK_OBJECT_COERCIBLE(this, "String.prototype.toLocaleUpperCase");
return LocaleConvertCase(TO_STRING(this), locales, true);
}
« no previous file with comments | « BUILD.gn ('k') | src/runtime/runtime-i18n.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698