Title: [97825] trunk
Revision
97825
Author
[email protected]
Date
2011-10-18 18:49:13 -0700 (Tue, 18 Oct 2011)

Log Message

Date.prototype.toISOString fails to throw exception
https://bugs.webkit.org/show_bug.cgi?id=70394

Reviewed by Sam Weinig.

Source/_javascript_Core: 

* runtime/DatePrototype.cpp:
(JSC::dateProtoFuncToISOString):
    - Should throw a range error if the internal value is not finite.

LayoutTests: 

* fast/js/date-toisostring-expected.txt:
* fast/js/script-tests/date-toisostring.js:
(throwsRangeError):
    - fixed test case.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (97824 => 97825)


--- trunk/LayoutTests/ChangeLog	2011-10-19 01:37:31 UTC (rev 97824)
+++ trunk/LayoutTests/ChangeLog	2011-10-19 01:49:13 UTC (rev 97825)
@@ -1,3 +1,15 @@
+2011-10-18  Gavin Barraclough  <[email protected]>
+
+        Date.prototype.toISOString fails to throw exception
+        https://bugs.webkit.org/show_bug.cgi?id=70394
+
+        Reviewed by Sam Weinig.
+
+        * fast/js/date-toisostring-expected.txt:
+        * fast/js/script-tests/date-toisostring.js:
+        (throwsRangeError):
+            - fixed test case.
+
 2011-10-18  Dirk Pranke  <[email protected]>
 
         fix baseline for fast/history/history-back-twice-with-subframes-assert.html

Modified: trunk/LayoutTests/fast/js/date-toisostring-expected.txt (97824 => 97825)


--- trunk/LayoutTests/fast/js/date-toisostring-expected.txt	2011-10-19 01:37:31 UTC (rev 97824)
+++ trunk/LayoutTests/fast/js/date-toisostring-expected.txt	2011-10-19 01:49:13 UTC (rev 97825)
@@ -12,7 +12,7 @@
 PASS new Date('1 January 100000 UTC').toISOString() is '+100000-01-01T00:00:00.000Z'
 PASS new Date('1 January -1 UTC').toISOString() is '-000001-01-01T00:00:00.000Z'
 PASS new Date('10 March 2000 UTC').toISOString() is '2000-03-10T00:00:00.000Z'
-PASS new Date(NaN).toISOString() is 'Invalid Date'
+PASS throwsRangeError("new Date(NaN).toISOString()") is true
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/js/script-tests/date-toisostring.js (97824 => 97825)


--- trunk/LayoutTests/fast/js/script-tests/date-toisostring.js	2011-10-19 01:37:31 UTC (rev 97824)
+++ trunk/LayoutTests/fast/js/script-tests/date-toisostring.js	2011-10-19 01:49:13 UTC (rev 97825)
@@ -1,5 +1,15 @@
 description("Tests for Date.toISOString");
 
+function throwsRangeError(str)
+{
+    try {
+        eval(str);
+    } catch (e) {
+        return e instanceof RangeError;
+    }
+    return false;
+}
+
 shouldThrow("Date.toISOString.call({})");
 shouldThrow("Date.toISOString.call(0)");
 
@@ -10,6 +20,6 @@
 shouldBe("new Date('1 January 100000 UTC').toISOString()", "'+100000-01-01T00:00:00.000Z'");
 shouldBe("new Date('1 January -1 UTC').toISOString()", "'-000001-01-01T00:00:00.000Z'");
 shouldBe("new Date('10 March 2000 UTC').toISOString()", "'2000-03-10T00:00:00.000Z'");
-shouldBe("new Date(NaN).toISOString()", "'Invalid Date'");
+shouldBeTrue('throwsRangeError("new Date(NaN).toISOString()")');
 
 successfullyParsed = true;

Modified: trunk/Source/_javascript_Core/ChangeLog (97824 => 97825)


--- trunk/Source/_javascript_Core/ChangeLog	2011-10-19 01:37:31 UTC (rev 97824)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-10-19 01:49:13 UTC (rev 97825)
@@ -1,3 +1,14 @@
+2011-10-18  Gavin Barraclough  <[email protected]>
+
+        Date.prototype.toISOString fails to throw exception
+        https://bugs.webkit.org/show_bug.cgi?id=70394
+
+        Reviewed by Sam Weinig.
+
+        * runtime/DatePrototype.cpp:
+        (JSC::dateProtoFuncToISOString):
+            - Should throw a range error if the internal value is not finite.
+
 2011-10-18  Mark Hahnenberg  <[email protected]>
 
         Rename static put to putByIndex
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to