aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4codegen.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-11-07 09:02:09 +0100
committerLars Knoll <lars.knoll@qt.io>2017-11-15 18:46:49 +0000
commit1417f3878574978182b669147bc4aed6870f4838 (patch)
treeea9fb28b2f1e4880cbeed4cbf18f21e787de0fd1 /src/qml/compiler/qv4codegen.cpp
parent6b738e3224c26fcce148b569188e2a25520e54d6 (diff)
Don't create a CallContext if arguments are being used in strict mode
The strict arguments object doesn't need a callcontext. Change-Id: I1d6419c456b28741167f76937906faffd2d5d3b4 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4codegen.cpp')
-rw-r--r--src/qml/compiler/qv4codegen.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/compiler/qv4codegen.cpp b/src/qml/compiler/qv4codegen.cpp
index 04d16d412e..b9d223bab0 100644
--- a/src/qml/compiler/qv4codegen.cpp
+++ b/src/qml/compiler/qv4codegen.cpp
@@ -1503,7 +1503,7 @@ Codegen::Reference Codegen::referenceForName(const QString &name, bool isLhs)
}
const int argIdx = c->findArgument(name);
if (argIdx != -1) {
- Q_ASSERT(!c->argumentsCanEscape && c->usesArgumentsObject != Context::ArgumentsObjectUsed);
+ Q_ASSERT(!c->argumentsCanEscape && (c->usesArgumentsObject != Context::ArgumentsObjectUsed || c->isStrict));
return Reference::fromArgument(this, argIdx, _volataleMemoryLocations.isVolatile(name));
}
c = c->parent;
@@ -2074,7 +2074,8 @@ int Codegen::defineFunction(const QString &name, AST::Node *ast,
bool allVarsEscape = _context->hasWith || _context->hasTry || _context->hasDirectEval;
if (_context->compilationMode == QmlBinding // we don't really need this for bindings, but we do for signal handlers, and we don't know if the code is a signal handler or not.
- || (!_context->canUseSimpleCall() && _context->compilationMode != GlobalCode && (_context->compilationMode != EvalCode || _context->isStrict))) {
+ || (!_context->canUseSimpleCall() && _context->compilationMode != GlobalCode &&
+ (_context->compilationMode != EvalCode || _context->isStrict))) {
Instruction::CreateCallContext createContext;
bytecodeGenerator->addInstruction(createContext);
}