aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/qml/compiler/qv4compilerscanfunctions.cpp11
-rw-r--r--src/qml/compiler/qv4compilerscanfunctions_p.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4compilerscanfunctions.cpp b/src/qml/compiler/qv4compilerscanfunctions.cpp
index 349bd08dcf..e0a745ebb1 100644
--- a/src/qml/compiler/qv4compilerscanfunctions.cpp
+++ b/src/qml/compiler/qv4compilerscanfunctions.cpp
@@ -414,6 +414,17 @@ bool ScanFunctions::visit(TemplateLiteral *ast)
}
+bool ScanFunctions::visit(SuperLiteral *)
+{
+ Context *c = _context;
+ while (c && (c->contextType != ContextType::Function || c->isArrowFunction))
+ c = c->parent;
+
+ if (c)
+ c->requiresExecutionContext = true;
+
+ return false;
+}
bool ScanFunctions::enterFunction(FunctionExpression *ast, bool enterName)
{
if (_context->isStrict && (ast->name == QLatin1String("eval") || ast->name == QLatin1String("arguments")))
diff --git a/src/qml/compiler/qv4compilerscanfunctions_p.h b/src/qml/compiler/qv4compilerscanfunctions_p.h
index 53b2336cb1..2e016b25b1 100644
--- a/src/qml/compiler/qv4compilerscanfunctions_p.h
+++ b/src/qml/compiler/qv4compilerscanfunctions_p.h
@@ -115,6 +115,7 @@ protected:
bool visit(AST::ExpressionStatement *ast) override;
bool visit(AST::FunctionExpression *ast) override;
bool visit(AST::TemplateLiteral *ast) override;
+ bool visit(AST::SuperLiteral *) override;
bool enterFunction(AST::FunctionExpression *ast, bool enterName);