Index: src/parser.cc |
diff --git a/src/parser.cc b/src/parser.cc |
index a0f3b7147f20eda1457d4f41276c550d70b2b612..515eff3fb5428ff53ab0012fa51e38f379b4c109 100644 |
--- a/src/parser.cc |
+++ b/src/parser.cc |
@@ -1692,11 +1692,13 @@ Statement* Parser::ParseExpressionOrLabelledStatement(ZoneStringList* labels, |
// ExpressionStatement | LabelledStatement :: |
// Expression ';' |
// Identifier ':' Statement |
- |
+ bool starts_with_idenfifier = (peek() == Token::IDENTIFIER); |
Expression* expr = ParseExpression(true, CHECK_OK); |
- if (peek() == Token::COLON && expr && |
+ if (peek() == Token::COLON && starts_with_idenfifier && expr && |
expr->AsVariableProxy() != NULL && |
!expr->AsVariableProxy()->is_this()) { |
+ // Expression is a single identifier, and not, e.g., a parenthesized |
+ // identifier. |
VariableProxy* var = expr->AsVariableProxy(); |
Handle<String> label = var->name(); |
// TODO(1240780): We don't check for redeclaration of labels |