Index: src/ast/ast-numbering.cc |
diff --git a/src/ast/ast-numbering.cc b/src/ast/ast-numbering.cc |
index f3ba04d571b2b3b6f51bd0bf9d0371d534616fa9..c422744c6cc95f38f61f5f2e38ac4e021dc091b5 100644 |
--- a/src/ast/ast-numbering.cc |
+++ b/src/ast/ast-numbering.cc |
@@ -589,8 +589,13 @@ void AstNumberingVisitor::VisitRewritableExpression( |
bool AstNumberingVisitor::Renumber(FunctionLiteral* node) { |
DeclarationScope* scope = node->scope(); |
- if (scope->new_target_var()) DisableFullCodegenAndCrankshaft(kSuperReference); |
- if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) { |
+ if (scope->new_target_var() != nullptr || |
+ scope->this_function_var() != nullptr) { |
+ DisableFullCodegenAndCrankshaft(kSuperReference); |
+ } |
+ |
+ if (scope->arguments() != nullptr && |
+ !scope->arguments()->IsStackAllocated()) { |
DisableFullCodegenAndCrankshaft(kContextAllocatedArguments); |
} |