new Date(NaN).toJSON() must return null instead of throwing a TypeError
[WebKit-https.git] / LayoutTests / js / resources / JSON-stringify.js
index bec1885..e1e3e60 100644 (file)
@@ -101,6 +101,10 @@ function createTests() {
     });
     result[result.length - 1].throws = true;
     result.push(function(jsonObject){
+        return jsonObject.stringify(new Date(NaN));
+    });
+    result[result.length - 1].expected = 'null';;
+    result.push(function(jsonObject){
         var d = new Date(0);
         d.toISOString = null;
         return jsonObject.stringify(d);