// 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);
// 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;
}
// Parsed expression statement.
// Detect attempts at 'let' declarations in sloppy mode.
- if (peek() == Token::IDENTIFIER && is_sloppy(language_mode()) &&
- expr.IsIdentifier() && expr.AsIdentifier().IsLet()) {
+ if (!allow_harmony_sloppy_let() && peek() == Token::IDENTIFIER &&
+ is_sloppy(language_mode()) && expr.IsIdentifier() &&
+ expr.AsIdentifier().IsLet()) {
ReportMessage(MessageTemplate::kSloppyLexical, NULL);
*ok = false;
return Statement::Default();
// 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 Statement::Default();