aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4functionobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <[email protected]>2014-11-28 10:05:24 +0100
committerSimon Hausmann <[email protected]>2014-12-19 18:52:07 +0100
commit05bf96997c52775f14cfd4e34d25187feec897e0 (patch)
treedba1cb94f6a318d715343c75d54193bb170bb967 /src/qml/jsruntime/qv4functionobject.cpp
parentf9d4cd6fd75617b2bddde4ba591b77d1d6b4727b (diff)
Return Heap::ExecutionContext for globalContext()
Change-Id: Ide7c81735be4662ff45bf268cfe750ff1f784453 Reviewed-by: Simon Hausmann <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index c3d7a65a32..822184042c 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -123,7 +123,7 @@ Heap::FunctionObject::FunctionObject(ExecutionContext *scope, const ReturnedValu
Heap::FunctionObject::FunctionObject(InternalClass *ic, QV4::Object *prototype)
: Heap::Object(ic, prototype)
- , scope(ic->engine->rootContext()->d())
+ , scope(ic->engine->rootContext())
{
Scope scope(ic->engine);
ScopedObject o(scope, this);
@@ -258,7 +258,8 @@ ReturnedValue FunctionCtor::construct(Managed *that, CallData *callData)
QQmlRefPointer<QV4::CompiledData::CompilationUnit> compilationUnit = isel->compile();
QV4::Function *vmf = compilationUnit->linkToEngine(v4);
- return FunctionObject::createScriptFunction(v4->rootContext(), vmf)->asReturnedValue();
+ ScopedContext global(scope, scope.engine->rootContext());
+ return FunctionObject::createScriptFunction(global, vmf)->asReturnedValue();
}
// 15.3.1: This is equivalent to new Function(...)
@@ -373,7 +374,8 @@ ReturnedValue FunctionPrototype::method_bind(CallContext *ctx)
memcpy(boundArgs->data(), ctx->d()->callData->args + 1, (ctx->d()->callData->argc - 1)*sizeof(Value));
}
- return BoundFunction::create(ctx->d()->engine->rootContext(), target, boundThis, boundArgs)->asReturnedValue();
+ ScopedContext global(scope, scope.engine->rootContext());
+ return BoundFunction::create(global, target, boundThis, boundArgs)->asReturnedValue();
}
DEFINE_OBJECT_VTABLE(ScriptFunction);