diff options
| author | Igor Minar | 2013-02-11 21:58:00 -0800 |
|---|---|---|
| committer | Igor Minar | 2013-02-11 21:58:00 -0800 |
| commit | 9e57ce0c7af742d15223b9d2aa1f9aed5792d007 (patch) | |
| tree | 8b46ced59c27509a799de6950aec297056c10ef2 /src/Angular.js | |
| parent | 42a5033c563fcb3a3f0ddd89ab62ec36d0e73996 (diff) | |
| download | angular.js-9e57ce0c7af742d15223b9d2aa1f9aed5792d007.tar.bz2 | |
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.
Diffstat (limited to 'src/Angular.js')
| -rw-r--r-- | src/Angular.js | 3 |
1 files changed, 1 insertions, 2 deletions
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)) { |
