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

Unified Diff: src/preparser.h

Issue 1531853003: Version 4.7.80.26 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.7
Patch Set: Created 5 years 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') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index 50dbcf1a46310b5bbed950705c2438dec70caae8..85844a08750eac415e72a9747402dc9b6df3e98c 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -2770,7 +2770,7 @@ typename ParserBase<Traits>::ExpressionT ParserBase<Traits>::ParseObjectLiteral(
Expect(Token::LBRACE, CHECK_OK);
while (peek() != Token::RBRACE) {
- if (fni_ != nullptr) fni_->Enter();
+ FuncNameInferrer::State fni_state(fni_);
const bool in_class = false;
const bool is_static = false;
@@ -2801,10 +2801,7 @@ typename ParserBase<Traits>::ExpressionT ParserBase<Traits>::ParseObjectLiteral(
Expect(Token::COMMA, CHECK_OK);
}
- if (fni_ != nullptr) {
- fni_->Infer();
- fni_->Leave();
- }
+ if (fni_ != nullptr) fni_->Infer();
}
Expect(Token::RBRACE, CHECK_OK);
@@ -2906,7 +2903,7 @@ ParserBase<Traits>::ParseAssignmentExpression(bool accept_IN,
return this->ParseYieldExpression(classifier, ok);
}
- if (fni_ != NULL) fni_->Enter();
+ FuncNameInferrer::State fni_state(fni_);
ParserBase<Traits>::Checkpoint checkpoint(this);
ExpressionClassifier arrow_formals_classifier(classifier->duplicate_finder());
bool parenthesized_formals = peek() == Token::LPAREN;
@@ -2941,6 +2938,9 @@ ParserBase<Traits>::ParseAssignmentExpression(bool accept_IN,
}
expression = this->ParseArrowFunctionLiteral(
parameters, arrow_formals_classifier, CHECK_OK);
+
+ if (fni_ != nullptr) fni_->Infer();
+
return expression;
}
@@ -2951,7 +2951,6 @@ ParserBase<Traits>::ParseAssignmentExpression(bool accept_IN,
ExpressionClassifier::FormalParametersProductions);
if (!Token::IsAssignmentOp(peek())) {
- if (fni_ != NULL) fni_->Leave();
// Parsed conditional expression only (no assignment).
return expression;
}
@@ -3002,7 +3001,6 @@ ParserBase<Traits>::ParseAssignmentExpression(bool accept_IN,
} else {
fni_->RemoveLastFunction();
}
- fni_->Leave();
}
return factory()->NewAssignment(op, expression, right, pos);
@@ -3469,7 +3467,7 @@ ParserBase<Traits>::ParseStrongInitializationExpression(
// 'this' '.' IdentifierName '=' AssignmentExpression
// 'this' '[' Expression ']' '=' AssignmentExpression
- if (fni_ != NULL) fni_->Enter();
+ FuncNameInferrer::State fni_state(fni_);
Consume(Token::THIS);
int pos = position();
@@ -3528,7 +3526,6 @@ ParserBase<Traits>::ParseStrongInitializationExpression(
} else {
fni_->RemoveLastFunction();
}
- fni_->Leave();
}
if (function_state_->return_location().IsValid()) {
« no previous file with comments | « src/parser.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698