| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent fd80c21 commit ae90bcc
8 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,7 +35,7 @@ | |||
| 35 | 35 | ||
| 36 | 36 | # Reset this number to 0 on major V8 upgrades. | |
| 37 | 37 | # Increment by one for each non-official patch applied to deps/v8. | |
| 38 | - 'v8_embedder_string': '-node.29', | ||
| 38 | + 'v8_embedder_string': '-node.30', | ||
| 39 | 39 | ||
| 40 | 40 | ##### V8 defaults for Node.js ##### | |
| 41 | 41 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -503,7 +503,6 @@ FunctionLiteral* Parser::ParseProgram(Isolate* isolate, ParseInfo* info) { | |||
| 503 | 503 | Scope::DeserializationMode::kIncludingVariables); | |
| 504 | 504 | ||
| 505 | 505 | scanner_.Initialize(); | |
| 506 | - scanner_.SkipHashBang(); | ||
| 507 | 506 | FunctionLiteral* result = DoParseProgram(isolate, info); | |
| 508 | 507 | MaybeResetCharacterStream(info, result); | |
| 509 | 508 | MaybeProcessSourceRanges(info, result, stack_limit_); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -74,10 +74,6 @@ PreParser::PreParseResult PreParser::PreParseProgram() { | |||
| 74 | 74 | scope->set_is_being_lazily_parsed(true); | |
| 75 | 75 | #endif | |
| 76 | 76 | ||
| 77 | - // Note: We should only skip the hashbang in non-Eval scripts | ||
| 78 | - // (currently, Eval is not handled by the PreParser). | ||
| 79 | - scanner()->SkipHashBang(); | ||
| 80 | - | ||
| 81 | 77 | // ModuleDeclarationInstantiation for Source Text Module Records creates a | |
| 82 | 78 | // new Module Environment Record whose outer lexical environment record is | |
| 83 | 79 | // the global scope. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -505,6 +505,10 @@ V8_INLINE Token::Value Scanner::ScanSingleToken() { | |||
| 505 | 505 | return ScanTemplateSpan(); | |
| 506 | 506 | ||
| 507 | 507 | case Token::PRIVATE_NAME: | |
| 508 | + if (source_pos() == 0 && Peek() == '!') { | ||
| 509 | + token = SkipSingleLineComment(); | ||
| 510 | + continue; | ||
| 511 | + } | ||
| 508 | 512 | return ScanPrivateName(); | |
| 509 | 513 | ||
| 510 | 514 | case Token::WHITESPACE: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -314,13 +314,6 @@ Token::Value Scanner::SkipMultiLineComment() { | |||
| 314 | 314 | return Token::ILLEGAL; | |
| 315 | 315 | } | |
| 316 | 316 | ||
| 317 | - void Scanner::SkipHashBang() { | ||
| 318 | - if (c0_ == '#' && Peek() == '!' && source_pos() == 0) { | ||
| 319 | - SkipSingleLineComment(); | ||
| 320 | - Scan(); | ||
| 321 | - } | ||
| 322 | - } | ||
| 323 | - | ||
| 324 | 317 | Token::Value Scanner::ScanHtmlComment() { | |
| 325 | 318 | // Check for <!-- comments. | |
| 326 | 319 | DCHECK_EQ(c0_, '!'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -421,9 +421,6 @@ class V8_EXPORT_PRIVATE Scanner { | |||
| 421 | 421 | ||
| 422 | 422 | const Utf16CharacterStream* stream() const { return source_; } | |
| 423 | 423 | ||
| 424 | - // If the next characters in the stream are "#!", the line is skipped. | ||
| 425 | - void SkipHashBang(); | ||
| 426 | - | ||
| 427 | 424 | private: | |
| 428 | 425 | // Scoped helper for saving & restoring scanner error state. | |
| 429 | 426 | // This is used for tagged template literals, in which normally forbidden | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,12 @@ | |||
| 1 | + #!/usr/bin/env d8 | ||
| 2 | + // Copyright 2015 the V8 project authors. All rights reserved. | ||
| 3 | + // Use of this source code is governed by a BSD-style license that can be | ||
| 4 | + // found in the LICENSE file. | ||
| 5 | + // | ||
| 6 | + // | ||
| 7 | + | ||
| 8 | + const x = 'valid code'; | ||
| 9 | + | ||
| 10 | + 'incomplete string | ||
| 11 | + | ||
| 12 | + const y = 'even more valid code!'; | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,5 @@ | |||
| 1 | + *%(basename)s:10: SyntaxError: Invalid or unexpected token | ||
| 2 | + 'incomplete string | ||
| 3 | + ^^^^^^^^^^^^^^^^^^ | ||
| 4 | + | ||
| 5 | + SyntaxError: Invalid or unexpected token | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments