| Index: src/parser.cc
|
| diff --git a/src/parser.cc b/src/parser.cc
|
| index 8a47fb9bede5fcd80e89e010334f1e0ccad414b7..05ce9cabfd13b006d935984c60b176fc485fcf0f 100644
|
| --- a/src/parser.cc
|
| +++ b/src/parser.cc
|
| @@ -2689,6 +2689,7 @@ Expression* Parser::ParseAssignmentExpression(bool accept_IN, bool* ok) {
|
| // Assignment to eval or arguments is disallowed in strict mode.
|
| CheckStrictModeLValue(expression, "strict_lhs_assignment", CHECK_OK);
|
| }
|
| + MarkAsUsedAsLValue(expression);
|
|
|
| Token::Value op = Next(); // Get assignment operator.
|
| int pos = scanner().location().beg_pos;
|
| @@ -2922,6 +2923,7 @@ Expression* Parser::ParseUnaryExpression(bool* ok) {
|
| // Prefix expression operand in strict mode may not be eval or arguments.
|
| CheckStrictModeLValue(expression, "strict_lhs_prefix", CHECK_OK);
|
| }
|
| + MarkAsUsedAsLValue(expression);
|
|
|
| int position = scanner().location().beg_pos;
|
| return new(zone()) CountOperation(isolate(),
|
| @@ -2957,6 +2959,7 @@ Expression* Parser::ParsePostfixExpression(bool* ok) {
|
| // Postfix expression operand in strict mode may not be eval or arguments.
|
| CheckStrictModeLValue(expression, "strict_lhs_prefix", CHECK_OK);
|
| }
|
| + MarkAsUsedAsLValue(expression);
|
|
|
| Token::Value next = Next();
|
| int position = scanner().location().beg_pos;
|
| @@ -4315,6 +4318,15 @@ Handle<String> Parser::ParseIdentifierName(bool* ok) {
|
| }
|
|
|
|
|
| +void Parser::MarkAsUsedAsLValue(Expression* expression) {
|
| + VariableProxy* lhs = expression != NULL
|
| + ? expression->AsVariableProxy()
|
| + : NULL;
|
| +
|
| + if (lhs != NULL) lhs->MarkAsUsedAsLValue();
|
| +}
|
| +
|
| +
|
| // Checks LHS expression for assignment and prefix/postfix increment/decrement
|
| // in strict mode.
|
| void Parser::CheckStrictModeLValue(Expression* expression,
|
|
|