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

Unified Diff: src/parsing/parser-base.h

Issue 2315043002: Merged: Disallow tail calls from async functions and generators (Closed)
Patch Set: Created 4 years, 3 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.cc ('k') | test/mjsunit/es8/syntactic-tail-call-parsing.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser-base.h
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h
index 9d73486ed35b094f9ec85ace8c59e4f765890825..669defa27f0fdf1f1c4555412ee07198138defa5 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -2500,6 +2500,12 @@ ParserBase<Traits>::ParseTailCallExpression(ExpressionClassifier* classifier,
*ok = false;
return Traits::EmptyExpression();
}
+ if (is_resumable()) {
+ Scanner::Location sub_loc(sub_expression_pos, loc.end_pos);
+ ReportMessageAt(sub_loc, MessageTemplate::kUnexpectedTailCall);
+ *ok = false;
+ return Traits::EmptyExpression();
+ }
ReturnExprContext return_expr_context =
function_state_->return_expr_context();
if (return_expr_context != ReturnExprContext::kInsideValidReturnStatement) {
« no previous file with comments | « src/parsing/parser.cc ('k') | test/mjsunit/es8/syntactic-tail-call-parsing.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698