Index: src/parsing/preparser.cc |
diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc |
index 7f95164412209f2e6c20cda76c9528457dcf91ee..0343b8321b12d66c99cd199a8ca016e64f0a0cf0 100644 |
--- a/src/parsing/preparser.cc |
+++ b/src/parsing/preparser.cc |
@@ -195,6 +195,7 @@ PreParser::Expression PreParser::ParseFunctionLiteral( |
FunctionState function_state(&function_state_, &scope_state_, function_scope); |
DuplicateFinder duplicate_finder(scanner()->unicode_cache()); |
ExpressionClassifier formals_classifier(this, &duplicate_finder); |
+ GetNextFunctionLiteralNum(); |
Expect(Token::LPAREN, CHECK_OK); |
int start_position = scanner()->location().beg_pos; |
@@ -242,6 +243,8 @@ PreParser::Expression PreParser::ParseFunctionLiteral( |
PreParser::LazyParsingResult PreParser::ParseStatementListAndLogFunction( |
PreParserFormalParameters* formals, bool has_duplicate_parameters, |
bool may_abort, bool* ok) { |
+ ResetFunctionLiteralNum(); |
+ |
PreParserStatementList body; |
LazyParsingResult result = ParseStatementList( |
body, Token::RBRACE, may_abort, CHECK_OK_VALUE(kLazyParsingComplete)); |
@@ -254,7 +257,8 @@ PreParser::LazyParsingResult PreParser::ParseStatementListAndLogFunction( |
log_.LogFunction(body_end, formals->num_parameters(), |
formals->function_length, has_duplicate_parameters, |
function_state_->materialized_literal_count(), |
- function_state_->expected_property_count()); |
+ function_state_->expected_property_count(), |
+ GetNextFunctionLiteralNum() - 1); |
return kLazyParsingComplete; |
} |