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

Unified Diff: src/preparser.cc

Issue 196343033: Make PreParser track valid left hand sides. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: rebased Created 6 years, 9 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/preparser.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.cc
diff --git a/src/preparser.cc b/src/preparser.cc
index 398f32744cb61ff6c5e5af317d22b8d117f37b9f..474e642ad350a07272d9b04e70766a6610716df9 100644
--- a/src/preparser.cc
+++ b/src/preparser.cc
@@ -874,7 +874,7 @@ PreParser::Expression PreParser::ParseLeftHandSideExpression(bool* ok) {
if (result.IsThis()) {
result = Expression::ThisProperty();
} else {
- result = Expression::Default();
+ result = Expression::Property();
}
break;
}
@@ -891,7 +891,7 @@ PreParser::Expression PreParser::ParseLeftHandSideExpression(bool* ok) {
if (result.IsThis()) {
result = Expression::ThisProperty();
} else {
- result = Expression::Default();
+ result = Expression::Property();
}
break;
}
@@ -913,13 +913,17 @@ PreParser::Expression PreParser::ParseMemberWithNewPrefixesExpression(
if (peek() == Token::NEW) {
Consume(Token::NEW);
ParseMemberWithNewPrefixesExpression(CHECK_OK);
+ Expression expression = Expression::Default();
if (peek() == Token::LPAREN) {
// NewExpression with arguments.
ParseArguments(CHECK_OK);
- // The expression can still continue with . or [ after the arguments.
- ParseMemberExpressionContinuation(Expression::Default(), CHECK_OK);
+ // The expression can still continue with . or [ after the arguments. Here
+ // we need to transmit the "is valid left hand side" property of the
+ // expression.
+ expression =
+ ParseMemberExpressionContinuation(Expression::Default(), CHECK_OK);
}
- return Expression::Default();
+ return expression;
}
// No 'new' keyword.
return ParseMemberExpression(ok);
@@ -980,7 +984,7 @@ PreParser::Expression PreParser::ParseMemberExpressionContinuation(
if (expression.IsThis()) {
expression = Expression::ThisProperty();
} else {
- expression = Expression::Default();
+ expression = Expression::Property();
}
break;
}
@@ -990,7 +994,7 @@ PreParser::Expression PreParser::ParseMemberExpressionContinuation(
if (expression.IsThis()) {
expression = Expression::ThisProperty();
} else {
- expression = Expression::Default();
+ expression = Expression::Property();
}
break;
}
@@ -1102,7 +1106,6 @@ PreParser::Expression PreParser::ParseFunctionLiteral(
int end_position = scanner()->location().end_pos;
CheckOctalLiteral(start_position, end_position, CHECK_OK);
- return Expression::StrictFunction();
}
return Expression::Default();
« no previous file with comments | « src/preparser.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698