aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4functionobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index 7c61a34190..523ef9c1e7 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -54,6 +54,7 @@
#include <private/qqmljslexer_p.h>
#include <private/qqmljsparser_p.h>
#include <private/qqmljsast_p.h>
+#include <private/qqmlcontextwrapper_p.h>
#include <qv4jsir_p.h>
#include <qv4codegen_p.h>
#include "private/qlocale_tools_p.h"
@@ -448,6 +449,9 @@ ReturnedValue ScriptFunction::construct(Managed *that, CallData *callData)
callData->thisObject = obj.asReturnedValue();
ExecutionContext *ctx = context->newCallContext(f.getPointer(), callData);
+ if (f->function->compiledFunction->hasQmlDependencies())
+ QmlContextWrapper::registerQmlDependencies(v4, f->function->compiledFunction);
+
ExecutionContextSaver ctxSaver(context);
ScopedValue result(scope, f->function->code(ctx, f->function->codeData));
if (result->isObject())
@@ -474,6 +478,9 @@ ReturnedValue ScriptFunction::call(Managed *that, CallData *callData)
}
}
+ if (f->function->compiledFunction->hasQmlDependencies())
+ QmlContextWrapper::registerQmlDependencies(ctx->engine, f->function->compiledFunction);
+
ExecutionContextSaver ctxSaver(context);
return f->function->code(ctx, f->function->codeData);
}
@@ -535,6 +542,9 @@ ReturnedValue SimpleScriptFunction::construct(Managed *that, CallData *callData)
callData->thisObject = obj;
ExecutionContext *ctx = context->newCallContext(stackSpace, scope.alloc(f->varCount), f.getPointer(), callData);
+ if (f->function->compiledFunction->hasQmlDependencies())
+ QmlContextWrapper::registerQmlDependencies(v4, f->function->compiledFunction);
+
ExecutionContextSaver ctxSaver(context);
Scoped<Object> result(scope, f->function->code(ctx, f->function->codeData));
@@ -564,6 +574,9 @@ ReturnedValue SimpleScriptFunction::call(Managed *that, CallData *callData)
}
}
+ if (f->function->compiledFunction->hasQmlDependencies())
+ QmlContextWrapper::registerQmlDependencies(v4, f->function->compiledFunction);
+
ExecutionContextSaver ctxSaver(context);
return f->function->code(ctx, f->function->codeData);
}