aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlcontextwrapper.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-13 21:54:21 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-18 13:14:10 +0200
commite4e90923c93adfafb23c81be7359e8df2a500b4f (patch)
tree36be927b72606c4f37326089ff3c6261f484c92b /src/qml/qml/qqmlcontextwrapper.cpp
parent9dcc12d52343960400192c817f54a16f7e1f8247 (diff)
Convert some methods to use Returned<>
Change-Id: I631606cb5ab3b35b72104e70092a5200dd235fbc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlcontextwrapper.cpp')
-rw-r--r--src/qml/qml/qqmlcontextwrapper.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlcontextwrapper.cpp b/src/qml/qml/qqmlcontextwrapper.cpp
index 50d1f32c10..153743aa58 100644
--- a/src/qml/qml/qqmlcontextwrapper.cpp
+++ b/src/qml/qml/qqmlcontextwrapper.cpp
@@ -274,8 +274,9 @@ ReturnedValue QmlContextWrapper::get(Managed *m, String *name, bool *hasProperty
void QmlContextWrapper::put(Managed *m, String *name, const Value &value)
{
- QmlContextWrapper *wrapper = m->as<QmlContextWrapper>();
ExecutionEngine *v4 = m->engine();
+ QV4::Scope scope(v4);
+ QV4::Scoped<QmlContextWrapper> wrapper(scope, m->as<QmlContextWrapper>());
if (!wrapper)
v4->current->throwTypeError();
@@ -283,7 +284,8 @@ void QmlContextWrapper::put(Managed *m, String *name, const Value &value)
if (wrapper && wrapper->readOnly) {
QString error = QLatin1String("Invalid write to global property \"") + name->toQString() +
QLatin1Char('"');
- v4->current->throwError(Value::fromString(v4->current->engine->newString(error)));
+ Scoped<String> e(scope, v4->current->engine->newString(error));
+ v4->current->throwError(e);
}
Object::put(m, name, value);