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

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

Issue 2694003002: Raise SyntaxError on let [ starting an ExpressionStatement (Closed)
Patch Set: test/message + improve message Created 3 years, 10 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/messages.h ('k') | test/message/let-lexical-declaration-in-single-statement.js » ('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 ad336adcd6b2110e1fa7da79b927e15668c87ff4..bfde23f631f116f95fd31c7cb84826deddf83768 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -4980,6 +4980,12 @@ ParserBase<Impl>::ParseExpressionOrLabelledStatement(
ReportUnexpectedToken(Next());
*ok = false;
return impl()->NullStatement();
+ case Token::LET:
+ if (PeekAhead() != Token::LBRACK) break;
+ impl()->ReportMessageAt(scanner()->peek_location(),
+ MessageTemplate::kUnexpectedLexicalDeclaration);
+ *ok = false;
+ return impl()->NullStatement();
default:
break;
}
« no previous file with comments | « src/messages.h ('k') | test/message/let-lexical-declaration-in-single-statement.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698