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

Unified Diff: src/preparser.h

Issue 1431873006: Use a single Token::INIT for all variable initialization (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm, simplify fvar code Created 5 years, 1 month 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/pattern-rewriter.cc ('k') | src/token.h » ('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 17f55b9e385acc33c8819eba859b1800781e8ccb..5b66e9a11401c5406795c891e637bae475cf4b99 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -3013,10 +3013,8 @@ ParserBase<Traits>::ParseAssignmentExpression(bool accept_IN,
// 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_VAR
- || op == Token::INIT_CONST_LEGACY
- || op == Token::ASSIGN)
- && (!right->IsCall() && !right->IsCallNew())) {
+ if ((op == Token::INIT || op == Token::ASSIGN) &&
+ (!right->IsCall() && !right->IsCallNew())) {
fni_->Infer();
} else {
fni_->RemoveLastFunction();
@@ -3329,8 +3327,8 @@ ParserBase<Traits>::ParseLeftHandSideExpression(
// implicit binding assignment to the 'this' variable.
if (is_super_call) {
ExpressionT this_expr = this->ThisExpression(scope_, factory(), pos);
- result = factory()->NewAssignment(Token::INIT_CONST, this_expr,
- result, pos);
+ result =
+ factory()->NewAssignment(Token::INIT, this_expr, result, pos);
}
if (fni_ != NULL) fni_->RemoveLastFunction();
@@ -3617,7 +3615,7 @@ ParserBase<Traits>::ParseStrongSuperCallExpression(
// Explicit calls to the super constructor using super() perform an implicit
// binding assignment to the 'this' variable.
ExpressionT this_expr = this->ThisExpression(scope_, factory(), pos);
- return factory()->NewAssignment(Token::INIT_CONST, this_expr, expr, pos);
+ return factory()->NewAssignment(Token::INIT, this_expr, expr, pos);
}
« no previous file with comments | « src/pattern-rewriter.cc ('k') | src/token.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698