} else if (typeof input === 'string') {
makeDateFromString(config);
} else if (isArray(input)) {
- config._a = input;
+ config._a = input.slice(0);
dateFromArray(config);
} else {
config._d = input instanceof Date ? input : new Date(input);
test.done();
},
+ "array copying": function(test) {
+ var importantArray = [2009, 11];
+ test.expect(1);
+ moment(importantArray);
+ test.deepEqual(importantArray, [2009, 11], "initializer should not mutate the original array");
+ test.done();
+ },
+
"number" : function(test) {
test.expect(3);
test.ok(moment(1000).toDate() instanceof Date, "1000");