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 constructor regression #2515

Merged
merged 1 commit into from
Jul 28, 2015
Merged

Conversation

ichernev
Copy link
Contributor

This was caused by https://github.com/moment/moment/pull/2368/files#diff-e792da0601bb2705000e86ef203f8e73R61

We should have had a test to cover for this case :)

Fix for #2512

@@ -58,7 +58,7 @@ var updateInProgress = false;
// Moment prototype object
export function Moment(config) {
copyConfig(this, config);
this._d = new Date(config._d.getTime());
this._d = new Date(config._d != null ? config._d.getTime() : NaN);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be !==, yes? Or could _d be undefined instead of null?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. != null catches null and undefined. In our case its actually undefined.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Just making sure. Thanks.

@mattjohnsonpint
Copy link
Contributor

LGTM

ichernev added a commit that referenced this pull request Jul 28, 2015
@ichernev ichernev merged commit 9483d70 into moment:develop Jul 28, 2015
@wyantb
Copy link
Contributor

wyantb commented Aug 2, 2015

My bad. +1 for more tests.

@mattjohnsonpint mattjohnsonpint added this to the 2.10.6 milestone Dec 15, 2015
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.

None yet

3 participants