aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsapi/qjsvalue.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-12 15:27:01 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-18 13:13:49 +0200
commitce5dee24226f6abacaffe298092afe035d0822c4 (patch)
tree3b4dca1f091e47fcc0a235983853613f2f342726 /src/qml/jsapi/qjsvalue.cpp
parent16f92ad85cf665d863ded5eeaaa7fc3f90820b3f (diff)
Convert more methods to use ReturnedValue
Change Exception.value() and a few other places. Change-Id: I53ce17e5656e260138b1ac7f6d467e4636c0a0b9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsapi/qjsvalue.cpp')
-rw-r--r--src/qml/jsapi/qjsvalue.cpp14
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);
}
/*!