Index: src/extensions/i18n/locale.js |
diff --git a/src/extensions/i18n/locale.js b/src/extensions/i18n/locale.js |
index e4783277e64a63285251cf9215ea6c66bc86efec..ea95b87192e9f6adb74e36e3a769e45bfd7cdf10 100644 |
--- a/src/extensions/i18n/locale.js |
+++ b/src/extensions/i18n/locale.js |
@@ -34,6 +34,8 @@ |
* Canonicalizes the language tag, or throws in case the tag is invalid. |
*/ |
function canonicalizeLanguageTag(localeID) { |
+ native function NativeJSCanonicalizeLanguageTag(); |
+ |
// null is typeof 'object' so we have to do extra check. |
if (typeof localeID !== 'string' && typeof localeID !== 'object' || |
localeID === null) { |
@@ -50,7 +52,7 @@ function canonicalizeLanguageTag(localeID) { |
// ICU bug filled - http://bugs.icu-project.org/trac/ticket/9265. |
// TODO(cira): check if -u-kn-true-kc-true-kh-true still throws after |
// upgrade to ICU 4.9. |
- var tag = %CanonicalizeLanguageTag(localeString); |
+ var tag = NativeJSCanonicalizeLanguageTag(localeString); |
if (tag === 'invalid-tag') { |
throw new RangeError('Invalid language tag: ' + localeString); |
} |