Index: src/parsing/preparser.cc |
diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc |
index 8712fff3b9896e8bb44bbc5d054c03ba37066121..a392fcf212728a8a61ee40b80ecfcb899245e09f 100644 |
--- a/src/parsing/preparser.cc |
+++ b/src/parsing/preparser.cc |
@@ -279,14 +279,13 @@ PreParser::Statement PreParser::ParseStatement( |
} |
PreParser::Statement PreParser::ParseScopedStatement(bool legacy, bool* ok) { |
- if (is_strict(language_mode()) || peek() != Token::FUNCTION || |
- (legacy && allow_harmony_restrictive_declarations())) { |
- return ParseSubStatement(kDisallowLabelledFunctionStatement, ok); |
- } else { |
adamk
2016/05/02 21:38:55
Your compiler really can't tell that an unconditio
|
+ if (!(is_strict(language_mode()) || peek() != Token::FUNCTION || |
+ (legacy && allow_harmony_restrictive_declarations()))) { |
Scope* body_scope = NewScope(scope_, BLOCK_SCOPE); |
BlockState block_state(&scope_, body_scope); |
return ParseFunctionDeclaration(CHECK_OK); |
adamk
2016/05/02 22:01:15
If it's only about CHECK_OK, then this can safely
|
} |
+ return ParseSubStatement(kDisallowLabelledFunctionStatement, ok); |
} |
PreParser::Statement PreParser::ParseSubStatement( |