clone
[dygraphs.git] / dygraph.js
index b16c3d2..8b06979 100644 (file)
@@ -1569,7 +1569,7 @@ Dygraph.prototype.parseDataTable_ = function(data) {
   return ret;
 }
 
-// These functions are both based on MochiKit.
+// These functions are all based on MochiKit.
 Dygraph.isArrayLike = function (o) {
   var typ = typeof(o);
   if (
@@ -1592,6 +1592,12 @@ Dygraph.isDateLike = function (o) {
   return true;
 };
 
+Dygraph.clone = function(obj) {
+  var me = arguments.callee;
+  me.prototype = obj;
+  return new me();
+};
+
 
 /**
  * Get the CSV data. If it's in a function, call that function. If it's in a