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

Unified Diff: src/parsing/parser-base.h

Issue 1891453005: [parser] Relex restriction on reserved words (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Restoring 'let let' case (with explanation) 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 | « no previous file | 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/parser-base.h
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h
index fce632c7741dd42edaa51170416862cfae224b27..6086f7af196b863a590c18a7252fd1f5143a4e5c 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -3243,11 +3243,17 @@ bool ParserBase<Traits>::IsNextLetKeyword() {
case Token::LBRACK:
case Token::IDENTIFIER:
case Token::STATIC:
- case Token::LET: // Yes, you can do let let = ... in sloppy mode
+ case Token::LET: // `let let;` is disallowed by static semantics, but the
+ // token must be first interpreted as a keyword in order
+ // for those semantics to apply. This ensures that ASI is
+ // not honored when a LineTerminator separates the
+ // tokens.
case Token::YIELD:
case Token::AWAIT:
case Token::ASYNC:
return true;
+ case Token::FUTURE_STRICT_RESERVED_WORD:
+ return is_sloppy(language_mode());
default:
return false;
}
« no previous file with comments | « no previous file | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698