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

Unified Diff: src/parsing/pattern-rewriter.cc

Issue 1657783002: Gracefully handle syntax errors in Parser::PatternRewriter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Unit test. Created 4 years, 11 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/parsing/parser.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/parsing/pattern-rewriter.cc
diff --git a/src/parsing/pattern-rewriter.cc b/src/parsing/pattern-rewriter.cc
index 6e20282785d0ba3495b2b4b723f69cb6e861bfd6..8ad708988a8794574c160c5aa162d4ede4837968 100644
--- a/src/parsing/pattern-rewriter.cc
+++ b/src/parsing/pattern-rewriter.cc
@@ -50,7 +50,7 @@ void Parser::PatternRewriter::RewriteDestructuringAssignment(
rewriter.recursion_level_ = 0;
rewriter.RecurseIntoSubpattern(rewriter.pattern_, nullptr);
- DCHECK(ok);
+ CHECK(ok);
}
@@ -575,7 +575,8 @@ void Parser::PatternRewriter::Visit(AstNode* node) { UNREACHABLE(); }
#define NOT_A_PATTERN(Node) \
void Parser::PatternRewriter::Visit##Node(v8::internal::Node*) { \
- UNREACHABLE(); \
+ parser_->ReportMessage(MessageTemplate::kUnsupported); \
+ *ok_ = false; \
}
NOT_A_PATTERN(BinaryOperation)
« no previous file with comments | « src/parsing/parser.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698