From 9b1824f561f87d9ce57e1d975d1a893bd5999425 Mon Sep 17 00:00:00 2001 From: jakub-bochenski Date: Tue, 10 Sep 2013 13:37:51 +0200 Subject: [PATCH] docs: update angular.copy for corner cases The behaviour when null or undefined was passed was not clear. The exception thrown when source == destination was not documented. --- src/Angular.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Angular.js b/src/Angular.js index 0a61d5a95eb0..dbc1ff2ea339 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.