diff options
| author | jakub-bochenski | 2013-09-10 13:37:51 +0200 |
|---|---|---|
| committer | Pete Bacon Darwin | 2013-09-10 22:03:08 +0100 |
| commit | ce351e69b15c3f55287a976e027e0e75b94aa89f (patch) | |
| tree | 2388bf4a9bea7e8b27d04d3545c811d67645333e /src/Angular.js | |
| parent | e4415d21d37dfdba4f93a63735413caf05ee5862 (diff) | |
| download | angular.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/Angular.js')
| -rw-r--r-- | src/Angular.js | 3 |
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. |
