diff options
Diffstat (limited to 'src/qml/jsruntime/qv4globalobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4globalobject.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4globalobject.cpp b/src/qml/jsruntime/qv4globalobject.cpp index 395b2e8afb..bd8e747c41 100644 --- a/src/qml/jsruntime/qv4globalobject.cpp +++ b/src/qml/jsruntime/qv4globalobject.cpp @@ -374,7 +374,10 @@ ReturnedValue EvalFunction::evalCall(CallData *callData, bool directCall) const if (function->isStrict() || (ctx->d()->v4Function->isStrict())) { ScopedFunctionObject e(scope, FunctionObject::createScriptFunction(ctx, function)); ScopedCallData callData(scope, 0); - callData->thisObject = scope.engine->currentStackFrame->thisObject(); + if (directCall) + callData->thisObject = scope.engine->currentStackFrame->thisObject(); + else + callData->thisObject = scope.engine->globalObject; return e->call(callData); } |