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

Unified Diff: src/parser.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/messages.js ('k') | src/preparser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 08941f501f333511f612603e597e627327fc9373..5f849a599e1715a1198c66fa55d6514ee72a5eb4 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -2156,6 +2156,12 @@ Block* Parser::ParseVariableDeclarations(
bool is_const = false;
Token::Value init_op = Token::INIT_VAR;
if (peek() == Token::VAR) {
+ if (is_strong(language_mode())) {
+ Scanner::Location location = scanner()->peek_location();
+ ReportMessageAt(location, "strong_var");
+ *ok = false;
+ return NULL;
+ }
Consume(Token::VAR);
} else if (peek() == Token::CONST) {
Consume(Token::CONST);
« no previous file with comments | « src/messages.js ('k') | src/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698