Closed ben-allen closed 4 months ago
2023-11-28: This PR achieved TC39-TG1 consensus.
Test coverage → https://github.com/tc39/test262/pull/3988
Updated to match limits currently set in Temporal. See: https://github.com/tc39/proposal-temporal/pull/2727#
@ptomato has pointed me toward https://github.com/tc39/proposal-temporal/pull/2727#discussion_r1408573795 for thoughts on implementation. He's also written a polyfill that implements the limits via string manipulation to run test262 tests against.
@ryzokuken @FrankYFTang
Note the text in Temporal PR 2727 was not the latest, Anba made some changes to it afterwards.
Note the text in Temporal PR 2727 was not the latest, Anba made some changes to it afterwards.
Just pushed a corrected version. Thanks for catching that!
Does this change mean BigInt math is not required (just like in Temporal)?
Could we do the following change to better match Temporal?
to
and change this part to be the exact text of
7.5.15 IsValidDuration ( years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds ) from Temporal spec (probabaly except replacing the "to construct a Temporal.Duration" part to "to construct a DurationRecord"
Notice, with the PR , some test cases in https://github.com/tc39/test262/blob/main/test/intl402/DurationFormat/prototype/format/precision-exact-mathematical-values.js
will be invalid and require changes to test the boundary condition and throwing/not throwing in the correct values
See #157
Upcoming revisions to Temporal will limit the valid values for Temporal.Duration. This commit applies the same limits on valid values for Intl.DurationFormat DurationRecords. Specifically: the absolute values of the values stored in each of the [[Years]], [[Months]], and [[Weeks]] fields cannot exceed 2^32, and the absolute value of the value obtained through converting the values in each of the sub-week fields to seconds and then summing them must not exceed 2^53.