diff options
| author | Dhruv Manek | 2011-12-18 18:33:25 -0800 |
|---|---|---|
| committer | Igor Minar | 2012-01-06 12:19:39 -0800 |
| commit | 08029c7b72a857ffe52f302ed79ae12db9efcc08 (patch) | |
| tree | b51e6657d2a5f7d373ab67f3a076076001af4162 /src | |
| parent | 0bf611087b2773fd36cf95c938d1cda8e65ffb2b (diff) | |
| download | angular.js-08029c7b72a857ffe52f302ed79ae12db9efcc08.tar.bz2 | |
fix(angular.copy): throw Error if source and destination are identical
Closes #693
Diffstat (limited to 'src')
| -rw-r--r-- | src/Angular.js | 1 |
1 files changed, 1 insertions, 0 deletions
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(); |
