[webkit-changes] [WebKit/WebKit] 998eb1: [JSC] `Date.prototype.set*` methods should check i...
SUZUKI Sosuke
noreply at github.com
Mon Feb 10 23:43:26 PST 2025
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 998eb1b4b14e4d3b113b5bf80a2a5e58ae98f300
https://github.com/WebKit/WebKit/commit/998eb1b4b14e4d3b113b5bf80a2a5e58ae98f300
Author: Sosuke Suzuki <aosukeke at gmail.com>
Date: 2025-02-10 (Mon, 10 Feb 2025)
Changed paths:
A JSTests/stress/date-prototype-set-methods-toNumber-no-args.js
A JSTests/stress/date-prototype-set-methods-toNumber.js
M JSTests/test262/expectations.yaml
M Source/JavaScriptCore/runtime/DatePrototype.cpp
Log Message:
-----------
[JSC] `Date.prototype.set*` methods should check if `internalNumber` is NaN, before set PNaN
https://bugs.webkit.org/show_bug.cgi?id=286973
Reviewed by Yusuke Suzuki.
Currently, in JSC the Date#setHours, Date#setMinutes, and similar methods check if
the internalNumber is NaN and then call applyToNumberToOtherwiseIgnoredArguments
before explicitly setting internalNumber to PNaN.
However, since applyToNumberToOtherwiseIgnoredArguments can update internalNumber (e.g. when
valueOf or Symbol.toPrimitive are overridden), we must recheck that internalNumber
is still NaN immediately before assigning PNaN.
This change aligns our behavior with the expectations added in test262 (see tc39/test262#4258).
* JSTests/test262/expectations.yaml:
* Source/JavaScriptCore/runtime/DatePrototype.cpp:
(JSC::setNewValueFromTimeArgs):
Canonical link: https://commits.webkit.org/290201@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