diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-08-03 20:26:28 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-08-04 07:08:19 +0000 |
commit | c0f961cd6b82a523e277f6d8778a20508b15697d (patch) | |
tree | 7e4986686630404123a9f40eeb4881a089072d12 /src/qml/jsapi/qjsvalue.cpp | |
parent | b46b2e28b39443f6250c0d751a593b35af1c8c1e (diff) |
Change function signatures for call/construct back
Change those back again to return a value. This will be required
to avoid creation of Scope objects between JS function calls.
Change-Id: I05cb5cf8fd0c13dcefa60d213ccd5983fab57ea3
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/jsapi/qjsvalue.cpp')
-rw-r--r-- | src/qml/jsapi/qjsvalue.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp index 3a3cf46ddb..b692b8e68d 100644 --- a/src/qml/jsapi/qjsvalue.cpp +++ b/src/qml/jsapi/qjsvalue.cpp @@ -667,11 +667,11 @@ QJSValue QJSValue::call(const QJSValueList &args) callData->args[i] = QJSValuePrivate::convertedToValue(engine, args.at(i)); } - f->call(scope, callData); + ScopedValue result(scope, f->call(callData)); if (engine->hasException) - scope.result = engine->catchException(); + result = engine->catchException(); - return QJSValue(engine, scope.result.asReturnedValue()); + return QJSValue(engine, result->asReturnedValue()); } /*! @@ -723,11 +723,11 @@ QJSValue QJSValue::callWithInstance(const QJSValue &instance, const QJSValueList callData->args[i] = QJSValuePrivate::convertedToValue(engine, args.at(i)); } - f->call(scope, callData); + ScopedValue result(scope, f->call(callData)); if (engine->hasException) - scope.result = engine->catchException(); + result = engine->catchException(); - return QJSValue(engine, scope.result.asReturnedValue()); + return QJSValue(engine, result->asReturnedValue()); } /*! @@ -771,11 +771,11 @@ QJSValue QJSValue::callAsConstructor(const QJSValueList &args) callData->args[i] = QJSValuePrivate::convertedToValue(engine, args.at(i)); } - f->construct(scope, callData); + ScopedValue result(scope, f->construct(callData)); if (engine->hasException) - scope.result = engine->catchException(); + result = engine->catchException(); - return QJSValue(engine, scope.result.asReturnedValue()); + return QJSValue(engine, result->asReturnedValue()); } #ifdef QT_DEPRECATED |