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

Unified Diff: src/parsing/parser.cc

Issue 2278413003: Disallow tail calls from async functions and generators (Closed)
Patch Set: Adding test suggested by neis Created 4 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 | « no previous file | src/parsing/parser-base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index 5fabd8e25f122b960a3f72a47d400149fded36d4..8fe70b598751621ac3942f3bf4d8d8bc1c135d02 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -2505,7 +2505,7 @@ Statement* Parser::ParseReturnStatement(bool* ok) {
function_state_, ReturnExprContext::kInsideValidReturnStatement);
return_value = ParseExpression(true, CHECK_OK);
- if (allow_tailcalls() && !is_sloppy(language_mode())) {
+ if (allow_tailcalls() && !is_sloppy(language_mode()) && !is_resumable()) {
// ES6 14.6.1 Static Semantics: IsInTailPosition
function_state_->AddImplicitTailCallExpression(return_value);
}
« no previous file with comments | « no previous file | src/parsing/parser-base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698