Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly handle NaN in new Date() #1477

Merged
merged 2 commits into from
Aug 20, 2021
Merged

Conversation

raskad
Copy link
Member

@raskad raskad commented Aug 17, 2021

This Pull Request fixes/closes #1476.

It changes the following:

  • Properly handle NaN in new Date()

@raskad
Copy link
Member Author

raskad commented Aug 17, 2021

Test262 conformance changes:

Test result master count PR count difference
Total 78,897 78,897 0
Passed 29,766 29,824 +58
Ignored 15,612 15,612 0
Failed 33,519 33,461 -58
Panics 2 2 0
Conformance 37.73% 37.80% +0.07%
Fixed tests:
test/built-ins/Date/value-to-primitive-result-non-string-prim.js [strict mode] (previously Failed)
test/built-ins/Date/value-to-primitive-result-non-string-prim.js (previously Failed)
test/built-ins/Date/prototype/getUTCMilliseconds/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/getUTCMilliseconds/this-value-invalid-date.js (previously Failed)
test/built-ins/Date/prototype/getDay/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/getDay/this-value-invalid-date.js (previously Failed)
test/built-ins/Date/prototype/getUTCFullYear/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/getUTCFullYear/this-value-invalid-date.js (previously Failed)
test/built-ins/Date/prototype/setMilliseconds/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/setMilliseconds/this-value-invalid-date.js (previously Failed)
test/built-ins/Date/prototype/getUTCMonth/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/getUTCMonth/this-value-invalid-date.js (previously Failed)
test/built-ins/Date/prototype/getFullYear/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/getFullYear/this-value-invalid-date.js (previously Failed)
test/built-ins/Date/prototype/setMonth/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/setMonth/this-value-invalid-date.js (previously Failed)
test/built-ins/Date/prototype/setSeconds/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/setSeconds/this-value-invalid-date.js (previously Failed)
test/built-ins/Date/prototype/getHours/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/getHours/this-value-invalid-date.js (previously Failed)
test/built-ins/Date/prototype/toUTCString/invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/toUTCString/invalid-date.js (previously Failed)
test/built-ins/Date/prototype/toTimeString/invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/toTimeString/invalid-date.js (previously Failed)
test/built-ins/Date/prototype/getMinutes/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/getMinutes/this-value-invalid-date.js (previously Failed)
test/built-ins/Date/prototype/getUTCDay/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/getUTCDay/this-value-invalid-date.js (previously Failed)
test/built-ins/Date/prototype/getTime/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/getTime/this-value-invalid-date.js (previously Failed)
test/built-ins/Date/prototype/getDate/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/getDate/this-value-invalid-date.js (previously Failed)
test/built-ins/Date/prototype/getUTCMinutes/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/getUTCMinutes/this-value-invalid-date.js (previously Failed)
test/built-ins/Date/prototype/valueOf/S9.4_A3_T2.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/valueOf/S9.4_A3_T2.js (previously Failed)
test/built-ins/Date/prototype/getSeconds/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/getSeconds/this-value-invalid-date.js (previously Failed)
test/built-ins/Date/prototype/getMonth/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/getMonth/this-value-invalid-date.js (previously Failed)
test/built-ins/Date/prototype/getUTCDate/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/getUTCDate/this-value-invalid-date.js (previously Failed)
test/built-ins/Date/prototype/getUTCHours/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/getUTCHours/this-value-invalid-date.js (previously Failed)
test/built-ins/Date/prototype/toDateString/invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/toDateString/invalid-date.js (previously Failed)
test/built-ins/Date/prototype/setDate/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/setDate/this-value-invalid-date.js (previously Failed)
test/built-ins/Date/prototype/getUTCSeconds/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/getUTCSeconds/this-value-invalid-date.js (previously Failed)
test/built-ins/Date/prototype/toString/invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/toString/invalid-date.js (previously Failed)
test/built-ins/Date/prototype/getMilliseconds/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/getMilliseconds/this-value-invalid-date.js (previously Failed)
test/built-ins/Date/prototype/setMinutes/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/setMinutes/this-value-invalid-date.js (previously Failed)
test/built-ins/Date/prototype/setHours/this-value-invalid-date.js [strict mode] (previously Failed)
test/built-ins/Date/prototype/setHours/this-value-invalid-date.js (previously Failed)

@HalidOdat HalidOdat added bug Something isn't working builtins PRs and Issues related to builtins/intrinsics labels Aug 20, 2021
@HalidOdat HalidOdat added this to the v0.13.0 milestone Aug 20, 2021
@HalidOdat HalidOdat merged commit bc12f95 into boa-dev:master Aug 20, 2021
@raskad raskad deleted the date-nan-fix branch September 10, 2021 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working builtins PRs and Issues related to builtins/intrinsics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

new Date(NaN) sets the date to the default date instead of an invalid date
2 participants