+++ /dev/null
-[
- {
- "name": "clone",
- "timestamp": "Sun Jul 20 2014 23:14:34 GMT-0400 (EDT)",
- "count": 1925,
- "cycles": 3,
- "hz": 34836.98543958899
- },
- {
- "name": "clone",
- "timestamp": "Sun Jul 20 2014 23:21:33 GMT-0400 (EDT)",
- "count": 1885,
- "cycles": 8,
- "hz": 36659.44586569106
- },
- {
- "name": "clone",
- "timestamp": "Mon Jul 21 2014 00:50:03 GMT-0400 (EDT)",
- "count": 11378,
- "cycles": 4,
- "hz": 210942.42334154248
- }
-]
\ No newline at end of file
// internal storage for locale config files
locales = {},
- // moment internal properties
- momentProperties = [
- '_isAMomentObject',
- '_i',
- '_f',
- '_l',
- '_strict',
- '_tzm',
- '_isUTC',
- '_offset',
- '_pf',
- '_locale'
- ];
+ // extra moment internal properties (plugins register props here)
+ momentProperties = [],
// check for nodeJS
hasModule = (typeof module !== 'undefined' && module.exports),
// Moment prototype object
function Moment(config, skipOverflow) {
- if (skipOverflow != false) {
- checkOverflow(config);
+ if (skipOverflow !== false) {
+ checkOverflow(config);
}
copyConfig(this, config);
+ this._d = new Date(+config._d);
}
// Duration Constructor
function copyConfig(to, from) {
var i, prop, val;
- for (i in momentProperties) {
- prop = momentProperties[i];
- val = from[prop];
- if (typeof val !== 'undefined') {
- to[prop] = val;
- }
+ if (typeof from._isAMomentObject !== 'undefined') {
+ to._isAMomentObject = from._isAMomentObject;
+ }
+ if (typeof from._i !== 'undefined') {
+ to._i = from._i;
+ }
+ if (typeof from._f !== 'undefined') {
+ to._f = from._f;
+ }
+ if (typeof from._l !== 'undefined') {
+ to._l = from._l;
+ }
+ if (typeof from._strict !== 'undefined') {
+ to._strict = from._strict;
+ }
+ if (typeof from._tzm !== 'undefined') {
+ to._tzm = from._tzm;
+ }
+ if (typeof from._isUTC !== 'undefined') {
+ to._isUTC = from._isUTC;
+ }
+ if (typeof from._offset !== 'undefined') {
+ to._offset = from._offset;
+ }
+ if (typeof from._pf !== 'undefined') {
+ to._pf = from._pf;
+ }
+ if (typeof from._locale !== 'undefined') {
+ to._locale = from._locale;
}
- to._d = new Date(+from._d);
+ if (momentProperties.length > 0) {
+ for (i in momentProperties) {
+ prop = momentProperties[i];
+ val = from[prop];
+ if (typeof val !== 'undefined') {
+ to[prop] = val;
+ }
+ }
+ }
return to;
}
for (i = 0; i < config._f.length; i++) {
currentScore = 0;
- tempConfig = extend({}, config);
+ tempConfig = copyConfig({}, config);
tempConfig._pf = defaultParsingFlags();
tempConfig._f = config._f[i];
makeDateFromStringAndFormat(tempConfig);
if (moment.isMoment(input)) {
return new Moment(input, true);
-
} else if (format) {
if (isArray(format)) {
makeDateFromStringAndArray(config);