Skip to content

Commit d16975a

Browse files
committed
revert: refactor(angular.copy): use slice(0) to clone arrays
This reverts commit a5b3bcf. slice(0) doesn't perform deep copy of the array so its unsuitable for our purposes.
1 parent 87f6b36 commit d16975a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Angular.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,7 @@ function copy(source, destination){
556556
destination = source;
557557
if (source) {
558558
if (isArray(source)) {
559-
// http://jsperf.com/copy-array-with-slice-vs-for
560-
destination = source.slice(0);
559+
destination = copy(source, []);
561560
} else if (isDate(source)) {
562561
destination = new Date(source.getTime());
563562
} else if (isObject(source)) {

0 commit comments

Comments
 (0)