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

Unified Diff: src/parser.cc

Issue 1356783002: Stop emitting kSloppyLexical errors when --harmony-sloppy-let is enabled (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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 | src/preparser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 6f51d82e643d3e94625bc0505255f173c05efdac..009cf84028526957153d4bd0e169a5dc93f2869a 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -2713,7 +2713,8 @@ Statement* Parser::ParseExpressionOrLabelledStatement(
// Parsed expression statement, followed by semicolon.
// Detect attempts at 'let' declarations in sloppy mode.
- if (peek() == Token::IDENTIFIER && expr->AsVariableProxy() != NULL &&
+ if (!allow_harmony_sloppy_let() && peek() == Token::IDENTIFIER &&
+ expr->AsVariableProxy() != NULL &&
expr->AsVariableProxy()->raw_name() ==
ast_value_factory()->let_string()) {
ReportMessage(MessageTemplate::kSloppyLexical, NULL);
@@ -3792,8 +3793,8 @@ Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels,
// Parsed initializer at this point.
// Detect attempts at 'let' declarations in sloppy mode.
- if (peek() == Token::IDENTIFIER && is_sloppy(language_mode()) &&
- is_let_identifier_expression) {
+ if (!allow_harmony_sloppy_let() && peek() == Token::IDENTIFIER &&
+ is_sloppy(language_mode()) && is_let_identifier_expression) {
ReportMessage(MessageTemplate::kSloppyLexical, NULL);
*ok = false;
return NULL;
« no previous file with comments | « no previous file | src/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698