[webkit-changes] [WebKit/WebKit] 67e4f6: [JSC] Limits values for `Intl.DurationFormat` and ...

SUZUKI Sosuke noreply at github.com
Mon Oct 14 10:20:21 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 67e4f629c1ce19663e4d945d35def83e5ab1f5e8
      https://github.com/WebKit/WebKit/commit/67e4f629c1ce19663e4d945d35def83e5ab1f5e8
  Author: Sosuke Suzuki <aosukeke at gmail.com>
  Date:   2024-10-14 (Mon, 14 Oct 2024)

  Changed paths:
    A JSTests/stress/intl-durationformat-limits.js
    A JSTests/stress/temporal-duration-limits.js
    M JSTests/stress/temporal-duration.js
    M JSTests/test262/expectations.yaml
    M Source/JavaScriptCore/runtime/ISO8601.cpp
    M Source/JavaScriptCore/runtime/ISO8601.h

  Log Message:
  -----------
  [JSC] Limits values for `Intl.DurationFormat` and `Temporal.Duration`
https://bugs.webkit.org/show_bug.cgi?id=281394

Reviewed by Yusuke Suzuki.

To align with the behavior of `Temporal.Duration`, a value limit has been added to
`Intl.DurationFormat`[1]. The current JSC doesn't implement the limits for both
`Intl.DurationFormat` and `Temporal.Duration`.

This patch implements that specifications.

In the spec, this limit is represented as a double based on seconds. However, to avoid rounding
errors, we represent it as an `Int128` based on nanoseconds.

[1]: https://github.com/tc39/proposal-intl-duration-format/pull/173

(shouldThrow):
(const.df.new.Intl.DurationFormat):
(RangeError.shouldThrow):
* JSTests/test262/expectations.yaml:
* Source/JavaScriptCore/runtime/ISO8601.cpp:
(JSC::ISO8601::Duration::normalizedNanoseconds const):
(JSC::ISO8601::absInt128):
(JSC::ISO8601::isValidDuration):
* Source/JavaScriptCore/runtime/ISO8601.h:

Canonical link: https://commits.webkit.org/285131@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list