[parser] Minor Token::INIT cleanup.
Here the token cannot be Token::INIT since it's coming from the Scanner. Scanner never returns Token::INIT, and Token::INIT is only used internally in the AST. Bug: Change-Id: I185e6d3330651b7ee784b916908e7d8d803b63b9 Reviewed-on: https://chromium-review.googlesource.com/616282 Commit-Queue: Marja Hölttä <marja@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Cr-Commit-Position: refs/heads/master@{#47390}
This commit is contained in:
parent
a67b7aa2cb
commit
2baa9d8188
@ -2887,8 +2887,7 @@ ParserBase<Impl>::ParseAssignmentExpression(bool accept_IN, bool* ok) {
|
||||
// Check if the right hand side is a call to avoid inferring a
|
||||
// name if we're dealing with "a = function(){...}();"-like
|
||||
// expression.
|
||||
if ((op == Token::INIT || op == Token::ASSIGN) &&
|
||||
(!right->IsCall() && !right->IsCallNew())) {
|
||||
if (op == Token::ASSIGN && !right->IsCall() && !right->IsCallNew()) {
|
||||
fni_->Infer();
|
||||
} else {
|
||||
fni_->RemoveLastFunction();
|
||||
@ -2904,6 +2903,7 @@ ParserBase<Impl>::ParseAssignmentExpression(bool accept_IN, bool* ok) {
|
||||
return impl()->RewriteAssignExponentiation(expression, right, pos);
|
||||
}
|
||||
|
||||
DCHECK_NE(op, Token::INIT);
|
||||
ExpressionT result = factory()->NewAssignment(op, expression, right, pos);
|
||||
|
||||
if (is_destructuring_assignment) {
|
||||
|
Loading…
Reference in New Issue
Block a user