aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjakub-bochenski2013-09-10 13:37:51 +0200
committerPete Bacon Darwin2013-09-10 22:03:08 +0100
commitce351e69b15c3f55287a976e027e0e75b94aa89f (patch)
tree2388bf4a9bea7e8b27d04d3545c811d67645333e /src
parente4415d21d37dfdba4f93a63735413caf05ee5862 (diff)
downloadangular.js-ce351e69b15c3f55287a976e027e0e75b94aa89f.tar.bz2
docs(angular.copy): clarify corner cases
The behaviour when null or undefined was passed was not clear. The exception thrown when source == destination was not documented. Closes #3946
Diffstat (limited to 'src')
-rw-r--r--src/Angular.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Angular.js b/src/Angular.js
index 0a61d5a9..dbc1ff2e 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -598,7 +598,8 @@ function isLeafNode (node) {
* * If no destination is supplied, a copy of the object or array is created.
* * If a destination is provided, all of its elements (for array) or properties (for objects)
* are deleted and then all elements/properties from the source are copied to it.
- * * If `source` is not an object or array, `source` is returned.
+ * * If `source` is not an object or array (inc. `null` and `undefined`), `source` is returned.
+ * * If `source` is identical to 'destination' an exception will be thrown.
*
* Note: this function is used to augment the Object type in Angular expressions. See
* {@link ng.$filter} for more information about Angular arrays.