diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-23 15:52:10 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-26 09:05:16 +0200 |
commit | 12fd2ccd3fa2dc0133b5a3fb89f9fdf5cf721232 (patch) | |
tree | 880acb9c7c0d8289185b6aebe4339f439c707a0e /src/qml/qml/qqmljavascriptexpression.cpp | |
parent | 2e4f66caa8a5f9e887dbdb4e3f2ae5c9be9a7005 (diff) |
Fix Persistent/WeakValue API
Don't use unprotected Values in the API anymore.
Change-Id: I8851628227fca374de24701bc8ee0908b5ae3923
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmljavascriptexpression.cpp')
-rw-r--r-- | src/qml/qml/qqmljavascriptexpression.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp index b1184729d0..e08e8eebb7 100644 --- a/src/qml/qml/qqmljavascriptexpression.cpp +++ b/src/qml/qml/qqmljavascriptexpression.cpp @@ -321,7 +321,7 @@ void QQmlJavaScriptExpression::exceptionToError(const QV4::Exception &e, QQmlErr } } -QV4::PersistentValue +QV4::ReturnedValue QQmlJavaScriptExpression::evalFunction(QQmlContextData *ctxt, QObject *scopeObject, const QString &code, const QString &filename, quint16 line, QV4::PersistentValue *qmlscope) @@ -333,8 +333,8 @@ QQmlJavaScriptExpression::evalFunction(QQmlContextData *ctxt, QObject *scopeObje QV4::ExecutionContext *ctx = v4->current; QV4::Scope scope(v4); - QV4::Scoped<QV4::Object> qmlScopeObject(scope, QV4::QmlContextWrapper::qmlScope(ep->v8engine(), ctxt, scopeObject)); - QV4::Script script(v4, qmlScopeObject.getPointer(), code, filename, line); + QV4::ScopedObject qmlScopeObject(scope, QV4::QmlContextWrapper::qmlScope(ep->v8engine(), ctxt, scopeObject)); + QV4::Script script(v4, qmlScopeObject, code, filename, line); QV4::ScopedValue result(scope); try { script.parse(); @@ -351,14 +351,14 @@ QQmlJavaScriptExpression::evalFunction(QQmlContextData *ctxt, QObject *scopeObje error.setUrl(QUrl::fromLocalFile(filename)); error.setObject(scopeObject); ep->warning(error); - return QV4::PersistentValue(); + return QV4::Encode::undefined(); } if (qmlscope) - *qmlscope = qmlScopeObject.asValue(); + *qmlscope = qmlScopeObject; return result.asReturnedValue(); } -QV4::PersistentValue QQmlJavaScriptExpression::qmlBinding(QQmlContextData *ctxt, QObject *qmlScope, +QV4::ReturnedValue QQmlJavaScriptExpression::qmlBinding(QQmlContextData *ctxt, QObject *qmlScope, const QString &code, const QString &filename, quint16 line, QV4::PersistentValue *qmlscope) { @@ -369,8 +369,8 @@ QV4::PersistentValue QQmlJavaScriptExpression::qmlBinding(QQmlContextData *ctxt, QV4::ExecutionContext *ctx = v4->current; QV4::Scope scope(v4); - QV4::ScopedValue qmlScopeObject(scope, QV4::QmlContextWrapper::qmlScope(ep->v8engine(), ctxt, qmlScope)); - QV4::Script script(v4, qmlScopeObject->asObject(), code, filename, line); + QV4::ScopedObject qmlScopeObject(scope, QV4::QmlContextWrapper::qmlScope(ep->v8engine(), ctxt, qmlScope)); + QV4::Script script(v4, qmlScopeObject, code, filename, line); QV4::ScopedValue result(scope); try { script.parse(); @@ -387,7 +387,7 @@ QV4::PersistentValue QQmlJavaScriptExpression::qmlBinding(QQmlContextData *ctxt, error.setUrl(QUrl::fromLocalFile(filename)); error.setObject(qmlScope); ep->warning(error); - return QV4::PersistentValue(); + return QV4::Encode::undefined(); } if (qmlscope) *qmlscope = qmlScopeObject; |