aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-02-18 09:58:57 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-02-18 09:58:57 +0100
commitba9ca0e3d64c46fc63cdbc62f3e4a96e36a842f8 (patch)
treef9631624c841281302a2a546fbcc06a2375f410e /src/qml/jsruntime
parenta65b8785621ebf58f34eb0c1759376fc0a1117c7 (diff)
parent464bd2bf975797241213191a374e70431c5c3763 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/qml/jsruntime/qv4functionobject.cpp src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h Change-Id: Id164f6c3b45501aa466908659ec4e3b957323753
Diffstat (limited to 'src/qml/jsruntime')
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index 58e0277395..fb87822a5a 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -447,11 +447,12 @@ ReturnedValue ScriptFunction::construct(Managed *that, CallData *callData)
callData->thisObject = obj.asReturnedValue();
ExecutionContext *ctx = context->newCallContext(f.getPointer(), callData);
+ ExecutionContextSaver ctxSaver(context);
+ ScopedValue result(scope, Q_V4_PROFILE(v4, ctx, f->function));
+
if (f->function->compiledFunction->hasQmlDependencies())
QmlContextWrapper::registerQmlDependencies(v4, f->function->compiledFunction);
- ExecutionContextSaver ctxSaver(context);
- ScopedValue result(scope, Q_V4_PROFILE(v4, ctx, f->function));
if (result->isObject())
return result.asReturnedValue();
return obj.asReturnedValue();
@@ -470,11 +471,13 @@ ReturnedValue ScriptFunction::call(Managed *that, CallData *callData)
CallContext *ctx = context->newCallContext(f, callData);
+ ExecutionContextSaver ctxSaver(context);
+ ScopedValue result(scope, Q_V4_PROFILE(v4, ctx, f->function));
+
if (f->function->compiledFunction->hasQmlDependencies())
QmlContextWrapper::registerQmlDependencies(ctx->engine, f->function->compiledFunction);
- ExecutionContextSaver ctxSaver(context);
- return Q_V4_PROFILE(v4, ctx, f->function);
+ return result.asReturnedValue();
}
DEFINE_OBJECT_VTABLE(SimpleScriptFunction);
@@ -542,11 +545,11 @@ ReturnedValue SimpleScriptFunction::construct(Managed *that, CallData *callData)
}
Q_ASSERT(v4->currentContext() == &ctx);
+ Scoped<Object> result(scope, Q_V4_PROFILE(v4, &ctx, f->function));
+
if (f->function->compiledFunction->hasQmlDependencies())
QmlContextWrapper::registerQmlDependencies(v4, f->function->compiledFunction);
- Scoped<Object> result(scope, Q_V4_PROFILE(v4, &ctx, f->function));
-
if (!result)
return callData->thisObject.asReturnedValue();
return result.asReturnedValue();
@@ -579,10 +582,12 @@ ReturnedValue SimpleScriptFunction::call(Managed *that, CallData *callData)
}
Q_ASSERT(v4->currentContext() == &ctx);
+ ScopedValue result(scope, Q_V4_PROFILE(v4, &ctx, f->function));
+
if (f->function->compiledFunction->hasQmlDependencies())
QmlContextWrapper::registerQmlDependencies(v4, f->function->compiledFunction);
- return Q_V4_PROFILE(v4, &ctx, f->function);
+ return result.asReturnedValue();
}