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; |
} |