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

Unified Diff: src/runtime/runtime-i18n.cc

Issue 2239523002: Expose getCanonicalLocales() for Intl object (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: check if returned object is an array Created 4 years, 4 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/i18n.js ('k') | test/intl/general/getCanonicalLocales.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-i18n.cc
diff --git a/src/runtime/runtime-i18n.cc b/src/runtime/runtime-i18n.cc
index fb6fbe76070ac667d73b72ee75e515fe9913e1f1..8b9d92ec006eb570bf14755087d97987b8d04e2d 100644
--- a/src/runtime/runtime-i18n.cc
+++ b/src/runtime/runtime-i18n.cc
@@ -63,6 +63,7 @@ const UChar* GetUCharBufferFromFlat(const String::FlatContent& flat,
} // namespace
+// ECMA 402 6.2.3
RUNTIME_FUNCTION(Runtime_CanonicalizeLanguageTag) {
HandleScope scope(isolate);
Factory* factory = isolate->factory();
@@ -73,6 +74,8 @@ RUNTIME_FUNCTION(Runtime_CanonicalizeLanguageTag) {
v8::String::Utf8Value locale_id(v8::Utils::ToLocal(locale_id_str));
// Return value which denotes invalid language tag.
+ // TODO(jshin): Can uloc_{for,to}TanguageTag fail even for structually valid
+ // language tags? If not, just add CHECK instead of returning 'invalid-tag'.
const char* const kInvalidTag = "invalid-tag";
UErrorCode error = U_ZERO_ERROR;
« no previous file with comments | « src/js/i18n.js ('k') | test/intl/general/getCanonicalLocales.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698