From 8bae559da5cf426bb5dfd0a88942d47b7011fcae Mon Sep 17 00:00:00 2001 From: Manuel Luis SanmartĂ­n Rozada Date: Fri, 1 Aug 2014 00:26:22 +0200 Subject: jsrrdgraph: Fix error functions. Error prototype. --- js/RrdGraph.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'js/RrdGraph.js') diff --git a/js/RrdGraph.js b/js/RrdGraph.js index 48b9814..a3b0124 100644 --- a/js/RrdGraph.js +++ b/js/RrdGraph.js @@ -27,10 +27,10 @@ */ var RrdGraphDescError = function (message) { - this.prototype = Error.prototype; this.name = "RrdGraphDescError"; this.message = (message) ? message : "Error"; }; +RrdGraphDescError.prototype = new Error(); /** * RrdGraphDesc @@ -393,10 +393,11 @@ RrdGraphDesc.prototype.hrule = function (graph, value, color, legend) */ var RrdVdefError = function (message) { - this.prototype = Error.prototype; this.name = "RrdVdefError"; this.message = (message) ? message : "Error"; }; +RrdVdefError.prototype = new Error(); + /** * RrdVdef @@ -694,10 +695,10 @@ RrdVdef.prototype.calc = function(src) */ var RrdGraphError = function (message) { - this.prototype = Error.prototype; this.name = "RrdGraphError"; this.message = (message) ? message : "Error"; }; +RrdGraphError.prototype = new Error(); /** * RrdGraph -- cgit v1.1