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

Conversation

Projects
None yet
3 participants
@ichernev
Contributor

ichernev commented Jul 27, 2015

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);

This comment has been minimized.

@mj1856

mj1856 Jul 27, 2015

Member

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

This comment has been minimized.

@ichernev

ichernev Jul 27, 2015

Contributor

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

This comment has been minimized.

@mj1856

mj1856 Jul 28, 2015

Member

Ok. Just making sure. Thanks.

@mj1856

This comment has been minimized.

Member

mj1856 commented Jul 28, 2015

LGTM

ichernev added a commit that referenced this pull request Jul 28, 2015

@ichernev ichernev merged commit 9483d70 into moment:develop Jul 28, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@wyantb

This comment has been minimized.

Contributor

wyantb commented Aug 2, 2015

My bad. +1 for more tests.

@mj1856 mj1856 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