Commit 3f3c51e0 authored by Frank Tang's avatar Frank Tang Committed by V8 LUCI CQ

[Temporal] Sync PR2260 Disallow one day long time zone offsets

https://github.com/tc39/proposal-temporal/pull/2260

Spec text:
https://tc39.es/proposal-temporal/#sec-temporal-getoffsetnanosecondsfor

Bug: v8:11544
Change-Id: I107372ba883f97c1bf74b96cd0f592d47aa1f359
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3901199
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83376}
parent e42eed12
......@@ -4381,8 +4381,8 @@ Maybe<int64_t> GetOffsetNanosecondsFor(Isolate* isolate,
// 6. Set offsetNanoseconds to ℝ(offsetNanoseconds).
int64_t offset_nanoseconds_int = static_cast<int64_t>(offset_nanoseconds);
// 7. If abs(offsetNanoseconds) > 86400 × 10^9, throw a RangeError exception.
if (std::abs(offset_nanoseconds_int) > 86400e9) {
// 7. If abs(offsetNanoseconds) >= 86400 × 10^9, throw a RangeError exception.
if (std::abs(offset_nanoseconds_int) >= 86400e9) {
THROW_NEW_ERROR_RETURN_VALUE(
isolate, NEW_TEMPORAL_INVALID_ARG_RANGE_ERROR(), Nothing<int64_t>());
}
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment