Fix numberingSystem invaild to undefined

Signed-off-by: liujia178 <liujia178@huawei.com>
This commit is contained in:
liujia178 2024-04-09 16:11:40 +08:00
parent 78f90b26a3
commit 99f96170f1
2 changed files with 7 additions and 1 deletions

View File

@ -488,6 +488,13 @@ void JSNumberFormat::InitializeNumberFormat(JSThread *thread, const JSHandle<JSN
}
}
if (!numberingSystemStr.empty()) {
// If numberingSystem is invalid, Let numberingSystem be undefined.
if (!JSLocale::IsWellNumberingSystem(numberingSystemStr)) {
numberFormat->SetNumberingSystem(thread, undefinedValue);
}
}
// 10. Let localeData be %NumberFormat%.[[LocaleData]].
JSHandle<TaggedArray> availableLocales;
if (requestedLocales->GetLength() == 0) {

View File

@ -1652,7 +1652,6 @@
"intl/number-format/resolved-options-digits-order.js",
"intl/number-format/rounding-increment-value-v3.js",
"intl/number-format/use-grouping-v3.js",
"intl/number-format/check-numbering-system.js",
"intl/number-format/format-currency.js",
"intl/number-format/sign-display-v3.js",
"intl/number-format/resolved-options-order.js",