diff options
| author | Igor Minar | 2010-09-22 00:55:09 +0800 |
|---|---|---|
| committer | Misko Hevery | 2010-09-23 17:19:26 +0800 |
| commit | 7cb7fb91c673c006612c38a2ef07d850f642c8df (patch) | |
| tree | f17d8ac3031ebcd7fed4732e3ae18af7e7419e6f /src/Angular.js | |
| parent | 0649009624e8e7bd6fb39537f62c6f00facbfb16 (diff) | |
| download | angular.js-7cb7fb91c673c006612c38a2ef07d850f642c8df.tar.bz2 | |
Add JSDoc for the copy() method
Diffstat (limited to 'src/Angular.js')
| -rw-r--r-- | src/Angular.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Angular.js b/src/Angular.js index e3d33c73..2bd21de4 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -205,6 +205,21 @@ function isLeafNode (node) { return false; } +/** + * Copies stuff. + * + * If destination is not provided and source is an object or an array, a copy is created & returned, + * otherwise the source is returned. + * + * If destination is provided, all of its properties will be deleted and if source is an object or + * an array, all of its members will be copied into the destination object. Finally the destination + * is returned just for kicks. + * + * @param {*} source The source to be used during copy. + * Can be any type including primitives, null and undefined. + * @param {(Object|Array)=} destination Optional destination into which the source is copied + * @return {*} + */ function copy(source, destination){ if (!destination) { if (source) { |
