From 74af61d898726124b8c16922997cb973e29ccfae Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Wed, 17 Aug 2011 02:29:09 +0000 Subject: [PATCH] Updating the date tests to work against Firefox 6 (and any other implementations that throw RangeError). closes #3461 git-svn-id: http://svn.openlayers.org/trunk/openlayers@12254 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- tests/BaseTypes/Date.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/BaseTypes/Date.html b/tests/BaseTypes/Date.html index d32b8bbdd7..2597207d77 100644 --- a/tests/BaseTypes/Date.html +++ b/tests/BaseTypes/Date.html @@ -20,7 +20,15 @@ // check invalid date date = new Date("foo"); - str = OpenLayers.Date.toISOString(date); + try { + str = OpenLayers.Date.toISOString(date); + } catch (err) { + // some implementations throw RangeError + // see https://bugzilla.mozilla.org/show_bug.cgi?id=649575 + if (err instanceof RangeError) { + str = "Invalid Date"; + } + } t.eq(str, "Invalid Date", "invalid date"); }