From 2ffbd4a6df98591a1751d6e0c208289a97f10477 Mon Sep 17 00:00:00 2001 From: Eddie Kay Date: Wed, 26 Oct 2011 11:15:58 -0400 Subject: [PATCH 1/2] Throw IE- and Safari-friendly error upon finding invalid dimensions. --- jquery.flot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery.flot.js b/jquery.flot.js index 0db9fe1..da3e6ff 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -713,7 +713,7 @@ canvasHeight = placeholder.height(); if (canvasWidth <= 0 || canvasHeight <= 0) - throw "Invalid dimensions for plot, width = " + canvasWidth + ", height = " + canvasHeight; + throw new Error("Invalid dimensions for plot, width = " + canvasWidth + ", height = " + canvasHeight); } function resizeCanvas(c) { From 562749758e8584842847fb5ca81951024a5c3359 Mon Sep 17 00:00:00 2001 From: David Schnur Date: Tue, 1 May 2012 19:41:41 -0300 Subject: [PATCH 2/2] Adding a note and credits for a recent pull request merge. --- NEWS.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.txt b/NEWS.txt index 2a6fadb..df48687 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -52,6 +52,8 @@ Bug fixes issue 534). - Prevent i from being declared global in extractRange (reported by Alexander Obukhov, issue 627). +- Throw errors in a more cross-browser-compatible manner (patch by + Eddie Kay) Flot 0.7