v8/test/mjsunit/temporal
Frank Tang 20db58cb52 [Temporal] Fix Duration toJSON/toString
1. Correct the return type of RoundTowardsZero to fix issue with
double value > 2^64

2. In TemporalDurationToString:
a. Use std::fmod instead of % to get the remainder
b. Use extra xx_add variables to hold additional value which may
overflow the double during computation.
c. Use BigInt for days if the value is too large for double
to ensure the precision.
3. Add tests with Number.MAX_SAFE_INTEGER
and Number.MAX_VALUE in values for Duration toJSON in mjsunit



Bug: v8:11544
Change-Id: Icac4f669ed1c591e947b51c82dd48bdef7a6db6e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3900813
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83344}
2022-09-20 20:17:33 +00:00
..
calendar-constructor.js [Temporal] Part2 Add constructor and simple getters. 2022-01-07 19:18:33 +00:00
calendar-date-add.js
calendar-date-from-fields.js [Temporal] Part2 Add constructor and simple getters. 2022-01-07 19:18:33 +00:00
calendar-date-until.js [Temporal] Part2 Add constructor and simple getters. 2022-01-07 19:18:33 +00:00
calendar-day-of-week.js
calendar-day-of-year.js
calendar-day.js
calendar-days-in-month.js
calendar-days-in-week.js
calendar-days-in-year.js
calendar-fields.js [Temporal] Part2 Add constructor and simple getters. 2022-01-07 19:18:33 +00:00
calendar-from.js [Temporal] Part2 Add constructor and simple getters. 2022-01-07 19:18:33 +00:00
calendar-in-leap-year.js
calendar-merge-fields.js [Temporal] Part2 Add constructor and simple getters. 2022-01-07 19:18:33 +00:00
calendar-month-code.js
calendar-month-day-from-fields.js [Temporal] Part2 Add constructor and simple getters. 2022-01-07 19:18:33 +00:00
calendar-month.js [Temporal] Part2 Add constructor and simple getters. 2022-01-07 19:18:33 +00:00
calendar-months-in-year.js
calendar-week-of-year.js
calendar-year-month-from-fields.js [Temporal] Part2 Add constructor and simple getters. 2022-01-07 19:18:33 +00:00
calendar-year.js
duration-abs.js [Temporal] Part2 Add constructor and simple getters. 2022-01-07 19:18:33 +00:00
duration-add.js [Temporal] Part2 Add constructor and simple getters. 2022-01-07 19:18:33 +00:00
duration-constructor.js [Temporal] Part2 Add constructor and simple getters. 2022-01-07 19:18:33 +00:00
duration-from.js [Temporal] Part2 Add constructor and simple getters. 2022-01-07 19:18:33 +00:00
duration-negated.js [Temporal] Add Duration.prototype.(abs|negated) 2022-03-26 22:15:14 +00:00
duration-to-json-boundary-cases.js [Temporal] Fix Duration toJSON/toString 2022-09-20 20:17:33 +00:00
duration-to-json.js
duration-valueOf.js [Temporal] Part2 Add constructor and simple getters. 2022-01-07 19:18:33 +00:00
duration-with.js [Temporal] Part2 Add constructor and simple getters. 2022-01-07 19:18:33 +00:00
function-exist-no-intl.js Reland "[Temporal] Part 1 - Skeleton" 2021-10-08 15:50:13 +00:00
function-exist.js [Temporal] Add Date.prototype.toTemporalInstant 2022-05-25 18:20:10 +00:00
instant-add.js [Temporal] Add some tests for Instant 2021-08-28 05:26:50 +00:00
instant-compare.js [Temporal] Add some tests for Instant 2021-08-28 05:26:50 +00:00
instant-constructor.js [Temporal] Fix test to sync with latest spec after spec change. 2022-08-03 23:53:24 +00:00
instant-equals.js [Temporal] Add some tests for Instant 2021-08-28 05:26:50 +00:00
instant-from-epoch-microseconds.js [Temporal] Add some tests for Instant 2021-08-28 05:26:50 +00:00
instant-from-epoch-milliseconds.js [Temporal] Fix test to sync with latest spec after spec change. 2022-08-03 23:53:24 +00:00
instant-from-epoch-nanoseconds.js [Temporal] Add some tests for Instant 2021-08-28 05:26:50 +00:00
instant-from-epoch-seconds.js [Temporal] Fix test to sync with latest spec after spec change. 2022-08-03 23:53:24 +00:00
instant-subtract.js [Temporal] Add some tests for Instant 2021-08-28 05:26:50 +00:00
instant-to-json.js [Temporal] Add toJSON, toString, and non-intl toLocaleString to Instant 2022-06-29 08:31:17 +00:00
instant-toJSON.js [Temporal] Add some tests for Instant 2021-08-28 05:26:50 +00:00
instant-valueOf.js [Temporal] Add some tests for Instant 2021-08-28 05:26:50 +00:00
plain-date-add.js [Temporal] Part2 Add constructor and simple getters. 2022-01-07 19:18:33 +00:00
plain-date-compare.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-constructor.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-equals.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-from.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-get-calendar.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-get-day.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-get-dayOfWeek.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-get-dayOfYear.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-get-daysInMonth.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-get-daysInWeek.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-get-daysInYear.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-get-era.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-get-eraYear.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-get-inLeapYear.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-get-iso-fields.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-get-month.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-get-monthCode.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-get-monthsInYear.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-get-weekOfYear.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-get-year.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-time-add.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-compare.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-constructor.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-equals.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-from.js [Temporal] Part2 Add constructor and simple getters. 2022-01-07 19:18:33 +00:00
plain-date-time-get-calendar.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-get-day.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-get-dayOfWeek.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-get-dayOfYear.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-get-daysInMonth.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-get-daysInWeek.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-get-daysInYear.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-get-era.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-get-eraYear.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-get-hour.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-get-inLeapYear.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-get-iso-fields.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-get-microsecond.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-get-millisecond.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-get-minute.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-get-month.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-get-monthCode.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-get-monthsInYear.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-get-nanosecond.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-get-second.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-get-weekOfYear.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-get-year.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-subtract.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-to-json.js [Temporal] Fix test to sync with latest spec after spec change. 2022-08-03 23:53:24 +00:00
plain-date-time-to-plain-date.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-to-plain-month-day.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-to-plain-time.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-to-plain-year-month.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-valueOf.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-with-calendar.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-with-plain-date.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-with-plain-time.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-time-with.js [Temporal] Add some tests for PlainDateTime 2021-10-12 08:48:20 +00:00
plain-date-to-json.js [Temporal] Add PlainDate.prototype.toJSON 2022-05-19 01:22:23 +00:00
plain-date-to-plain-date-time.js [Temporal] Fix test to sync with latest spec after spec change. 2022-08-03 23:53:24 +00:00
plain-date-to-plain-month-day.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-to-plain-year-month.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-valueOf.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-with-calendar.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
plain-date-with.js [Temporal] Add some tests for PlainDate 2021-08-28 05:40:50 +00:00
temporal-helpers.js [Temporal] Part2 Add constructor and simple getters. 2022-01-07 19:18:33 +00:00
time-zone-constructor.js [Temporal] Part2 Add constructor and simple getters. 2022-01-07 19:18:33 +00:00