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

Unified Diff: src/parsing/parser.cc

Issue 1666183002: [es6] Fix tail Call nodes marking. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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/ast/prettyprinter.cc ('k') | no next file » | 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 81e0a5eb5a04bec1355e41c157088c3bf2cd4431..10f4b91450331c8304a7f3653fe3348a7ef09366 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -2807,11 +2807,6 @@ Statement* Parser::ParseReturnStatement(bool* ok) {
is_undefined, ThisExpression(scope_, factory(), pos),
is_object_conditional, pos);
}
-
- // ES6 14.6.1 Static Semantics: IsInTailPosition
- if (FLAG_harmony_tailcalls && !is_sloppy(language_mode())) {
- return_value->MarkTail();
- }
}
ExpectSemicolon(CHECK_OK);
@@ -4778,6 +4773,13 @@ ZoneList<Statement*>* Parser::ParseEagerFunctionBody(
RelocInfo::kNoPosition));
}
+ // ES6 14.6.1 Static Semantics: IsInTailPosition
+ if (FLAG_harmony_tailcalls && !is_sloppy(language_mode())) {
+ for (int i = 0; i < body->length(); i++) {
+ Statement* stmt = body->at(i);
+ stmt->MarkTail();
+ }
+ }
return result;
}
« no previous file with comments | « src/ast/prettyprinter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698