From 7cb7fb91c673c006612c38a2ef07d850f642c8df Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Wed, 22 Sep 2010 00:55:09 +0800 Subject: Add JSDoc for the copy() method --- src/Angular.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/Angular.js') 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) { -- cgit v1.2.3