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

Reject/adjust timeout/interval larger than the maximum Date value #5

Closed
JamesMGreene opened this issue Oct 19, 2017 · 3 comments
Closed

Comments

@JamesMGreene
Copy link
Contributor

Per the ECMAScript 5.1 spec, the maximum possible Date that can be represented in JavaScript is Saturday, September 13th, 275760 @ 00:00:00.000 UTC (midnight), which is exactly 100,000,000 days measured relative to midnight at the beginning of 01 January, 1970 UTC. (And the minimum is -100,000,000 days.)

The timestamp representation for that is 8640000000000000 (milliseconds since the epoch). While not critically necessary to reject/adjust values higher than that, it might be nice to account for that since it is a pretty arbitrary number between the max signed 32-bit integer and Number.MAX_SAFE_INTEGER.

@ronkorving
Copy link
Collaborator

The year 275760. If this module is still in use by then, it would surely be a legacy :)

But, even if the world boils off into space to make way for a hyperspace bypass before that time, in the spirit of this module it would make sense to make anything beyond that number work just as well (instead of dropping it), I guess. In any case, we have to do something to guarantee correct (not-undefined) behavior.

I will happily accept PRs to implement this :) Else I may get around to it someday, but I have to admit I'm a bit busy right now, so it may take some time.

@JamesMGreene
Copy link
Contributor Author

JamesMGreene commented Oct 20, 2017

I suppose it isn't really an issue with the way you have this module coded since you never try to incorporate the user's provided delay value into a Date object (you just keep it in its millisecond form). 👍

@JamesMGreene
Copy link
Contributor Author

From my perspective: feel free to close this out. I think the code you have will handle it just fine after all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants