diff --git a/common.gypi b/common.gypi index 7f87a8cc1fea13..ba8745c77ae112 100644 --- a/common.gypi +++ b/common.gypi @@ -35,7 +35,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.30', + 'v8_embedder_string': '-node.31', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/parsing/parser.cc b/deps/v8/src/parsing/parser.cc index edb9604bb5cfd1..a05884adc0d2d2 100644 --- a/deps/v8/src/parsing/parser.cc +++ b/deps/v8/src/parsing/parser.cc @@ -503,7 +503,6 @@ FunctionLiteral* Parser::ParseProgram(Isolate* isolate, ParseInfo* info) { Scope::DeserializationMode::kIncludingVariables); scanner_.Initialize(); - scanner_.SkipHashBang(); FunctionLiteral* result = DoParseProgram(isolate, info); MaybeResetCharacterStream(info, result); MaybeProcessSourceRanges(info, result, stack_limit_); diff --git a/deps/v8/src/parsing/preparser.cc b/deps/v8/src/parsing/preparser.cc index 67ee1930accaca..c25ed2f8dd4cb8 100644 --- a/deps/v8/src/parsing/preparser.cc +++ b/deps/v8/src/parsing/preparser.cc @@ -74,10 +74,6 @@ PreParser::PreParseResult PreParser::PreParseProgram() { scope->set_is_being_lazily_parsed(true); #endif - // Note: We should only skip the hashbang in non-Eval scripts - // (currently, Eval is not handled by the PreParser). - scanner()->SkipHashBang(); - // ModuleDeclarationInstantiation for Source Text Module Records creates a // new Module Environment Record whose outer lexical environment record is // the global scope. diff --git a/deps/v8/src/parsing/scanner-inl.h b/deps/v8/src/parsing/scanner-inl.h index b76076d92ffaaa..53b53cb9981259 100644 --- a/deps/v8/src/parsing/scanner-inl.h +++ b/deps/v8/src/parsing/scanner-inl.h @@ -505,6 +505,10 @@ V8_INLINE Token::Value Scanner::ScanSingleToken() { return ScanTemplateSpan(); case Token::PRIVATE_NAME: + if (source_pos() == 0 && Peek() == '!') { + token = SkipSingleLineComment(); + continue; + } return ScanPrivateName(); case Token::WHITESPACE: diff --git a/deps/v8/src/parsing/scanner.cc b/deps/v8/src/parsing/scanner.cc index 28e43747874605..d444719f638906 100644 --- a/deps/v8/src/parsing/scanner.cc +++ b/deps/v8/src/parsing/scanner.cc @@ -314,13 +314,6 @@ Token::Value Scanner::SkipMultiLineComment() { return Token::ILLEGAL; } -void Scanner::SkipHashBang() { - if (c0_ == '#' && Peek() == '!' && source_pos() == 0) { - SkipSingleLineComment(); - Scan(); - } -} - Token::Value Scanner::ScanHtmlComment() { // Check for