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
This commit is contained in:
Tim Schaub
2011-08-17 02:29:09 +00:00
parent c517de52f5
commit 74af61d898

View File

@@ -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");
}