-
Notifications
You must be signed in to change notification settings - Fork 471
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
Date toString tests #930
Date toString tests #930
Conversation
Following the proposed specification in tc39/ecma262#848
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a final review, but I just found this bug.
assert.notSameValue(null, match); | ||
|
||
// Years are padded to the left with zeroes | ||
match = stringRegExp.exec(new Date('0020-01-01T00:00:00Z').toDateString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/stringRegExp/dateRegExp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
The spec change landed, but changes still needed on the test. |
With that typo fixed, the tests pass on a hacked version of V8 that implements the new specification, so I don't think there are any more obvious typos. |
These tests check the semantics of Date.prototype.toString, Date.prototype.toTimeString,
Date.prototype.toDateString and Date.prototype.toUTCString. There are probably ways
to make the more specific, but this is a start. The semantics are currently implementation-defined,
but a spec pull request at tc39/ecma262#848 gives them this behavior.