Reviewed by Andreas Kling.
REGRESSION: Date.parse("Tue Nov 23 20:40:05 2010 GMT") returns NaN
https://bugs.webkit.org/show_bug.cgi?id=49989
* fast/js/date-parse-test-expected.txt:
* fast/js/script-tests/date-parse-test.js:
2011-02-18 chris reiss <christopher.reiss@nokia.com>
Reviewed by Andreas Kling.
REGRESSION: Date.parse("Tue Nov 23 20:40:05 2010 GMT") returns NaN
https://bugs.webkit.org/show_bug.cgi?id=49989
updated test fast/js/script-tests/date-parse-test.js
* wtf/DateMath.cpp:
(WTF::parseDateFromNullTerminatedCharacters):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@79060
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-02-18 chris reiss <christopher.reiss@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ REGRESSION: Date.parse("Tue Nov 23 20:40:05 2010 GMT") returns NaN
+ https://bugs.webkit.org/show_bug.cgi?id=49989
+
+ * fast/js/date-parse-test-expected.txt:
+ * fast/js/script-tests/date-parse-test.js:
+
2011-02-18 Emil A Eklund <eae@chromium.org>
Reviewed by Darin Adler.
PASS Date.parse("Wed Dec 25 1995 1:30 GMT") == 819855000000 is true
PASS Date.parse("WED DEC 25 1995 1:30 GMT") == 819855000000 is true
PASS Date.parse("wed dec 25 1995 1:30 gmt") == 819855000000 is true
+PASS Date.parse("Wed Dec 25 1:30 1995 GMT") == 819855000000 is true
+PASS Date.parse("WED DEC 25 1:30 1995 GMT") == 819855000000 is true
+PASS Date.parse("wed dec 25 1:30 1995 gmt") == 819855000000 is true
+PASS Date.parse("Wed Dec 25 1:30 1995GMT") == 819855000000 is true
+PASS Date.parse("Wed Dec 25 1:30 1995 2010 GMT") is NaN
+PASS Date.parse("Wed Dec 25 1:30 1995r GMT") is NaN
+PASS Date.parse("Wed 1:30 Dec 25 GMT") is NaN
PASS Date.parse("Dec 25" + String.fromCharCode(9) + "1995 13:30 GMT") == 819898200000 is true
PASS Date.parse(("Dec 25" + String.fromCharCode(9) + "1995 13:30 GMT").toUpperCase()) == 819898200000 is true
PASS Date.parse(("Dec 25" + String.fromCharCode(9) + "1995 13:30 GMT").toLowerCase()) == 819898200000 is true
testDateParse("Anf 25 1995 GMT", "NaN");
testDateParse("Wed Dec 25 1995 1:30 GMT", "819855000000");
+testDateParse("Wed Dec 25 1:30 1995 GMT", "819855000000");
+testDateParseExact("Wed Dec 25 1:30 1995GMT", "819855000000");
+testDateParseExact("Wed Dec 25 1:30 1995 2010 GMT", "NaN");
+testDateParseExact("Wed Dec 25 1:30 1995r GMT", "NaN");
+testDateParseExact("Wed 1:30 Dec 25 GMT", "NaN");
testDateParseExpr('"Dec 25" + String.fromCharCode(9) + "1995 13:30 GMT"', "819898200000");
testDateParseExpr('"Dec 25" + String.fromCharCode(10) + "1995 13:30 GMT"', "819898200000");
testDateParse("Dec 25, 1995, 13:30", "819898200000 + timeZoneOffset");
testDateParse("Dec 25,1995,13:30", "819898200000 + timeZoneOffset");
+
+
var successfullyParsed = true;
+2011-02-18 chris reiss <christopher.reiss@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ REGRESSION: Date.parse("Tue Nov 23 20:40:05 2010 GMT") returns NaN
+ https://bugs.webkit.org/show_bug.cgi?id=49989
+
+ updated test fast/js/script-tests/date-parse-test.js
+
+ * wtf/DateMath.cpp:
+ (WTF::parseDateFromNullTerminatedCharacters):
+
2011-02-18 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r79022.
}
}
}
+
+ // The year may be after the time but before the time zone.
+ if (year <= 0) {
+ if (!parseLong(dateString, &newPosStr, 10, &year))
+ year = 0;
+ dateString = newPosStr;
+ skipSpacesAndComments(dateString);
+ }
// Don't fail if the time zone is missing.
// Some websites omit the time zone (4275206).