Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 11733013d7805964e31549a9bd953d0792fc393b
https://github.com/WebKit/WebKit/commit/11733013d7805964e31549a9bd953d0792fc393b
Author: Yusuke Suzuki <[email protected]>
Date: 2025-10-28 (Tue, 28 Oct 2025)
Changed paths:
M Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp
M Source/JavaScriptCore/runtime/IntlLocale.cpp
M Source/JavaScriptCore/runtime/IntlObject.cpp
Log Message:
-----------
[JSC] Make JSC defensive against non-BCP47-compliant calendar IDs from ICU
https://bugs.webkit.org/show_bug.cgi?id=301547
rdar://163525211
Reviewed by Yijia Huang.
Since entire ECMA-402 (i18n) is designed based on BCP-47 unicode
language identifiers, we cannot handle something special which
does not meet BCP-47 consistently. However some of customized ICU can
generate non-compliant calendar ID, so leaking this information cause
inconsistency and throwing an error in various places when this ID is
validated as it is specified in ECMA-402. Let's make JSC a bit defensive
against ICU-offering calendar IDs. We accept ICU calendar IDs only when
it meets BCP-47.
Caught via test262 test
JSTests/test262/test/intl402/Intl/supportedValuesOf/calendars-accepted-by-DisplayNames.js
* Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::localeData):
(JSC::IntlDateTimeFormat::initializeDateTimeFormat):
* Source/JavaScriptCore/runtime/IntlLocale.cpp:
(JSC::IntlLocale::calendars):
* Source/JavaScriptCore/runtime/IntlObject.cpp:
(JSC::intlAvailableCalendars):
Canonical link: https://commits.webkit.org/302266@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications