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

Unified Diff: src/preparser.h

Issue 345573002: Infer whether a variable is assigned (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: A few more tests Created 6 years, 6 months 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') | src/scopes.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 94f42797740cd27bc31726dd03341fee360a305d..5537e576dab87b8a63cf63e77cedecd32e799510 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -931,10 +931,10 @@ class PreParserTraits {
static void CheckPossibleEvalCall(PreParserExpression expression,
PreParserScope* scope) {}
- static PreParserExpression MarkExpressionAsLValue(
+ static PreParserExpression MarkExpressionAsAssigned(
PreParserExpression expression) {
// TODO(marja): To be able to produce the same errors, the preparser needs
- // to start tracking which expressions are variables and which are lvalues.
+ // to start tracking which expressions are variables and which are assigned.
return expression;
}
@@ -1711,7 +1711,7 @@ ParserBase<Traits>::ParseAssignmentExpression(bool accept_IN, bool* ok) {
expression = this->CheckAndRewriteReferenceExpression(
expression, lhs_location, "invalid_lhs_in_assignment", CHECK_OK);
- expression = this->MarkExpressionAsLValue(expression);
+ expression = this->MarkExpressionAsAssigned(expression);
Token::Value op = Next(); // Get assignment operator.
int pos = position();
@@ -1873,7 +1873,7 @@ ParserBase<Traits>::ParseUnaryExpression(bool* ok) {
ExpressionT expression = this->ParseUnaryExpression(CHECK_OK);
expression = this->CheckAndRewriteReferenceExpression(
expression, lhs_location, "invalid_lhs_in_prefix_op", CHECK_OK);
- this->MarkExpressionAsLValue(expression);
+ this->MarkExpressionAsAssigned(expression);
return factory()->NewCountOperation(op,
true /* prefix */,
@@ -1898,7 +1898,7 @@ ParserBase<Traits>::ParsePostfixExpression(bool* ok) {
Token::IsCountOp(peek())) {
expression = this->CheckAndRewriteReferenceExpression(
expression, lhs_location, "invalid_lhs_in_postfix_op", CHECK_OK);
- expression = this->MarkExpressionAsLValue(expression);
+ expression = this->MarkExpressionAsAssigned(expression);
Token::Value next = Next();
expression =
« no previous file with comments | « src/parser.cc ('k') | src/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698