8000 revert: refactor(angular.copy): use slice(0) to clone arrays · Tosscode/angular.js@9e57ce0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9e57ce0

Browse files
committed
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.
1 parent 42a5033 commit 9e57ce0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Angular.js

Lines changed: 1 addition & 2 deletions
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)
0