RESOLVED FIXED 286973
[JSC] `Date.prototype.set*` methods should check if `internalNumber` is NaN, before set PNaN
https://bugs.webkit.org/show_bug.cgi?id=286973
Summary [JSC] `Date.prototype.set*` methods should check if `internalNumber` is NaN, ...
Sosuke Suzuki
Reported 2025-02-03 16:59:43 PST
Currently, in JSC the Date#setHours, Date#setMinutes, and similar methodscheck 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).
Attachments
Sosuke Suzuki
Comment 1 2025-02-03 17:12:30 PST
Radar WebKit Bug Importer
Comment 2 2025-02-10 17:00:15 PST
EWS
Comment 3 2025-02-10 23:43:07 PST
Committed 290201@main (998eb1b4b14e): <https://commits.webkit.org/290201@main> Reviewed commits have been landed. Closing PR #39949 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.