Index: src/parser.cc |
diff --git a/src/parser.cc b/src/parser.cc |
index 04d510f2fdcf174fe9615e7e871fc20ae236ff2d..036ec4060d06f8db001e632d1e2e0bcdd87b2f77 100644 |
--- a/src/parser.cc |
+++ b/src/parser.cc |
@@ -2521,6 +2521,16 @@ Expression* Parser::ParseUnaryExpression(bool* ok) { |
} |
} |
Martin Maly
2011/02/14 05:15:22
This is contained in the other CL...
|
+ // "delete identifier" is a syntax error in strict mode. |
+ if (op == Token::DELETE && temp_scope_->StrictMode()) { |
+ VariableProxy* operand = expression->AsVariableProxy(); |
+ if (operand != NULL && !operand->is_this()) { |
+ ReportMessage("strict_delete", Vector<const char*>::empty()); |
+ *ok = false; |
+ return NULL; |
+ } |
+ } |
+ |
return new UnaryOperation(op, expression); |
} else if (Token::IsCountOp(op)) { |