Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(812)

Unified Diff: src/dateparser.cc

Issue 1240093005: Fix check for a date with a 24th hour (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Invert if Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/date-parse.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/dateparser.cc
diff --git a/src/dateparser.cc b/src/dateparser.cc
index 0e5cc8c3ef90b94158bd6307acac8dddc99e292f..c0dfb160534572713a2eed9501f9e6a82a37b363 100644
--- a/src/dateparser.cc
+++ b/src/dateparser.cc
@@ -80,7 +80,12 @@ bool DateParser::TimeComposer::Write(FixedArray* output) {
}
if (!IsHour(hour) || !IsMinute(minute) ||
- !IsSecond(second) || !IsMillisecond(millisecond)) return false;
+ !IsSecond(second) || !IsMillisecond(millisecond)) {
+ // A 24th hour is allowed if minutes, seconds, and milliseconds are 0
+ if (hour != 24 || minute != 0 || second != 0 || millisecond != 0) {
+ return false;
+ }
+ }
output->set(HOUR, Smi::FromInt(hour));
output->set(MINUTE, Smi::FromInt(minute));
« no previous file with comments | « no previous file | test/mjsunit/date-parse.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698