Join GitHub today
toDate returns a copy of the internal date object #3191
Is there any reason why we can't just call
return new Date(this.valueOf());
and do away with the ternary? Seems to me it would have the same result, and it would work correctly with Tim's pull request that we've been talking about bringing in.
In either case, some kind of a unit test should be added for it. It seems like a trivial test case, but that way we ensure that nobody puts it back the other way for some strange reason.