diff options
author | Michaël Zasso <mic.besace@gmail.com> | 2015-10-22 10:36:00 +0200 |
---|---|---|
committer | Michaël Zasso <mic.besace@gmail.com> | 2015-10-23 07:57:56 +0200 |
commit | 6456fcf4f35cd781d1dabbcd4ccfbbf9d21b55f6 (patch) | |
tree | 0f383eac0ee72d0f769cc72c9939d15b84528abb /deps/v8/src | |
parent | 68471dd37c3e1e6cdbe107503e738bc0e0ea2d4b (diff) | |
download | node-new-6456fcf4f35cd781d1dabbcd4ccfbbf9d21b55f6.tar.gz |
deps: update V8 to 4.6.85.28
This update fixes a breaking regression in the date parser.
Ref: https://code.google.com/p/chromium/issues/detail?id=539813
Ref: https://code.google.com/p/chromium/issues/detail?id=543320
PR-URL: https://github.com/nodejs/node/pull/3484
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'deps/v8/src')
-rw-r--r-- | deps/v8/src/dateparser-inl.h | 24 | ||||
-rw-r--r-- | deps/v8/src/dateparser.h | 4 |
2 files changed, 16 insertions, 12 deletions
diff --git a/deps/v8/src/dateparser-inl.h b/deps/v8/src/dateparser-inl.h index 8973aa0d4f..d405ab6493 100644 --- a/deps/v8/src/dateparser-inl.h +++ b/deps/v8/src/dateparser-inl.h @@ -23,9 +23,9 @@ bool DateParser::Parse(Vector<Char> str, DayComposer day; // Specification: - // Accept ES6 ISO 8601 date-time-strings or legacy dates compatible + // Accept ES5 ISO 8601 date-time-strings or legacy dates compatible // with Safari. - // ES6 ISO 8601 dates: + // ES5 ISO 8601 dates: // [('-'|'+')yy]yyyy[-MM[-DD]][THH:mm[:ss[.sss]][Z|(+|-)hh:mm]] // where yyyy is in the range 0000..9999 and // +/-yyyyyy is in the range -999999..+999999 - @@ -40,7 +40,8 @@ bool DateParser::Parse(Vector<Char> str, // sss is in the range 000..999, // hh is in the range 00..23, // mm, ss, and sss default to 00 if missing, and - // timezone defaults to local time if missing. + // timezone defaults to Z if missing + // (following Safari, ISO actually demands local time). // Extensions: // We also allow sss to have more or less than three digits (but at // least one). @@ -62,13 +63,15 @@ bool DateParser::Parse(Vector<Char> str, // is allowed). // Intersection of the two: // A string that matches both formats (e.g. 1970-01-01) will be - // parsed as an ES6 date-time string. - // After a valid "T" has been read while scanning an ES6 datetime string, + // parsed as an ES5 date-time string - which means it will default + // to UTC time-zone. That's unavoidable if following the ES5 + // specification. + // After a valid "T" has been read while scanning an ES5 datetime string, // the input can no longer be a valid legacy date, since the "T" is a // garbage string after a number has been read. - // First try getting as far as possible with as ES6 Date Time String. - DateToken next_unhandled_token = ParseES6DateTime(&scanner, &day, &time, &tz); + // First try getting as far as possible with as ES5 Date Time String. + DateToken next_unhandled_token = ParseES5DateTime(&scanner, &day, &time, &tz); if (next_unhandled_token.IsInvalid()) return false; bool has_read_number = !day.IsEmpty(); // If there's anything left, continue with the legacy parser. @@ -193,7 +196,7 @@ DateParser::DateToken DateParser::DateStringTokenizer<CharType>::Scan() { template <typename Char> -DateParser::DateToken DateParser::ParseES6DateTime( +DateParser::DateToken DateParser::ParseES5DateTime( DateStringTokenizer<Char>* scanner, DayComposer* day, TimeComposer* time, @@ -231,7 +234,7 @@ DateParser::DateToken DateParser::ParseES6DateTime( if (!scanner->Peek().IsKeywordType(TIME_SEPARATOR)) { if (!scanner->Peek().IsEndOfInput()) return scanner->Next(); } else { - // ES6 Date Time String time part is present. + // ES5 Date Time String time part is present. scanner->Next(); if (!scanner->Peek().IsFixedLengthNumber(2) || !Between(scanner->Peek().number(), 0, 24)) { @@ -297,7 +300,8 @@ DateParser::DateToken DateParser::ParseES6DateTime( } if (!scanner->Peek().IsEndOfInput()) return DateToken::Invalid(); } - // Successfully parsed ES6 Date Time String. + // Successfully parsed ES5 Date Time String. Default to UTC if no TZ given. + if (tz->IsEmpty()) tz->Set(0); day->set_iso_date(); return DateToken::EndOfInput(); } diff --git a/deps/v8/src/dateparser.h b/deps/v8/src/dateparser.h index a9db8685d9..aa57bb1c66 100644 --- a/deps/v8/src/dateparser.h +++ b/deps/v8/src/dateparser.h @@ -368,13 +368,13 @@ class DateParser : public AllStatic { bool is_iso_date_; }; - // Tries to parse an ES6 Date Time String. Returns the next token + // Tries to parse an ES5 Date Time String. Returns the next token // to continue with in the legacy date string parser. If parsing is // complete, returns DateToken::EndOfInput(). If terminally unsuccessful, // returns DateToken::Invalid(). Otherwise parsing continues in the // legacy parser. template <typename Char> - static DateParser::DateToken ParseES6DateTime( + static DateParser::DateToken ParseES5DateTime( DateStringTokenizer<Char>* scanner, DayComposer* day, TimeComposer* time, |