aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvme.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-05-08 11:06:31 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2013-05-08 15:11:34 +0200
commitc19c4f7687bafd61861ad6dc6f7f644c8e97a536 (patch)
tree729d6f3942371a92499ad20048d967682708f46b /src/qml/qml/qqmlvme.cpp
parent056f1ba351e233e5c3ac7b43d1e7e561dcc93ffb (diff)
Convert qqmltypeloader to use QV4::PersistentValue
Change-Id: Ifc4e2aea870a3a8ab37cd4d0674c672f0850f98f Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlvme.cpp')
-rw-r--r--src/qml/qml/qqmlvme.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlvme.cpp b/src/qml/qml/qqmlvme.cpp
index d97058eb87..fa56756c91 100644
--- a/src/qml/qml/qqmlvme.cpp
+++ b/src/qml/qml/qqmlvme.cpp
@@ -1158,7 +1158,7 @@ void QQmlVME::reset()
// Must be called with a handle scope and context
void QQmlScriptData::initialize(QQmlEngine *engine)
{
- Q_ASSERT(m_program.IsEmpty());
+ Q_ASSERT(!m_program);
Q_ASSERT(engine);
Q_ASSERT(!hasEngine());
@@ -1171,7 +1171,7 @@ void QQmlScriptData::initialize(QQmlEngine *engine)
if (program.IsEmpty())
return;
- m_program = qPersistentNew<v8::Script>(program);
+ m_program = program.get();
m_programSource.clear(); // We don't need this anymore
addToEngine(engine);
@@ -1182,7 +1182,7 @@ void QQmlScriptData::initialize(QQmlEngine *engine)
QV4::PersistentValue QQmlVME::run(QQmlContextData *parentCtxt, QQmlScriptData *script)
{
if (script->m_loaded)
- return script->m_value->v4Value();
+ return script->m_value;
QV4::PersistentValue rv;
@@ -1242,7 +1242,7 @@ QV4::PersistentValue QQmlVME::run(QQmlContextData *parentCtxt, QQmlScriptData *s
v8::Handle<v8::Object> qmlglobal = v8engine->qmlScope(ctxt, 0);
v8engine->contextWrapper()->takeContextOwnership(qmlglobal);
- if (!script->m_program.IsEmpty()) {
+ if (!!script->m_program) {
script->m_program->Run(qmlglobal);
} else {
// Compilation failed.
@@ -1260,7 +1260,7 @@ QV4::PersistentValue QQmlVME::run(QQmlContextData *parentCtxt, QQmlScriptData *s
rv = qmlglobal->v4Value();
if (shared) {
- script->m_value = qPersistentNew<v8::Object>(qmlglobal);
+ script->m_value = rv;
script->m_loaded = true;
}