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

Unified Diff: src/js/i18n.js

Issue 2621393002: Move lang-code checking for case-mapping to C++ from JS (Closed)
Patch Set: make ConvertToUpper as before Created 3 years, 11 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 | « no previous file | src/runtime/runtime-i18n.cc » ('j') | src/runtime/runtime-i18n.cc » ('J')
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 4ee4733cb90bf3fe27b85536872db7ca076f51af..e037053f3359b6ac8fe914ffd605006c9a764cde 100644
--- a/src/js/i18n.js
+++ b/src/js/i18n.js
@@ -1124,7 +1124,7 @@ AddBoundMethod(GlobalIntlCollator, 'compare', compare, 2, 'collator', false);
* For example \u00DFP (Eszett+P) becomes SSP.
*/
function isWellFormedCurrencyCode(currency) {
- return typeof currency == "string" && currency.length == 3 &&
+ return typeof currency === "string" && currency.length === 3 &&
IS_NULL(%regexp_internal_match(/[^A-Za-z]/, currency));
}
@@ -2029,18 +2029,11 @@ function LocaleConvertCase(s, locales, isToUpper) {
// StringSplit is slower than this.
var pos = %StringIndexOf(language, '-', 0);
- if (pos != -1) {
+ if (pos !== -1) {
language = %_Call(StringSubstring, language, 0, pos);
}
- var CUSTOM_CASE_LANGUAGES = ['az', 'el', 'lt', 'tr'];
- var langIndex = %ArrayIndexOf(CUSTOM_CASE_LANGUAGES, language, 0);
- if (langIndex == -1) {
- // language-independent case conversion.
- return isToUpper ? %StringToUpperCaseI18N(s) : %StringToLowerCaseI18N(s);
- }
- return %StringLocaleConvertCase(s, isToUpper,
- CUSTOM_CASE_LANGUAGES[langIndex]);
+ return %StringLocaleConvertCase(s, isToUpper, language);
}
/**
« no previous file with comments | « no previous file | src/runtime/runtime-i18n.cc » ('j') | src/runtime/runtime-i18n.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698