From d16975a9de41efae81d3e42f4cda695ada2170e9 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Mon, 11 Feb 2013 22:01:15 -0800 Subject: revert: refactor(angular.copy): use slice(0) to clone arrays This reverts commit a5b3bcf41cb0e3130439666a78a0ba9feadbd84a. slice(0) doesn't perform deep copy of the array so its unsuitable for our purposes. --- src/Angular.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/Angular.js b/src/Angular.js index 0548f14b..27ef157d 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -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)) { -- cgit v1.2.3