Index: src/dateparser-inl.h |
diff --git a/src/dateparser-inl.h b/src/dateparser-inl.h |
index 57e4fa5e6789dd2ee9540d42ea808c6e0e4d1ea9..47a7c6e7ff1e8c8f1b574ad8478574ad80be3d49 100644 |
--- a/src/dateparser-inl.h |
+++ b/src/dateparser-inl.h |
@@ -75,11 +75,12 @@ bool DateParser::Parse(Isolate* isolate, Vector<Char> str, FixedArray* out) { |
if (next_unhandled_token.IsInvalid()) return false; |
bool has_read_number = !day.IsEmpty(); |
// If there's anything left, continue with the legacy parser. |
- bool legacy_parser = !next_unhandled_token.IsEndOfInput(); |
+ bool legacy_parser = false; |
for (DateToken token = next_unhandled_token; |
!token.IsEndOfInput(); |
token = scanner.Next()) { |
if (token.IsNumber()) { |
+ legacy_parser = true; |
has_read_number = true; |
int n = token.number(); |
if (scanner.SkipSymbol(':')) { |
@@ -115,6 +116,7 @@ bool DateParser::Parse(Isolate* isolate, Vector<Char> str, FixedArray* out) { |
scanner.SkipSymbol('-'); |
} |
} else if (token.IsKeyword()) { |
+ legacy_parser = true; |
// Parse a "word" (sequence of chars. >= 'A'). |
KeywordType type = token.keyword_type(); |
int value = token.keyword_value(); |
@@ -133,6 +135,7 @@ bool DateParser::Parse(Isolate* isolate, Vector<Char> str, FixedArray* out) { |
if (scanner.Peek().IsNumber()) return false; |
} |
} else if (token.IsAsciiSign() && (tz.IsUTC() || !time.IsEmpty())) { |
+ legacy_parser = true; |
// Parse UTC offset (only after UTC or time). |
tz.SetSign(token.ascii_sign()); |
// The following number may be empty. |