Don't lazy-parse arrow functions if we eager compile them

R=verwaest@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2404913002
Cr-Commit-Position: refs/heads/master@{#40152}
This commit is contained in:
jochen 2016-10-11 01:15:54 -07:00 committed by Commit bot
parent 4e0b685acc
commit 515873cc9b

View File

@ -3941,7 +3941,8 @@ ParserBase<Impl>::ParseArrowFunctionLiteral(
bool is_lazily_parsed =
(mode() == PARSE_LAZILY &&
formal_parameters.scope
->AllowsLazyParsingWithoutUnresolvedVariables());
->AllowsLazyParsingWithoutUnresolvedVariables() &&
eager_compile_hint == FunctionLiteral::kShouldLazyCompile);
// TODO(marja): consider lazy-parsing inner arrow functions too. is_this
// handling in Scope::ResolveVariable needs to change.
if (is_lazily_parsed) {