From 08029c7b72a857ffe52f302ed79ae12db9efcc08 Mon Sep 17 00:00:00 2001 From: Dhruv Manek Date: Sun, 18 Dec 2011 18:33:25 -0800 Subject: fix(angular.copy): throw Error if source and destination are identical Closes #693 --- src/Angular.js | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/Angular.js b/src/Angular.js index 2a9fb556..c14c6ea0 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -597,6 +597,7 @@ function copy(source, destination){ } } } else { + if (source === destination) throw Error("Can't copy equivalent objects or arrays"); if (isArray(source)) { while(destination.length) { destination.pop(); -- cgit v1.2.3