diff options
Diffstat (limited to 'src/qml/jsapi/qjsvalue.cpp')
-rw-r--r-- | src/qml/jsapi/qjsvalue.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp index dabb9f5b29..e596cb6303 100644 --- a/src/qml/jsapi/qjsvalue.cpp +++ b/src/qml/jsapi/qjsvalue.cpp @@ -807,13 +807,14 @@ QJSValue QJSValue::property(const QString& name) const s->makeIdentifier(); QV4::ExecutionContext *ctx = engine->current; + QV4::ScopedValue result(scope); try { - QV4::ScopedValue v(scope, o->get(s)); - return new QJSValuePrivate(engine, v); + result = o->get(s); } catch (QV4::Exception &e) { e.accept(ctx); - return new QJSValuePrivate(engine, e.value()); + result = e.value(); } + return new QJSValuePrivate(engine, result); } /*! @@ -840,13 +841,14 @@ QJSValue QJSValue::property(quint32 arrayIndex) const return QJSValue(); QV4::ExecutionContext *ctx = engine->current; + QV4::ScopedValue result(scope); try { - QV4::ScopedValue v(scope, arrayIndex == UINT_MAX ? o->get(engine->id_uintMax) : o->getIndexed(arrayIndex)); - return new QJSValuePrivate(engine, v); + result = arrayIndex == UINT_MAX ? o->get(engine->id_uintMax) : o->getIndexed(arrayIndex); } catch (QV4::Exception &e) { e.accept(ctx); - return new QJSValuePrivate(engine, e.value()); + result = e.value(); } + return new QJSValuePrivate(engine, result); } /*! |