aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Angular.js15
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) {