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

MakeDay should be more explicit how unreasonably large numbers are handled #1087

Open
anba opened this Issue Feb 1, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@anba
Contributor

anba commented Feb 1, 2018

20.3.1.12 MakeDay should use a more precise language than "[...] but if this is not possible (because some argument is out of range), return NaN.". For example 20.3.1.11 MakeTime explicitly requires to use IEEE 754-2008 semantics for its operations.

This test prints different results in all four engines (SpiderMonkey and ChakraCore are almost the same, except Chakra prints the year as "-0000" for the second date, but that's probably a different issue) and I blame it one the imprecise language. 😛

d = new Date(0);
d.setUTCFullYear(Number.MAX_VALUE, Number.MAX_VALUE);
print(d.toUTCString());

d = new Date(0);
d.setUTCFullYear(Number.MAX_VALUE / 12 + 100, -Number.MAX_VALUE);
print(d.toUTCString());
@littledan

This comment has been minimized.

Show comment
Hide comment
@littledan
Member

littledan commented Feb 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment