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:
Igor Minar 2013-02-11 21:58:00 -08:00
parent 42a5033c56
commit 9e57ce0c7a

View file

@ -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)) {