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

Unified Diff: src/parser.cc

Issue 1292393002: [parser] make kInvalidLhsInFor a SyntaxError (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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.h ('k') | src/preparser.h » ('j') | src/preparser.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 301bda94c4011987aff1a704a5f2e6f84d79c137..b7ccff4dd03d0d316e7aa106ba54b2dcbf2eb7a5 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -658,6 +658,13 @@ Expression* ParserTraits::NewThrowSyntaxError(MessageTemplate::Template message,
}
+Expression* ParserTraits::NewThrowSyntaxError(MessageTemplate::Template message,
+ int pos) {
+ return NewThrowError(Runtime::kNewSyntaxError, message,
+ parser_->ast_value_factory()->empty_string(), pos);
+}
+
+
Expression* ParserTraits::NewThrowTypeError(MessageTemplate::Template message,
const AstRawString* arg, int pos) {
return NewThrowError(Runtime::kNewTypeError, message, arg, pos);
@@ -3693,7 +3700,7 @@ Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels,
if (!*ok) return nullptr;
expression = this->CheckAndRewriteReferenceExpression(
expression, lhs_beg_pos, lhs_end_pos,
- MessageTemplate::kInvalidLhsInFor, CHECK_OK);
+ MessageTemplate::kInvalidLhsInFor, kSyntaxError, CHECK_OK);
ForEachStatement* loop =
factory()->NewForEachStatement(mode, labels, stmt_pos);
« no previous file with comments | « src/parser.h ('k') | src/preparser.h » ('j') | src/preparser.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698