timrwood/moment — pull request #458 by timrwood (2012-10-03 16:33:11+00:00)
Title: Constructor refactor

This cleans up a few hacks that had been used for constructing moments.

1. [Attaching the source array to the date object it created, then pulling it back off later](https://github.com/timrwood/moment/blob/7bf7d3f99ee1ee631bcbe29ac7778e6e6529b0e8/moment.js#L222)
2. [Attaching the `asUTC` boolean as the eighth item in the input array](https://github.com/timrwood/moment/blob/7bf7d3f99ee1ee631bcbe29ac7778e6e6529b0e8/moment.js#L354)
3. [Attaching the `isValid` boolean as the ninth item in the input array](https://github.com/timrwood/moment/blob/7bf7d3f99ee1ee631bcbe29ac7778e6e6529b0e8/moment.js#L357)

Now, when `moment()` or `moment.utc()` are called, a `config` object is created that gets passed through all the functions necessary to convert the input to a `Moment`. Then, all the cases above can just attach their data to the config object.

1. [config._a](https://github.com/timrwood/moment/blob/1fca58d212e1cf3f9a436f4b981bf79c1957643b/moment.js#L621)
2. [config._useUTC](https://github.com/timrwood/moment/blob/1fca58d212e1cf3f9a436f4b981bf79c1957643b/moment.js#L564)
3. [config._isValid](https://github.com/timrwood/moment/blob/1fca58d212e1cf3f9a436f4b981bf79c1957643b/moment.js#L513)