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

Unified Diff: src/parsing/scanner.cc

Issue 1641673002: Add use counters for how often we encounter html comments in scripts (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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') | no next file » | 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 79e431f2e1e97c4538a521d0c11665a0ca72348a..5e34c2e018d57182db8a28434b10024ac3dca279 100644
--- a/src/parsing/scanner.cc
+++ b/src/parsing/scanner.cc
@@ -39,7 +39,8 @@ void Utf16CharacterStream::ResetToBookmark() { UNREACHABLE(); }
Scanner::Scanner(UnicodeCache* unicode_cache)
: unicode_cache_(unicode_cache),
bookmark_c0_(kNoBookmark),
- octal_pos_(Location::invalid()) {
+ octal_pos_(Location::invalid()),
+ found_html_comment_(false) {
bookmark_current_.literal_chars = &bookmark_current_literal_;
bookmark_current_.raw_literal_chars = &bookmark_current_raw_literal_;
bookmark_next_.literal_chars = &bookmark_next_literal_;
@@ -438,7 +439,10 @@ Token::Value Scanner::ScanHtmlComment() {
Advance();
if (c0_ == '-') {
Advance();
- if (c0_ == '-') return SkipSingleLineComment();
+ if (c0_ == '-') {
+ found_html_comment_ = true;
+ return SkipSingleLineComment();
+ }
PushBack('-'); // undo Advance()
}
PushBack('!'); // undo Advance()
« no previous file with comments | « src/parsing/scanner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698