From: Dan Vanderkam Date: Tue, 1 Dec 2009 16:33:55 +0000 (-0800) Subject: clone X-Git-Tag: v1.0.0~832 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=24e5350ca1823f3311bc282f3d7c64060f556768;p=dygraphs.git clone --- 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 @@