mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-13 08:56:40 +08:00
revert: refactor(angular.copy): use slice(0) to clone arrays
This reverts commit a5b3bcf41c.
slice(0) doesn't perform deep copy of the array so its unsuitable
for our purposes.
This commit is contained in:
@@ -556,8 +556,7 @@ function copy(source, destination){
|
||||
destination = source;
|
||||
if (source) {
|
||||
if (isArray(source)) {
|
||||
// http://jsperf.com/copy-array-with-slice-vs-for
|
||||
destination = source.slice(0);
|
||||
destination = copy(source, []);
|
||||
} else if (isDate(source)) {
|
||||
destination = new Date(source.getTime());
|
||||
} else if (isObject(source)) {
|
||||
|
||||
Reference in New Issue
Block a user