diff options
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index e1a6bda811..b08ad24fbe 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -548,8 +548,11 @@ void SimpleScriptFunction::construct(const Managed *that, Scope &scope, CallData if (f->function()->compiledFunction->hasQmlDependencies()) QQmlPropertyCapture::registerQmlDependencies(f->function()->compiledFunction, scope); - if (!scope.result.isManaged() || !scope.result.managed()) + if (v4->hasException) { + scope.result = Encode::undefined(); + } else if (!scope.result.isObject()) { scope.result = callData->thisObject; + } } void SimpleScriptFunction::call(const Managed *that, Scope &scope, CallData *callData) |
