Bug 286973
| Summary: | [JSC] `Date.prototype.set*` methods should check if `internalNumber` is NaN, before set PNaN | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Sosuke Suzuki <aosukeke> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Local Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Sosuke Suzuki
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Sosuke Suzuki
Pull request: https://github.com/WebKit/WebKit/pull/39949
Radar WebKit Bug Importer
<rdar://problem/144574198>
EWS
Committed 290201@main (998eb1b4b14e): <https://commits.webkit.org/290201@main>
Reviewed commits have been landed. Closing PR #39949 and removing active labels.