[OpenLayers-Commits] r12254 - trunk/openlayers/tests/BaseTypes

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Tue Aug 16 22:29:10 EDT 2011


Author: tschaub
Date: 2011-08-16 19:29:09 -0700 (Tue, 16 Aug 2011)
New Revision: 12254

Modified:
   trunk/openlayers/tests/BaseTypes/Date.html
Log:
Updating the date tests to work against Firefox 6 (and any other implementations that throw RangeError). closes #3461

Modified: trunk/openlayers/tests/BaseTypes/Date.html
===================================================================
--- trunk/openlayers/tests/BaseTypes/Date.html	2011-08-17 02:13:06 UTC (rev 12253)
+++ trunk/openlayers/tests/BaseTypes/Date.html	2011-08-17 02:29:09 UTC (rev 12254)
@@ -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");
 
     }



More information about the Commits mailing list