WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-216224-20200910022211.patch (text/plain), 33.01 KB, created by
Yusuke Suzuki
on 2020-09-10 02:22:12 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2020-09-10 02:22:12 PDT
Size:
33.01 KB
patch
obsolete
>Subversion Revision: 266815 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 46dfe08b7540377485956755f32d7832f3d8b8e7..16536987e0c63ccdee08751904c2a9170b83a336 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,28 @@ >+2020-09-10 Yusuke Suzuki <ysuzuki@apple.com> >+ >+ [JSC] Canonicalize "true" unicode extension type value to "" >+ https://bugs.webkit.org/show_bug.cgi?id=216224 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Unicode Technical Standard #35 defines that unicode extension type's "true" should be converged to "". >+ This patch implements it by extracting unicode extension subtags and replacing "true" to "". >+ >+ * runtime/IntlLocale.cpp: >+ (JSC::LocaleIDBuilder::toCanonical): >+ * runtime/IntlLocalePrototype.cpp: >+ (JSC::IntlLocalePrototypeGetterCaseFirst): >+ * runtime/IntlObject.cpp: >+ (JSC::unicodeExtensionSubTags): >+ (JSC::canonicalizeUnicodeExtensionsAfterICULocaleCanonicalization): >+ (JSC::languageTagForLocaleID): >+ (JSC::resolveLocale): >+ * runtime/IntlObject.h: >+ * runtime/IntlObjectInlines.h: >+ (JSC::computeTwoCharacters16Code): >+ * runtime/StringPrototype.cpp: >+ (JSC::computeTwoCharacters16Code): Deleted. >+ > 2020-09-09 Saam Barati <sbarati@apple.com> > > OutOfBoundsSaneChain operations should use their own heap locations >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index fa7e53a299ebf489e76c3dd028af7940b38c1d77..d9993dba35d6b396e4e91792f6afedc69ca9e1d5 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,14 @@ >+2020-09-10 Yusuke Suzuki <ysuzuki@apple.com> >+ >+ [JSC] Canonicalize "true" unicode extension type value to "" >+ https://bugs.webkit.org/show_bug.cgi?id=216224 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * wtf/text/StringView.h: >+ (WTF::StringView::characterAt const): >+ (WTF::StringView::operator[] const): >+ > 2020-09-09 Ryosuke Niwa <rniwa@webkit.org> > > Simplify OptionSet::set >diff --git a/Source/JavaScriptCore/runtime/IntlLocale.cpp b/Source/JavaScriptCore/runtime/IntlLocale.cpp >index 4aa2a50baf65fa89189a700933442d773c86734c..521974b11e0bf8d5eb8f25b2bd561237fea2102e 100644 >--- a/Source/JavaScriptCore/runtime/IntlLocale.cpp >+++ b/Source/JavaScriptCore/runtime/IntlLocale.cpp >@@ -91,11 +91,12 @@ CString LocaleIDBuilder::toCanonical() > { > ASSERT(m_buffer.size()); > >- Vector<char, 32> result; >- auto status = callBufferProducingFunction(uloc_canonicalize, m_buffer.data(), result); >+ Vector<char, 32> buffer; >+ auto status = callBufferProducingFunction(uloc_canonicalize, m_buffer.data(), buffer); > if (U_FAILURE(status)) > return CString(); > >+ auto result = canonicalizeUnicodeExtensionsAfterICULocaleCanonicalization(WTFMove(buffer)); > return CString(result.data(), result.size()); > } > >diff --git a/Source/JavaScriptCore/runtime/IntlLocalePrototype.cpp b/Source/JavaScriptCore/runtime/IntlLocalePrototype.cpp >index 4a8b84398eb085b16604fe4149be156886dd798d..f4446b4512aacba46f0fbae41fa6ef4afcd7dc0c 100644 >--- a/Source/JavaScriptCore/runtime/IntlLocalePrototype.cpp >+++ b/Source/JavaScriptCore/runtime/IntlLocalePrototype.cpp >@@ -180,7 +180,12 @@ EncodedJSValue JSC_HOST_CALL IntlLocalePrototypeGetterCaseFirst(JSGlobalObject* > return throwVMTypeError(globalObject, scope, "Intl.Locale.prototype.caseFirst called on value that's not an object initialized as a Locale"_s); > > const String& caseFirst = locale->caseFirst(); >- RELEASE_AND_RETURN(scope, JSValue::encode(caseFirst.isEmpty() ? jsUndefined() : jsString(vm, caseFirst))); >+ if (caseFirst.isEmpty()) >+ return JSValue::encode(jsUndefined()); >+ // If caseFirst is "true", then we should return "" since language tag canonicalization makes it "". >+ if (caseFirst == "true"_s) >+ return JSValue::encode(jsEmptyString(vm)); >+ return JSValue::encode(jsString(vm, caseFirst)); > } > > // https://tc39.es/ecma402/#sec-Intl.Locale.prototype.collation >diff --git a/Source/JavaScriptCore/runtime/IntlObject.cpp b/Source/JavaScriptCore/runtime/IntlObject.cpp >index 301bdd13eb6703a398dde64d4c4385a4110e1f04..8cec456a3038b3609ee6a085d9ff470341ba7381 100644 >--- a/Source/JavaScriptCore/runtime/IntlObject.cpp >+++ b/Source/JavaScriptCore/runtime/IntlObject.cpp >@@ -190,6 +190,47 @@ Structure* IntlObject::createStructure(VM& vm, JSGlobalObject* globalObject, JSV > return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); > } > >+static Vector<StringView> unicodeExtensionSubTags(StringView extension) >+{ >+ // UnicodeExtensionSubtags (extension) >+ // https://tc39.github.io/ecma402/#sec-unicodeextensionsubtags >+ >+ auto extensionLength = extension.length(); >+ if (extensionLength < 3) >+ return { }; >+ >+ Vector<StringView> subtags; >+ size_t subtagStart = 3; // Skip initial -u-. >+ size_t valueStart = 3; >+ bool isLeading = true; >+ for (size_t index = subtagStart; index < extensionLength; ++index) { >+ if (extension[index] == '-') { >+ if (index - subtagStart == 2) { >+ // Tag is a key, first append prior key's value if there is one. >+ if (subtagStart - valueStart > 1) >+ subtags.append(extension.substring(valueStart, subtagStart - valueStart - 1)); >+ subtags.append(extension.substring(subtagStart, index - subtagStart)); >+ valueStart = index + 1; >+ isLeading = false; >+ } else if (isLeading) { >+ // Leading subtags before first key. >+ subtags.append(extension.substring(subtagStart, index - subtagStart)); >+ valueStart = index + 1; >+ } >+ subtagStart = index + 1; >+ } >+ } >+ if (extensionLength - subtagStart == 2) { >+ // Trailing an extension key, first append prior key's value if there is one. >+ if (subtagStart - valueStart > 1) >+ subtags.append(extension.substring(valueStart, subtagStart - valueStart - 1)); >+ valueStart = subtagStart; >+ } >+ // Append final key's value. >+ subtags.append(extension.substring(valueStart, extensionLength - valueStart)); >+ return subtags; >+} >+ > Vector<char, 32> localeIDBufferForLanguageTag(const CString& tag) > { > if (!tag.length()) >@@ -212,6 +253,91 @@ Vector<char, 32> localeIDBufferForLanguageTag(const CString& tag) > return buffer; > } > >+Vector<char, 32> canonicalizeUnicodeExtensionsAfterICULocaleCanonicalization(Vector<char, 32>&& buffer) >+{ >+ StringView locale(buffer.data(), buffer.size()); >+ ASSERT(locale.is8Bit()); >+ size_t extensionIndex = locale.find("-u-"); >+ if (extensionIndex == notFound) >+ return WTFMove(buffer); >+ >+ // Since ICU's canonicalization is incomplete, we need to perform some of canonicalization here. >+ size_t extensionLength = locale.length() - extensionIndex; >+ size_t end = extensionIndex + 3; >+ while (end < locale.length()) { >+ end = locale.find('-', end); >+ if (end == notFound) >+ break; >+ // Found another singleton. >+ if (end + 2 < locale.length() && locale[end + 2] == '-') { >+ extensionLength = end - extensionIndex; >+ break; >+ } >+ end++; >+ } >+ >+ auto shouldInclude = [](StringView key, StringView value) { >+ ASSERT(key.length() == 2); >+ // If value is "true", we should not include value. >+ if (value == "true"_s) >+ return false; >+ if (value != "yes"_s) >+ return true; >+ // In the following unicode extension keys, "yes" is alias of "true". So we should not include value. >+ // See CLDR key name="kb" entry for example. >+ switch (computeTwoCharacters16Code(key)) { >+ case computeTwoCharacters16Code("kb"_s): >+ case computeTwoCharacters16Code("kc"_s): >+ case computeTwoCharacters16Code("kh"_s): >+ case computeTwoCharacters16Code("kk"_s): >+ case computeTwoCharacters16Code("kn"_s): >+ return false; >+ default: >+ return true; >+ } >+ }; >+ >+ Vector<char, 32> result; >+ result.append(buffer.data(), extensionIndex + 2); // "-u" is included. >+ StringView extension = locale.substring(extensionIndex, extensionLength); >+ ASSERT(extension.is8Bit()); >+ auto subtags = unicodeExtensionSubTags(extension); >+ for (unsigned index = 0; index < subtags.size();) { >+ auto subtag = subtags[index]; >+ ASSERT(subtag.is8Bit()); >+ result.append('-'); >+ result.append(subtag.characters8(), subtag.length()); >+ >+ if (subtag.length() != 2) { >+ ++index; >+ continue; >+ } >+ ASSERT(subtag.length() == 2); >+ >+ // This is unicode extension key. >+ unsigned valueIndexStart = index + 1; >+ unsigned valueIndexEnd = valueIndexStart; >+ for (; valueIndexEnd < subtags.size(); ++valueIndexEnd) { >+ if (subtags[valueIndexEnd].length() == 2) >+ break; >+ } >+ // [valueIndexStart, valueIndexEnd) is value of this unicode extension. If there is no value, valueIndexStart == valueIndexEnd. >+ >+ for (unsigned valueIndex = valueIndexStart; valueIndex < valueIndexEnd; ++valueIndex) { >+ if (shouldInclude(subtag, subtags[valueIndex])) { >+ result.append('-'); >+ result.append(subtags[valueIndex].characters8(), subtags[valueIndex].length()); >+ } >+ } >+ index = valueIndexEnd; >+ } >+ >+ unsigned remainingStart = extensionIndex + extensionLength; >+ unsigned remainingLength = buffer.size() - remainingStart; >+ result.append(buffer.data() + remainingStart, remainingLength); >+ return result; >+} >+ > String languageTagForLocaleID(const char* localeID, bool isImmortal) > { > Vector<char, 32> buffer; >@@ -219,12 +345,15 @@ String languageTagForLocaleID(const char* localeID, bool isImmortal) > if (U_FAILURE(status)) > return String(); > >- // This is used to store into static variables that may be shared across JSC execution threads. >- // This must be immortal to make concurrent ref/deref safe. >- if (isImmortal) >- return StringImpl::createStaticStringImpl(buffer.data(), buffer.size()); >+ auto createResult = [&](Vector<char, 32>&& buffer) -> String { >+ // This is used to store into static variables that may be shared across JSC execution threads. >+ // This must be immortal to make concurrent ref/deref safe. >+ if (isImmortal) >+ return StringImpl::createStaticStringImpl(buffer.data(), buffer.size()); >+ return String(buffer.data(), buffer.size()); >+ }; > >- return String(buffer.data(), buffer.size()); >+ return createResult(canonicalizeUnicodeExtensionsAfterICULocaleCanonicalization(WTFMove(buffer))); > } > > // Ensure we have xx-ZZ whenever we have xx-Yyyy-ZZ. >@@ -694,45 +823,6 @@ static MatcherResult bestFitMatcher(JSGlobalObject* globalObject, const HashSet< > return lookupMatcher(globalObject, availableLocales, requestedLocales); > } > >-static void unicodeExtensionSubTags(const String& extension, Vector<String>& subtags) >-{ >- // UnicodeExtensionSubtags (extension) >- // https://tc39.github.io/ecma402/#sec-unicodeextensionsubtags >- >- auto extensionLength = extension.length(); >- if (extensionLength < 3) >- return; >- >- size_t subtagStart = 3; // Skip initial -u-. >- size_t valueStart = 3; >- bool isLeading = true; >- for (size_t index = subtagStart; index < extensionLength; ++index) { >- if (extension[index] == '-') { >- if (index - subtagStart == 2) { >- // Tag is a key, first append prior key's value if there is one. >- if (subtagStart - valueStart > 1) >- subtags.append(extension.substring(valueStart, subtagStart - valueStart - 1)); >- subtags.append(extension.substring(subtagStart, index - subtagStart)); >- valueStart = index + 1; >- isLeading = false; >- } else if (isLeading) { >- // Leading subtags before first key. >- subtags.append(extension.substring(subtagStart, index - subtagStart)); >- valueStart = index + 1; >- } >- subtagStart = index + 1; >- } >- } >- if (extensionLength - subtagStart == 2) { >- // Trailing an extension key, first append prior key's value if there is one. >- if (subtagStart - valueStart > 1) >- subtags.append(extension.substring(valueStart, subtagStart - valueStart - 1)); >- valueStart = subtagStart; >- } >- // Append final key's value. >- subtags.append(extension.substring(valueStart, extensionLength - valueStart)); >-} >- > constexpr ASCIILiteral relevantExtensionKeyString(RelevantExtensionKey key) > { > switch (key) { >@@ -756,9 +846,9 @@ ResolvedLocale resolveLocale(JSGlobalObject* globalObject, const HashSet<String> > > String foundLocale = matcherResult.locale; > >- Vector<String> extensionSubtags; >+ Vector<StringView> extensionSubtags; > if (!matcherResult.extension.isNull()) >- unicodeExtensionSubTags(matcherResult.extension, extensionSubtags); >+ extensionSubtags = unicodeExtensionSubTags(matcherResult.extension); > > ResolvedLocale resolved; > resolved.dataLocale = foundLocale; >@@ -776,9 +866,10 @@ ResolvedLocale resolveLocale(JSGlobalObject* globalObject, const HashSet<String> > size_t keyPos = extensionSubtags.find(keyString); > if (keyPos != notFound) { > if (keyPos + 1 < extensionSubtags.size() && extensionSubtags[keyPos + 1].length() > 2) { >- const String& requestedValue = extensionSubtags[keyPos + 1]; >- if (keyLocaleData.contains(requestedValue)) { >- value = requestedValue; >+ StringView requestedValue = extensionSubtags[keyPos + 1]; >+ auto dataPos = keyLocaleData.find(requestedValue); >+ if (dataPos != notFound) { >+ value = keyLocaleData[dataPos]; > supportedExtensionAddition = makeString('-', keyString, '-', value); > } > } else if (keyLocaleData.contains("true"_s)) { >diff --git a/Source/JavaScriptCore/runtime/IntlObject.h b/Source/JavaScriptCore/runtime/IntlObject.h >index eb190d76e6345ed36bbb35cb65f0150289d301a6..a958209636cd95696cd89a0a12acb29cce4a4106 100644 >--- a/Source/JavaScriptCore/runtime/IntlObject.h >+++ b/Source/JavaScriptCore/runtime/IntlObject.h >@@ -113,6 +113,8 @@ String bestAvailableLocale(const HashSet<String>& availableLocales, const String > template<typename Predicate> String bestAvailableLocale(const String& requestedLocale, Predicate); > Vector<String> numberingSystemsForLocale(const String& locale); > >+Vector<char, 32> canonicalizeUnicodeExtensionsAfterICULocaleCanonicalization(Vector<char, 32>&&); >+ > bool isUnicodeLocaleIdentifierType(StringView); > > bool isUnicodeLanguageSubtag(StringView); >diff --git a/Source/JavaScriptCore/runtime/IntlObjectInlines.h b/Source/JavaScriptCore/runtime/IntlObjectInlines.h >index e8e3f910b08f14cf93d97f6162d2cbb4a070d69e..48e340d22183d56ab1b61d4631fe1afff93bb1c8 100644 >--- a/Source/JavaScriptCore/runtime/IntlObjectInlines.h >+++ b/Source/JavaScriptCore/runtime/IntlObjectInlines.h >@@ -34,6 +34,12 @@ > > namespace JSC { > >+template<typename StringType> >+static constexpr uint32_t computeTwoCharacters16Code(const StringType& string) >+{ >+ return static_cast<uint16_t>(string.characterAt(0)) | (static_cast<uint32_t>(static_cast<uint16_t>(string.characterAt(1))) << 16); >+} >+ > template<typename Predicate> String bestAvailableLocale(const String& locale, Predicate predicate) > { > // BestAvailableLocale (availableLocales, locale) >diff --git a/Source/JavaScriptCore/runtime/StringPrototype.cpp b/Source/JavaScriptCore/runtime/StringPrototype.cpp >index 1ef2cb315a609d854392b2453f5c46c256c8427d..1a2dc5f58a292242602af0331c4db143a3863b79 100644 >--- a/Source/JavaScriptCore/runtime/StringPrototype.cpp >+++ b/Source/JavaScriptCore/runtime/StringPrototype.cpp >@@ -1541,12 +1541,6 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncLocaleCompare(JSGlobalObject* global > RELEASE_AND_RETURN(scope, JSValue::encode(collator->compareStrings(globalObject, string, that))); > } > >-template<typename StringType> >-static constexpr uint32_t computeTwoCharacters16Code(const StringType& string) >-{ >- return static_cast<uint16_t>(string.characterAt(0)) | (static_cast<uint32_t>(static_cast<uint16_t>(string.characterAt(1))) << 16); >-} >- > enum class CaseConversionMode { > Upper, > Lower, >diff --git a/Source/WTF/wtf/text/StringView.h b/Source/WTF/wtf/text/StringView.h >index 920fbfb7d1f3d09456ff4193344b201214a0e01e..84024ee74ce9515a31271ff2db98201f421bd608 100644 >--- a/Source/WTF/wtf/text/StringView.h >+++ b/Source/WTF/wtf/text/StringView.h >@@ -79,6 +79,7 @@ class StringView final { > explicit operator bool() const; > bool isNull() const; > >+ UChar characterAt(unsigned index) const; > UChar operator[](unsigned index) const; > > class CodeUnits; >@@ -499,7 +500,7 @@ inline StringView StringView::substring(unsigned start, unsigned length) const > return result; > } > >-inline UChar StringView::operator[](unsigned index) const >+inline UChar StringView::characterAt(unsigned index) const > { > ASSERT(index < length()); > if (is8Bit()) >@@ -507,6 +508,11 @@ inline UChar StringView::operator[](unsigned index) const > return characters16()[index]; > } > >+inline UChar StringView::operator[](unsigned index) const >+{ >+ return characterAt(index); >+} >+ > inline bool StringView::contains(UChar character) const > { > return find(character) != notFound; >diff --git a/JSTests/ChangeLog b/JSTests/ChangeLog >index 6f7b2c59aeb4ff3575e6ba357c079289abc87506..f6159d0b2b34315ff5568f840a558e62e72d05e1 100644 >--- a/JSTests/ChangeLog >+++ b/JSTests/ChangeLog >@@ -1,3 +1,23 @@ >+2020-09-10 Yusuke Suzuki <ysuzuki@apple.com> >+ >+ [JSC] Canonicalize "true" unicode extension type value to "" >+ https://bugs.webkit.org/show_bug.cgi?id=216224 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * stress/intl-collator-co-extension.js: >+ (explicitTrueBeforeICU67): Deleted. >+ * stress/intl-collator.js: >+ (shouldBe.testCollator.Intl.Collator): >+ (explicitTrueBeforeICU67): Deleted. >+ * stress/intl-datetimeformat.js: >+ * stress/intl-locale.js: >+ * stress/intl-numberformat.js: >+ * stress/intl-object.js: >+ * stress/intl-pluralrules.js: >+ * stress/intl-relativetimeformat.js: >+ * test262/expectations.yaml: >+ > 2020-09-09 Saam Barati <sbarati@apple.com> > > OutOfBoundsSaneChain operations should use their own heap locations >diff --git a/JSTests/stress/intl-collator-co-extension.js b/JSTests/stress/intl-collator-co-extension.js >index c1487840b49ae9becfa3e4dbfe5718e5a20f647e..52121b3ca7525a6d135f98fd655ba75888a35d93 100644 >--- a/JSTests/stress/intl-collator-co-extension.js >+++ b/JSTests/stress/intl-collator-co-extension.js >@@ -15,10 +15,6 @@ function shouldBeArray(actual, expected) { > } > } > >-function explicitTrueBeforeICU67() { >- return $vm.icuVersion() < 67 ? '-true' : ''; >-} >- > shouldBeArray(["AE", "\u00C4"].sort(new Intl.Collator("de", {usage: "sort"}).compare), ["\u00C4", "AE"]); > shouldBeArray(["AE", "\u00C4"].sort(new Intl.Collator("de", {usage: "search"}).compare), ["AE", "\u00C4"]); > shouldBe(new Intl.Collator("de", {usage: "sort"}).resolvedOptions().locale, "de"); >@@ -40,8 +36,8 @@ function explicitTrueBeforeICU67() { > > shouldBe(new Intl.Collator("en-US-x-twain", {usage: "search"}).resolvedOptions().locale, "en-US"); > >-shouldBe(new Intl.Collator("de-u-kn", {usage: "sort"}).resolvedOptions().locale, "de-u-kn" + explicitTrueBeforeICU67()); >-shouldBe(new Intl.Collator("de-u-kn", {usage: "search"}).resolvedOptions().locale, "de-u-kn" + explicitTrueBeforeICU67()); >+shouldBe(new Intl.Collator("de-u-kn", {usage: "sort"}).resolvedOptions().locale, "de-u-kn"); >+shouldBe(new Intl.Collator("de-u-kn", {usage: "search"}).resolvedOptions().locale, "de-u-kn"); > > shouldBeArray(["a", "ae", "ä", "æ"].sort(new Intl.Collator("de-u-co-phonebk").compare), ["a", "ae", "ä", "æ"]); > shouldBeArray(["a", "ae", "ä", "æ"].sort(new Intl.Collator("de").compare), ["a", "ä", "ae", "æ"]); >diff --git a/JSTests/stress/intl-collator.js b/JSTests/stress/intl-collator.js >index a2e405014f555502856e21d0fbd50c4af96ac048..b0c12871c2d858d125ef293903ce47bafb327700 100644 >--- a/JSTests/stress/intl-collator.js >+++ b/JSTests/stress/intl-collator.js >@@ -19,10 +19,6 @@ function shouldThrow(func, errorType) { > throw new Error(`Expected ${errorType.name}!`); > } > >-function explicitTrueBeforeICU67() { >- return $vm.icuVersion() < 67 ? '-true' : ''; >-} >- > // 10.1 The Intl.Collator Constructor > > // The Intl.Collator constructor is a standard built-in property of the Intl object. >@@ -85,8 +81,8 @@ function testCollator(collator, possibleOptionDifferences) { > shouldBe(testCollator(Intl.Collator('de-u-co-phonebk'), [{locale: 'de-u-co-phonebk', collation: 'phonebk'}, {locale: 'de'}]), true); > > // The 'kn' key is processed correctly. >-shouldBe(testCollator(Intl.Collator('en-u-kn'), [{locale: 'en-u-kn' + explicitTrueBeforeICU67(), numeric: true}]), true); >-shouldBe(testCollator(Intl.Collator('en-u-kn-true'), [{locale: 'en-u-kn' + explicitTrueBeforeICU67(), numeric: true}]), true); >+shouldBe(testCollator(Intl.Collator('en-u-kn'), [{locale: 'en-u-kn', numeric: true}]), true); >+shouldBe(testCollator(Intl.Collator('en-u-kn-true'), [{locale: 'en-u-kn', numeric: true}]), true); > shouldBe(testCollator(Intl.Collator('en-u-kn-false'), [{locale: 'en-u-kn-false', numeric: false}]), true); > shouldBe(testCollator(Intl.Collator('en-u-kn-abcd'), [{locale: 'en'}]), true); > >@@ -150,7 +146,7 @@ function testCollator(collator, possibleOptionDifferences) { > // Options override the language tag. > shouldBe(testCollator(Intl.Collator('en-u-kn-true', {numeric: false}), [{locale: 'en', numeric: false}]), true); > shouldBe(testCollator(Intl.Collator('en-u-kn-false', {numeric: true}), [{locale: 'en', numeric: true}]), true); >-shouldBe(testCollator(Intl.Collator('en-u-kn-true', {numeric: true}), [{locale: 'en-u-kn' + explicitTrueBeforeICU67(), numeric: true}]), true); >+shouldBe(testCollator(Intl.Collator('en-u-kn-true', {numeric: true}), [{locale: 'en-u-kn', numeric: true}]), true); > shouldBe(testCollator(Intl.Collator('en-u-kn-false', {numeric: false}), [{locale: 'en-u-kn-false', numeric: false}]), true); > > // Options and extension keys are processed correctly. >@@ -192,7 +188,7 @@ function testCollator(collator, possibleOptionDifferences) { > JSON.stringify(Intl.Collator.supportedLocalesOf('En-laTn-us-variAnt-fOObar-1abc-U-kn-tRue-A-aa-aaa-x-RESERVED')), > $vm.icuVersion() >= 67 > ? '["en-Latn-US-1abc-foobar-variant-a-aa-aaa-u-kn-x-reserved"]' >- : '["en-Latn-US-variant-foobar-1abc-a-aa-aaa-u-kn-true-x-reserved"]' >+ : '["en-Latn-US-variant-foobar-1abc-a-aa-aaa-u-kn-x-reserved"]' > ); > // Throws on problems with length, get, or toString. > shouldThrow(() => Intl.Collator.supportedLocalesOf(Object.create(null, { length: { get() { throw Error() } } })), Error); >diff --git a/JSTests/stress/intl-datetimeformat.js b/JSTests/stress/intl-datetimeformat.js >index bc14e1998188aeb41510dedda95dae13c56bc3ae..061f797720261989a609de0a9d7e2aae216b5a41 100644 >--- a/JSTests/stress/intl-datetimeformat.js >+++ b/JSTests/stress/intl-datetimeformat.js >@@ -84,7 +84,7 @@ function shouldThrow(func, errorType) { > JSON.stringify(Intl.DateTimeFormat.supportedLocalesOf('En-laTn-us-variAnt-fOObar-1abc-U-kn-tRue-A-aa-aaa-x-RESERVED')), > $vm.icuVersion() >= 67 > ? '["en-Latn-US-1abc-foobar-variant-a-aa-aaa-u-kn-x-reserved"]' >- : '["en-Latn-US-variant-foobar-1abc-a-aa-aaa-u-kn-true-x-reserved"]' >+ : '["en-Latn-US-variant-foobar-1abc-a-aa-aaa-u-kn-x-reserved"]' > ); > // Throws on problems with length, get, or toString. > shouldThrow(() => Intl.DateTimeFormat.supportedLocalesOf(Object.create(null, { length: { get() { throw new Error(); } } })), Error); >diff --git a/JSTests/stress/intl-locale.js b/JSTests/stress/intl-locale.js >index 04e525979fdc0c4844d1330be6d54d3d35c0c51d..def108c4084575b942db1462364edb43d6badd90 100644 >--- a/JSTests/stress/intl-locale.js >+++ b/JSTests/stress/intl-locale.js >@@ -150,7 +150,7 @@ function shouldThrow(func, errorType) { > new Intl.Locale('En-laTn-us-variAnt-fOObar-1abc-U-kn-tRue-A-aa-aaa-x-RESERVED').toString(), > $vm.icuVersion() >= 67 > ? 'en-Latn-US-1abc-foobar-variant-a-aa-aaa-u-kn-x-reserved' >- : 'en-Latn-US-variant-foobar-1abc-a-aa-aaa-u-kn-true-x-reserved' >+ : 'en-Latn-US-variant-foobar-1abc-a-aa-aaa-u-kn-x-reserved' > ); > shouldBe(new Intl.Locale('cel-gaulish', { script: 'Arab', numberingSystem: 'gujr' }).toString(), 'xtg-Arab-u-nu-gujr-x-cel-gaulish'); > shouldBe(new Intl.Locale('en-Latn-US-u-ca-gregory-co-phonebk-hc-h12-kf-upper-kn-false-nu-latn').toString(), 'en-Latn-US-u-ca-gregory-co-phonebk-hc-h12-kf-upper-kn-false-nu-latn'); >diff --git a/JSTests/stress/intl-numberformat.js b/JSTests/stress/intl-numberformat.js >index facadca0e3154e6eeafb2312edafb993be3bf619..56c577417645f4cbbb8d116cd15c23674eed09f9 100644 >--- a/JSTests/stress/intl-numberformat.js >+++ b/JSTests/stress/intl-numberformat.js >@@ -225,7 +225,7 @@ function testNumberFormat(numberFormat, possibleDifferences) { > JSON.stringify(Intl.NumberFormat.supportedLocalesOf('En-laTn-us-variAnt-fOObar-1abc-U-kn-tRue-A-aa-aaa-x-RESERVED')), > $vm.icuVersion() >= 67 > ? '["en-Latn-US-1abc-foobar-variant-a-aa-aaa-u-kn-x-reserved"]' >- : '["en-Latn-US-variant-foobar-1abc-a-aa-aaa-u-kn-true-x-reserved"]' >+ : '["en-Latn-US-variant-foobar-1abc-a-aa-aaa-u-kn-x-reserved"]' > ); > // Throws on problems with length, get, or toString. > shouldThrow(() => Intl.NumberFormat.supportedLocalesOf(Object.create(null, { length: { get() { throw new Error(); } } })), Error); >diff --git a/JSTests/stress/intl-object.js b/JSTests/stress/intl-object.js >index 40cff6612d14bba58ee1a9aa79e08eeefebade0d..0390f8c738f8e18a1cf5e62e0bc827e9d443fb0a 100644 >--- a/JSTests/stress/intl-object.js >+++ b/JSTests/stress/intl-object.js >@@ -72,7 +72,7 @@ function shouldThrow(func, errorType) { > JSON.stringify(Intl.getCanonicalLocales('En-laTn-us-variAnt-fOObar-1abc-U-kn-tRue-A-aa-aaa-x-RESERVED')), > $vm.icuVersion() >= 67 > ? '["en-Latn-US-1abc-foobar-variant-a-aa-aaa-u-kn-x-reserved"]' >- : '["en-Latn-US-variant-foobar-1abc-a-aa-aaa-u-kn-true-x-reserved"]' >+ : '["en-Latn-US-variant-foobar-1abc-a-aa-aaa-u-kn-x-reserved"]' > ); > // Throws on problems with length, get, or toString. > shouldThrow(() => Intl.getCanonicalLocales(Object.create(null, { length: { get() { throw new Error(); } } })), Error); >diff --git a/JSTests/stress/intl-pluralrules.js b/JSTests/stress/intl-pluralrules.js >index a136d46f41ad427e5ddbc1aaa644a11f512543bc..a438eace1d6647a09d41656267121ccd48505e07 100644 >--- a/JSTests/stress/intl-pluralrules.js >+++ b/JSTests/stress/intl-pluralrules.js >@@ -83,7 +83,7 @@ function shouldThrow(func, errorType) { > JSON.stringify(Intl.PluralRules.supportedLocalesOf('En-laTn-us-variAnt-fOObar-1abc-U-kn-tRue-A-aa-aaa-x-RESERVED')), > $vm.icuVersion() >= 67 > ? '["en-Latn-US-1abc-foobar-variant-a-aa-aaa-u-kn-x-reserved"]' >- : '["en-Latn-US-variant-foobar-1abc-a-aa-aaa-u-kn-true-x-reserved"]' >+ : '["en-Latn-US-variant-foobar-1abc-a-aa-aaa-u-kn-x-reserved"]' > ); > // Throws on problems with length, get, or toString. > shouldThrow(() => Intl.PluralRules.supportedLocalesOf(Object.create(null, { length: { get() { throw new Error(); } } })), Error); >diff --git a/JSTests/stress/intl-relativetimeformat.js b/JSTests/stress/intl-relativetimeformat.js >index 450282fb9133bc7433becd6f12f167ecd6e232a8..8c14346d0bf73b80663715de5856238b9e507312 100644 >--- a/JSTests/stress/intl-relativetimeformat.js >+++ b/JSTests/stress/intl-relativetimeformat.js >@@ -67,7 +67,7 @@ function shouldThrow(func, errorType) { > JSON.stringify(Intl.RelativeTimeFormat.supportedLocalesOf('En-laTn-us-variAnt-fOObar-1abc-U-kn-tRue-A-aa-aaa-x-RESERVED')), > $vm.icuVersion() >= 67 > ? '["en-Latn-US-1abc-foobar-variant-a-aa-aaa-u-kn-x-reserved"]' >- : '["en-Latn-US-variant-foobar-1abc-a-aa-aaa-u-kn-true-x-reserved"]' >+ : '["en-Latn-US-variant-foobar-1abc-a-aa-aaa-u-kn-x-reserved"]' > ); > > shouldThrow(() => Intl.RelativeTimeFormat.supportedLocalesOf('no-bok'), RangeError); >diff --git a/JSTests/test262/expectations.yaml b/JSTests/test262/expectations.yaml >index 4195d6cc7b8150eb2a9de95b76c6562ce14dd984..b47b5a23517f9dc7d700a0246d3529d6a0abfe1c 100644 >--- a/JSTests/test262/expectations.yaml >+++ b/JSTests/test262/expectations.yaml >@@ -1428,9 +1428,6 @@ test/built-ins/TypedArrayConstructors/of/custom-ctor.js: > test/built-ins/TypedArrayConstructors/of/new-instance-using-custom-ctor.js: > default: 'TypeError: TypedArray.of requires its this argument to subclass a TypedArray constructor (Testing with Float64Array.)' > strict mode: 'TypeError: TypedArray.of requires its this argument to subclass a TypedArray constructor (Testing with Float64Array.)' >-test/intl402/Collator/missing-unicode-ext-value-defaults-to-true.js: >- default: "Test262Error: \"kn-true\" is returned in locale, but shouldn't be. Expected SameValue(«7», «-1») to be true" >- strict mode: "Test262Error: \"kn-true\" is returned in locale, but shouldn't be. Expected SameValue(«7», «-1») to be true" > test/intl402/DateTimeFormat/prototype/format/timedatestyle-en.js: > default: 'Test262Error: Result for full with {} Expected SameValue(«14:12:47 PM Coordinated Universal Time», «14:12:47 Coordinated Universal Time») to be true' > strict mode: 'Test262Error: Result for full with {} Expected SameValue(«14:12:47 PM Coordinated Universal Time», «14:12:47 Coordinated Universal Time») to be true' >@@ -1473,9 +1470,6 @@ test/intl402/Intl/getCanonicalLocales/unicode-ext-canonicalize-region.js: > test/intl402/Intl/getCanonicalLocales/unicode-ext-canonicalize-subdivision.js: > default: 'Test262Error: Expected SameValue(«und-NO-u-sd-no23», «und-NO-u-sd-no50») to be true' > strict mode: 'Test262Error: Expected SameValue(«und-NO-u-sd-no23», «und-NO-u-sd-no50») to be true' >-test/intl402/Intl/getCanonicalLocales/unicode-ext-canonicalize-yes-to-true.js: >- default: 'Test262Error: Expected SameValue(«und-u-kb-true», «und-u-kb») to be true' >- strict mode: 'Test262Error: Expected SameValue(«und-u-kb-true», «und-u-kb») to be true' > test/intl402/Intl/getCanonicalLocales/unicode-ext-key-with-digit.js: > default: 'Test262Error: Expected SameValue(«en-u-0c-yes», «en-u-0c») to be true' > strict mode: 'Test262Error: Expected SameValue(«en-u-0c-yes», «en-u-0c») to be true' >@@ -1485,21 +1479,12 @@ test/intl402/Locale/constructor-apply-options-canonicalizes-twice.js: > test/intl402/Locale/constructor-non-iana-canon.js: > default: 'Test262Error: new Intl.Locale("mo").maximize().toString() returns "ro-Latn-RO" Expected SameValue(«ro», «ro-Latn-RO») to be true' > strict mode: 'Test262Error: new Intl.Locale("mo").maximize().toString() returns "ro-Latn-RO" Expected SameValue(«ro», «ro-Latn-RO») to be true' >-test/intl402/Locale/constructor-options-numeric-undefined.js: >- default: 'Test262Error: new Intl.Locale("en-u-kn-true", {numeric: undefined}).toString() returns "en-u-kn" Expected SameValue(«en-u-kn-true», «en-u-kn») to be true' >- strict mode: 'Test262Error: new Intl.Locale("en-u-kn-true", {numeric: undefined}).toString() returns "en-u-kn" Expected SameValue(«en-u-kn-true», «en-u-kn») to be true' >-test/intl402/Locale/constructor-options-numeric-valid.js: >- default: 'Test262Error: new Intl.Locale("en", {numeric: true}).toString() returns "true" Expected SameValue(«en-u-kn-true», «en-u-kn») to be true' >- strict mode: 'Test262Error: new Intl.Locale("en", {numeric: true}).toString() returns "true" Expected SameValue(«en-u-kn-true», «en-u-kn») to be true' > test/intl402/Locale/constructor-options-region-valid.js: > default: "Test262Error: new Intl.Locale('en', {region: \"554\"}).toString() returns \"en-NZ\" Expected SameValue(«en-554», «en-NZ») to be true" > strict mode: "Test262Error: new Intl.Locale('en', {region: \"554\"}).toString() returns \"en-NZ\" Expected SameValue(«en-554», «en-NZ») to be true" > test/intl402/Locale/constructor-tag.js: > default: 'Test262Error: new Intl.Locale("sl-ROZAJ-BISKE-1994").toString() returns "sl-1994-biske-rozaj" Expected SameValue(«sl-rozaj-biske-1994», «sl-1994-biske-rozaj») to be true' > strict mode: 'Test262Error: new Intl.Locale("sl-ROZAJ-BISKE-1994").toString() returns "sl-1994-biske-rozaj" Expected SameValue(«sl-rozaj-biske-1994», «sl-1994-biske-rozaj») to be true' >-test/intl402/Locale/getters.js: >- default: 'Test262Error: Expected SameValue(«de-Latn-DE-u-ca-gregory-co-phonebk-hc-h23-kf-true-kn-false-nu-latn», «de-Latn-DE-u-ca-gregory-co-phonebk-hc-h23-kf-kn-false-nu-latn») to be true' >- strict mode: 'Test262Error: Expected SameValue(«de-Latn-DE-u-ca-gregory-co-phonebk-hc-h23-kf-true-kn-false-nu-latn», «de-Latn-DE-u-ca-gregory-co-phonebk-hc-h23-kf-kn-false-nu-latn») to be true' > test/intl402/Locale/likely-subtags-grandfathered.js: > default: 'Test262Error: Expected SameValue(«cmn», «zh») to be true' > strict mode: 'Test262Error: Expected SameValue(«cmn», «zh») to be true'
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 216224
:
408119
|
408120
|
408425
|
408582
|
408583