aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjakub-bochenski2013-09-10 13:37:51 +0200
committerPete Bacon Darwin2013-09-10 22:07:22 +0100
commitf102fb75b6d83085bd4832d9c8bb02475cc22875 (patch)
tree3b819072628af2c886b269dc00feff9e393ecf1e /src
parent8a7240ddfd682448fff52f2cad0a2b5d0131f0f4 (diff)
downloadangular.js-f102fb75b6d83085bd4832d9c8bb02475cc22875.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 298d6406..9ef10410 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -578,7 +578,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.