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

Unified Diff: src/preparser.cc

Issue 209993002: Parser fix: check allow_harmony_scoping() instead of FLAG_harmony_scoping. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: preparser too Created 6 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/parser.cc ('k') | no next file » | 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 31c73883e7d6cad78c8100667eadecc18fcf1e3f..9bcc88002d03cd1a02c9c6f6942c9e21d8d7b749 100644
--- a/src/preparser.cc
+++ b/src/preparser.cc
@@ -379,7 +379,7 @@ PreParser::Statement PreParser::ParseBlock(bool* ok) {
//
Expect(Token::LBRACE, CHECK_OK);
while (peek() != Token::RBRACE) {
- if (FLAG_harmony_scoping && strict_mode() == STRICT) {
+ if (allow_harmony_scoping() && strict_mode() == STRICT) {
ParseSourceElement(CHECK_OK);
} else {
ParseStatement(CHECK_OK);
@@ -444,7 +444,7 @@ PreParser::Statement PreParser::ParseVariableDeclarations(
// non-harmony semantics in sloppy mode.
Consume(Token::CONST);
if (strict_mode() == STRICT) {
- if (FLAG_harmony_scoping) {
+ if (allow_harmony_scoping()) {
if (var_context != kSourceElement && var_context != kForStatement) {
ReportMessageAt(scanner()->peek_location(), "unprotected_const");
*ok = false;
@@ -467,7 +467,7 @@ PreParser::Statement PreParser::ParseVariableDeclarations(
// contained in extended code.
//
// TODO(rossberg): make 'let' a legal identifier in sloppy mode.
- if (!FLAG_harmony_scoping || strict_mode() == SLOPPY) {
+ if (!allow_harmony_scoping() || strict_mode() == SLOPPY) {
ReportMessageAt(scanner()->peek_location(), "illegal_let");
*ok = false;
return Statement::Default();
« no previous file with comments | « src/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698