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

Fix for bad Date#toJSON polyfills. #98

Merged
merged 2 commits into from
Oct 8, 2012
Merged

Conversation

bryanforbes
Copy link
Contributor

Fixes #95.

@bryanforbes
Copy link
Contributor Author

!~ was an attempt to make the feature test suggested in #95 a bit shorter. I suppose it's just obfuscating what is actually going on. I've pushed a change to the branch that's more obvious. I've also stored -62198755200000 and '-000001' in variables.

I'm also wondering if the indexOf check could be changed to !(new Date(negDate).toISOString().indexOf(yearStr)) instead of (new Date(negDate).toISOString().indexOf(yearStr) === -1) since I believe '-000001' should be at the beginning of the string. Can '-000001' be anywhere else in the string?

@kriskowal
Copy link
Member

This looks good to me.

@kriskowal kriskowal merged commit d0b79ba into es-shims:master Oct 8, 2012
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

Successfully merging this pull request may close these issues.

Correct bad Date.prototype.toJSON polyfills from elsewhere
3 participants