diff --git a/src/objects/js-locale.cc b/src/objects/js-locale.cc index e93eb8a804..11eef76f49 100644 --- a/src/objects/js-locale.cc +++ b/src/objects/js-locale.cc @@ -531,7 +531,7 @@ MaybeHandle JSLocale::Collations(Isolate* isolate, icu::Locale icu_locale(*(locale->icu_locale().raw())); return GetKeywordValuesFromLocale( isolate, "collations", "co", icu_locale, Intl::RemoveCollation, true, - false); + true); } MaybeHandle JSLocale::HourCycles(Isolate* isolate, diff --git a/test/intl/assert.js b/test/intl/assert.js index 2a4f630eaf..41d578acf2 100644 --- a/test/intl/assert.js +++ b/test/intl/assert.js @@ -292,3 +292,17 @@ function assertLanguageTag(child, parent) { fail(child, parent, 'language tag comparison'); } } + +function assertArrayEquals(expected, found, name_opt) { + var start = ""; + if (name_opt) { + start = name_opt + " - "; + } + assertEquals(expected.length, found.length, start + "array length"); + if (expected.length === found.length) { + for (var i = 0; i < expected.length; ++i) { + assertEquals(expected[i], found[i], + start + "array element at index " + i); + } + } +} diff --git a/test/intl/locale/locale-collations.js b/test/intl/locale/locale-collations.js index cc8bdbaeb8..96c1998930 100644 --- a/test/intl/locale/locale-collations.js +++ b/test/intl/locale/locale-collations.js @@ -15,5 +15,6 @@ for (var i = 0; i < a_to_z.length; i++) { locale + ".collations [" + locale.collations + "] does not meet 'type: alphanum{3,8}(sep alphanum{3,8})*'"); }); + assertArrayEquals(locale.collations, locale.collations.sort()); } }