File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/runtime/util Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -462,8 +462,14 @@ public static String validateAndCanonicalizeLanguageTag(String languageTag) {
462462 builder .setUnicodeLocaleKeyword (key , type );
463463 }
464464
465- // Canonicalize transformed extension
466- String transformedExt = locale .getExtension ('t' );
465+ // Validate and canonicalize the transformed extension.
466+ // We cannot start with locale.getExtension('t') here. locale is
467+ // canonicalized and ICU started (ICU-21406) to remove duplicate
468+ // variants during canonicalization. Unfortunately, we have
469+ // to detect the duplicates because ECMAScript specification
470+ // refuses such locales as invalid explicitly =>
471+ // we start with a non-canonicalized locale here.
472+ String transformedExt = new ULocale (languageTag ).getExtension ('t' );
467473 if (transformedExt != null ) {
468474 builder .setExtension ('t' , normalizeTransformedExtension (transformedExt ));
469475 }
You can’t perform that action at this time.
0 commit comments