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

Unified Diff: src/preparser.cc

Issue 927953003: [strong] Forbid var. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: loop w const omg 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/parser.cc ('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.cc
diff --git a/src/preparser.cc b/src/preparser.cc
index 8c61b7db85159a6405abada086faee0c6b535767..964cdbf9fb9e5d6d24c70fdbf5eded829fa7e38b 100644
--- a/src/preparser.cc
+++ b/src/preparser.cc
@@ -429,6 +429,12 @@ PreParser::Statement PreParser::ParseVariableDeclarations(
bool require_initializer = false;
bool is_strict_const = false;
if (peek() == Token::VAR) {
+ if (is_strong(language_mode())) {
+ Scanner::Location location = scanner()->peek_location();
+ ReportMessageAt(location, "strong_var");
+ *ok = false;
+ return Statement::Default();
+ }
Consume(Token::VAR);
} else if (peek() == Token::CONST) {
// TODO(ES6): The ES6 Draft Rev4 section 12.2.2 reads:
« no previous file with comments | « src/parser.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698