diff options
Diffstat (limited to 'js/src/builtin/temporal/ToString.cpp')
-rw-r--r-- | js/src/builtin/temporal/ToString.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/js/src/builtin/temporal/ToString.cpp b/js/src/builtin/temporal/ToString.cpp index c789c5e95c..e13ad8eb03 100644 --- a/js/src/builtin/temporal/ToString.cpp +++ b/js/src/builtin/temporal/ToString.cpp @@ -169,7 +169,7 @@ static void FormatFractionalSeconds(TemporalStringBuilder& result, result.append('.'); // Steps 1.b-c. - uint32_t k = 100'000'000; + int32_t k = 100'000'000; do { result.append(char('0' + (subSecondNanoseconds / k))); subSecondNanoseconds %= k; @@ -186,7 +186,7 @@ static void FormatFractionalSeconds(TemporalStringBuilder& result, result.append('.'); // Steps 2.b-c. - uint32_t k = 100'000'000; + int32_t k = 100'000'000; for (uint8_t i = 0; i < p; i++) { result.append(char('0' + (subSecondNanoseconds / k))); subSecondNanoseconds %= k; @@ -274,7 +274,7 @@ static int32_t RoundNanosecondsToMinutes(int64_t offsetNanoseconds) { if (std::abs(remainder * 2) >= increment) { quotient += (offsetNanoseconds > 0 ? 1 : -1); } - return quotient; + return int32_t(quotient); } /** @@ -636,11 +636,8 @@ JSString* js::temporal::TemporalZonedDateTimeToString( // Steps 1-3. (Not applicable in our implementation.) // Step 4. - Instant ns; - if (!RoundTemporalInstant(cx, zonedDateTime.instant(), increment, unit, - roundingMode, &ns)) { - return nullptr; - } + auto ns = RoundTemporalInstant(zonedDateTime.instant(), increment, unit, + roundingMode); // Step 5. auto timeZone = zonedDateTime.timeZone(); |