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

Unified Diff: src/preparser.h

Issue 932833002: [strong] Deprecate delete (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase & merge conflicts Created 5 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
« no previous file with comments | « src/messages.js ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index 9f8fc13653a893d8c2adc7fcc2884773f2fd8f34..e82753c08e7599be5252eb2ad625e0d89d4f4c7a 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -2497,12 +2497,17 @@ ParserBase<Traits>::ParseUnaryExpression(bool* ok) {
int pos = position();
ExpressionT expression = ParseUnaryExpression(CHECK_OK);
- // "delete identifier" is a syntax error in strict mode.
- if (op == Token::DELETE && is_strict(language_mode()) &&
- this->IsIdentifier(expression)) {
- ReportMessage("strict_delete");
- *ok = false;
- return this->EmptyExpression();
+ if (op == Token::DELETE && is_strict(language_mode())) {
+ if (is_strong(language_mode())) {
+ ReportMessage("strong_delete");
+ *ok = false;
+ return this->EmptyExpression();
+ } else if (this->IsIdentifier(expression)) {
+ // "delete identifier" is a syntax error in strict mode.
+ ReportMessage("strict_delete");
+ *ok = false;
+ return this->EmptyExpression();
+ }
}
// Allow Traits do rewrite the expression.
« no previous file with comments | « src/messages.js ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698