Bug 730838 - Date.parse accepts non-zero milliseconds for ISO-8601 midnight representation
We forgot to check that the fraction part of second in the date was zero
if the time is midnight.
MozReview-Commit-ID: 7bMzFK8mBnO
--- a/js/src/jsdate.cpp
+++ b/js/src/jsdate.cpp
@@ -870,17 +870,17 @@ ParseISOStyleDate(const CharT* s, size_t
isLocalTime = true;
}
done:
if (year > 275943 // ceil(1e8/365) + 1970
|| (month == 0 || month > 12)
|| (day == 0 || day > size_t(DaysInMonth(year,month)))
|| hour > 24
- || ((hour == 24) && (min > 0 || sec > 0))
+ || ((hour == 24) && (min > 0 || sec > 0 || frac > 0))
|| min > 59
|| sec > 59
|| tzHour > 23
|| tzMin > 59)
{
return false;
}