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

Unified Diff: src/parsing/scanner.cc

Issue 2009963002: [modules] Disable HTML-like comments Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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 | « src/parsing/scanner.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/scanner.cc
diff --git a/src/parsing/scanner.cc b/src/parsing/scanner.cc
index 6a9b32e63461f3b12e334546d8b94db6c48d49d7..e90a08081b047442b57b7f278da2d7f89d941ab4 100644
--- a/src/parsing/scanner.cc
+++ b/src/parsing/scanner.cc
@@ -42,6 +42,7 @@ Scanner::Scanner(UnicodeCache* unicode_cache)
octal_pos_(Location::invalid()),
decimal_with_leading_zero_pos_(Location::invalid()),
found_html_comment_(false),
+ module_(false),
adamk 2016/05/25 20:43:02 Please call this "allow_html_comments_" instead.
mike3 2016/05/25 21:10:13 Acknowledged.
allow_harmony_exponentiation_operator_(false) {
bookmark_current_.literal_chars = &bookmark_current_literal_;
bookmark_current_.raw_literal_chars = &bookmark_current_raw_literal_;
@@ -329,7 +330,7 @@ bool Scanner::SkipWhiteSpace() {
Advance();
if (c0_ == '-') {
Advance();
- if (c0_ == '>') {
+ if (c0_ == '>' && !module_) {
// Treat the rest of the line as a comment.
SkipSingleLineComment();
// Continue skipping white space after the comment.
@@ -454,7 +455,7 @@ Token::Value Scanner::ScanHtmlComment() {
Advance();
if (c0_ == '-') {
Advance();
- if (c0_ == '-') {
+ if (c0_ == '-' && !module_) {
found_html_comment_ = true;
return SkipSingleLineComment();
}
@@ -564,7 +565,7 @@ void Scanner::Scan() {
Advance();
if (c0_ == '-') {
Advance();
- if (c0_ == '>' && has_line_terminator_before_next_) {
+ if (c0_ == '>' && has_line_terminator_before_next_ && !module_) {
// For compatibility with SpiderMonkey, we skip lines that
// start with an HTML comment end '-->'.
token = SkipSingleLineComment();
« no previous file with comments | « src/parsing/scanner.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698