diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-12 15:27:01 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-18 13:13:49 +0200 |
commit | ce5dee24226f6abacaffe298092afe035d0822c4 (patch) | |
tree | 3b4dca1f091e47fcc0a235983853613f2f342726 /src/qml/qml/v8/qv8engine.cpp | |
parent | 16f92ad85cf665d863ded5eeaaa7fc3f90820b3f (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/qml/v8/qv8engine.cpp')
-rw-r--r-- | src/qml/qml/v8/qv8engine.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qml/qml/v8/qv8engine.cpp b/src/qml/qml/v8/qv8engine.cpp index 6899bd405f..c377608341 100644 --- a/src/qml/qml/v8/qv8engine.cpp +++ b/src/qml/qml/v8/qv8engine.cpp @@ -404,6 +404,7 @@ QVariant QV8Engine::toBasicVariant(const QV4::Value &value) void QV8Engine::initializeGlobal() { + QV4::Scope scope(m_v4Engine); QV4::GlobalExtensions::init(m_engine, m_v4Engine->globalObject); QQmlLocale::registerStringLocaleCompare(m_v4Engine); @@ -440,9 +441,9 @@ void QV8Engine::initializeGlobal() " }"\ "})" - QV4::Value result = QV4::Script::evaluate(m_v4Engine, QString::fromUtf8(FREEZE_SOURCE), 0); - Q_ASSERT(result.asFunctionObject()); - m_freezeObject = result; + QV4::Scoped<QV4::FunctionObject> result(scope, QV4::Script::evaluate(m_v4Engine, QString::fromUtf8(FREEZE_SOURCE), 0)); + Q_ASSERT(!!result); + m_freezeObject = result.asValue(); #undef FREEZE_SOURCE } } |