-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JSC]
fractionalDigits
of Intl.DurationFormat
should be treated a…
…s at most 9 digits if it is omitted https://bugs.webkit.org/show_bug.cgi?id=274974 Reviewed by Yusuke Suzuki. According to the spec[1], if the `fractionalDigits` option of `Intl.DurationFormat` is omitted, it should be treated as at most 9 digits. However, in the current JSC, it is treated as exact 0 digits. The README of the proposal repository[2] states the following: > If this option is omitted, only nonzero decimals will be displayed and trailing zeroes will be omitted. This patch changes to treat it as at most 9 digits, using the ICU's Fraction Precision notation[3]. [1]: https://tc39.es/proposal-intl-duration-format/#sec-partitiondurationformatpattern ( 4.f.ii.1.b ) [2]: https://github.com/tc39/proposal-intl-duration-format#parameters [3]: https://github.com/unicode-org/icu/blob/main/docs/userguide/format_parse/numbers/skeletons.md#fraction-precision * JSTests/stress/intl-durationformat-digital.js: (Intl.DurationFormat.shouldBeOneOf.fmt.format): (Intl.DurationFormat.shouldBeOneOf): * JSTests/test262/expectations.yaml: * Source/JavaScriptCore/runtime/IntlDurationFormat.cpp: (JSC::collectElements): Canonical link: https://commits.webkit.org/279632@main
- Loading branch information
1 parent
5290e07
commit d0e99df
Showing
3 changed files
with
19 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters