| 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;
|
|
|