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

Unified Diff: src/preparser.cc

Issue 1007783002: Remove --harmony-scoping flag. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: CR feedback Created 5 years, 9 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/preparser.h ('k') | src/scanner.h » ('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 e7fff33d3bf7f6d47b96a9debbe5ac7a52c0957f..76f4625f3c69e647057e5aeef6cb1bf8514dbe26 100644
--- a/src/preparser.cc
+++ b/src/preparser.cc
@@ -174,7 +174,6 @@ PreParser::Statement PreParser::ParseStatementListItem(bool* ok) {
case Token::CONST:
return ParseVariableStatement(kStatementListItem, ok);
case Token::LET:
- DCHECK(allow_harmony_scoping());
if (is_strict(language_mode())) {
return ParseVariableStatement(kStatementListItem, ok);
}
@@ -383,7 +382,7 @@ PreParser::Statement PreParser::ParseBlock(bool* ok) {
//
Expect(Token::LBRACE, CHECK_OK);
while (peek() != Token::RBRACE) {
- if (allow_harmony_scoping() && is_strict(language_mode())) {
+ if (is_strict(language_mode())) {
ParseStatementListItem(CHECK_OK);
} else {
ParseStatement(CHECK_OK);
@@ -456,12 +455,6 @@ PreParser::Statement PreParser::ParseVariableDeclarations(
Consume(Token::CONST);
if (is_strict(language_mode())) {
DCHECK(var_context != kStatement);
- if (!allow_harmony_scoping()) {
- Scanner::Location location = scanner()->peek_location();
- ReportMessageAt(location, "strict_const");
- *ok = false;
- return Statement::Default();
- }
is_strict_const = true;
require_initializer = var_context != kForStatement;
}
« no previous file with comments | « src/preparser.h ('k') | src/scanner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698