From 24e5350ca1823f3311bc282f3d7c64060f556768 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Tue, 1 Dec 2009 08:33:55 -0800 Subject: [PATCH] clone --- dygraph.js | 8 +++++++- tests/missing-data.html | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/dygraph.js b/dygraph.js index b16c3d2..8b06979 100644 --- a/dygraph.js +++ b/dygraph.js @@ -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 diff --git a/tests/missing-data.html b/tests/missing-data.html index 6d363fa..39626cc 100644 --- a/tests/missing-data.html +++ b/tests/missing-data.html @@ -21,7 +21,7 @@