Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Unified Diff: src/parser.cc

Issue 6515005: Strict mode delete. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)) {

Powered by Google App Engine
This is Rietveld 408576698