Bug 216526

Summary: [GTK][WPE] test262 Locale.minimize tests depend on unreleased ICU patch
Product: WebKit Reporter: Lauro Moura <lmoura>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: bugs-noreply, pnormand
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=215327

Description Lauro Moura 2020-09-14 21:33:23 PDT
FAIL test/intl402/Locale/prototype/minimize/removing-likely-subtags-first-adds-likely-subtags.js (default)
Full Output:
Exception: Test262Error: "und".minimize() should be "en" Expected SameValue(«und», «en») to be true

FAIL test/intl402/Locale/prototype/minimize/removing-likely-subtags-first-adds-likely-subtags.js (strict mode)
Full Output:
Exception: Test262Error: "und".minimize() should be "en" Expected SameValue(«und», «en») to be true

ECMA spec: https://tc39.es/ecma402/#sec-Intl.Locale.prototype.minimize
Unicode spec: http://www.unicode.org/reports/tr35/#Likely_Subtags
Upstream test: https://github.com/tc39/test262/blame/main/test/intl402/Locale/prototype/minimize/removing-likely-subtags-first-adds-likely-subtags.js#L1

Using icu4c 67.1 after https://github.com/unicode-org/icu/pull/1140 (commit ec7e29f2b697188e5a667db2b235a3d0db8a5d20):

uloc_minimizeSubtags(nullptr) -> "en"
uloc_minimizeSubtags("") -> "en"
uloc_minimizeSubtags("und") -> "en"
uloc_minimizeSubtags("und-Thai") -> "th"

Using icu4c before it:

uloc_minimizeSubtags(nullptr) -> "en"
uloc_minimizeSubtags("und") -> ""
uloc_minimizeSubtags("") -> ""
uloc_minimizeSubtags("und-Thai") -> "-Thai"

As "und" language gets translated to an empty string in IntlObject.cpp, the test fails with the current ICU behavior.