mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
revert: refactor(angular.copy): use slice(0) to clone arrays
This reverts commit 28273b7f1ef52e46d5bc23c41bc7a1492cf23014o. slice(0) doesn't perform deep copy of the array so its unsuitable for our purposes.
This commit is contained in:
parent
42a5033c56
commit
9e57ce0c7a
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