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/jsapi/qjsvalue_p.h | |
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/jsapi/qjsvalue_p.h')
-rw-r--r-- | src/qml/jsapi/qjsvalue_p.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/qml/jsapi/qjsvalue_p.h b/src/qml/jsapi/qjsvalue_p.h index a0dfa010ab..ec3f61ef20 100644 --- a/src/qml/jsapi/qjsvalue_p.h +++ b/src/qml/jsapi/qjsvalue_p.h @@ -69,19 +69,18 @@ QT_BEGIN_NAMESPACE class Q_QML_PRIVATE_EXPORT QJSValuePrivate : public QV4::PersistentValuePrivate { public: - QJSValuePrivate(QV4::ExecutionEngine *engine, const QV4::Value &v) - : PersistentValuePrivate(v, engine) + QJSValuePrivate(QV4::ExecutionEngine *engine, const QV4::ValueRef v) + : PersistentValuePrivate(v.asReturnedValue(), engine) + { + Q_ASSERT(!value.isEmpty()); + } + QJSValuePrivate(QV4::ReturnedValue v) + : PersistentValuePrivate(v) { Q_ASSERT(!value.isEmpty()); } - QJSValuePrivate(QV4::Object *o) - : PersistentValuePrivate(QV4::Value::fromObject(o)) - { } - QJSValuePrivate(QV4::String *s) - : PersistentValuePrivate(QV4::Value::fromString(s)) - { } QJSValuePrivate(const QString &s) - : PersistentValuePrivate(QV4::Value::undefinedValue()) + : PersistentValuePrivate(QV4::Encode::undefined()) , string(0, s) { value = QV4::Value::fromString(&string); |