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

Unified Diff: src/preparser.h

Issue 1059273004: [strong] Implement static restrictions on direct eval (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: cr feedback Created 5 years, 8 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/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index 0b00f819abe1f1bcc0543c7f823b8981ee3a2cfb..219fe2de5a0d2abcca6e416027bdf9d63d6c6a1a 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -2804,6 +2804,12 @@ ParserBase<Traits>::ParseLeftHandSideExpression(bool* ok) {
}
case Token::LPAREN: {
+ if (is_strong(language_mode()) && this->IsIdentifier(result) &&
+ this->IsEval(this->AsIdentifier(result))) {
+ ReportMessage("strong_direct_eval");
+ *ok = false;
+ return this->EmptyExpression();
+ }
int pos;
if (scanner()->current_token() == Token::IDENTIFIER) {
// For call of an identifier we want to report position of
« no previous file with comments | « src/messages.js ('k') | test/cctest/test-parsing.cc » ('j') | test/cctest/test-parsing.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698