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

Unified Diff: src/builtins.cc

Issue 1566973002: [date] Date parser says true even for wrong dates, check twice. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 | src/date.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index 59d04f886107e42b6b31f768def44f673581ab34..ae707a96aaf9742dbb584443419de83a3c9ec3b6 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -2096,7 +2096,9 @@ double ParseDateTimeString(Handle<String> str) {
tmp->get(5)->Number(), tmp->get(6)->Number());
double date = MakeDate(day, time);
if (tmp->get(7)->IsNull()) {
- date = isolate->date_cache()->ToUTC(static_cast<int64_t>(date));
+ if (!std::isnan(date)) {
+ date = isolate->date_cache()->ToUTC(static_cast<int64_t>(date));
+ }
} else {
date -= tmp->get(7)->Number() * 1000.0;
}
« no previous file with comments | « no previous file | src/date.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698