mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00: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:
parent
87f6b36bab
commit
d16975a9de
1 changed files with 1 additions and 2 deletions
|
|
@ -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)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue