Index: src/parsing/parser.cc |
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc |
index 3bc11bea9058cf9fccc392d5a4d66e9692deb9cb..12e746cd12b16b0ed36546239285ea61f994152e 100644 |
--- a/src/parsing/parser.cc |
+++ b/src/parsing/parser.cc |
@@ -783,6 +783,7 @@ Parser::Parser(ParseInfo* info) |
DCHECK(!info->script().is_null() || info->source_stream() != NULL); |
set_allow_lazy(info->allow_lazy_parsing()); |
set_allow_natives(FLAG_allow_natives_syntax || info->is_native()); |
+ set_allow_tailcalls(FLAG_harmony_tailcalls && !info->is_native()); |
set_allow_harmony_sloppy(FLAG_harmony_sloppy); |
set_allow_harmony_sloppy_function(FLAG_harmony_sloppy_function); |
set_allow_harmony_sloppy_let(FLAG_harmony_sloppy_let); |
@@ -2680,7 +2681,7 @@ Statement* Parser::ParseReturnStatement(bool* ok) { |
} |
// ES6 14.6.1 Static Semantics: IsInTailPosition |
- if (FLAG_harmony_tailcalls && !is_sloppy(language_mode())) { |
+ if (allow_tailcalls() && !is_sloppy(language_mode())) { |
function_state_->AddExpressionInTailPosition(return_value); |
} |
} |