[webkit-changes] [WebKit/WebKit] 92ddbf: [JSC] Purify NaN before passing it to Intl because...

Yusuke Suzuki noreply at github.com
Mon Jan 23 19:15:33 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 92ddbfbb8cb5936bb005e83bba6776ca8ea9809d
      https://github.com/WebKit/WebKit/commit/92ddbfbb8cb5936bb005e83bba6776ca8ea9809d
  Author: Yusuke Suzuki <ysuzuki at apple.com>
  Date:   2023-01-23 (Mon, 23 Jan 2023)

  Changed paths:
    A JSTests/stress/intl-negative-nan.js
    M Source/JavaScriptCore/runtime/IntlDurationFormat.cpp
    M Source/JavaScriptCore/runtime/IntlNumberFormat.cpp
    M Source/JavaScriptCore/runtime/IntlNumberFormat.h

  Log Message:
  -----------
  [JSC] Purify NaN before passing it to Intl because they can distinguish between -NaN and +NaN
https://bugs.webkit.org/show_bug.cgi?id=251055
rdar://104439690

Reviewed by Ross Kirsling.

This patch purifies NaN before passing it to ICU APIs since they can distinguish -NaN and +NaN.
In JSC, -NaN and +NaN can appear so long as bit patterns are not Impure-NaN. And both are handled
in the same way, except for ICU.

* Source/JavaScriptCore/runtime/IntlDurationFormat.cpp:
(JSC::collectElements):
* Source/JavaScriptCore/runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::format const):
(JSC::IntlNumberFormat::formatToParts const):
* Source/JavaScriptCore/runtime/IntlNumberFormat.h:
(JSC::IntlMathematicalValue::IntlMathematicalValue):

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




More information about the webkit-changes mailing list