diff options
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/qml/v8/qjsengine.cpp | 27 | ||||
-rw-r--r-- | src/declarative/qml/v8/qjsengine.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/v8/qjsvalue.cpp | 14 | ||||
-rw-r--r-- | src/declarative/qml/v8/qjsvalue.h | 1 | ||||
-rw-r--r-- | src/declarative/qml/v8/qjsvalue_impl_p.h | 45 | ||||
-rw-r--r-- | src/declarative/qml/v8/qjsvalue_p.h | 2 |
6 files changed, 1 insertions, 90 deletions
diff --git a/src/declarative/qml/v8/qjsengine.cpp b/src/declarative/qml/v8/qjsengine.cpp index 0e8d0c158d..a4a7f588a1 100644 --- a/src/declarative/qml/v8/qjsengine.cpp +++ b/src/declarative/qml/v8/qjsengine.cpp @@ -450,33 +450,6 @@ QJSValue QJSEngine::globalObject() const /*! \obsolete - Converts the given \a value to an object, if such a conversion is - possible; otherwise returns an invalid QJSValue. The conversion - is performed according to the following table: - - \table - \header \o Input Type \o Result - \row \o Undefined \o An invalid QJSValue. - \row \o Null \o An invalid QJSValue. - \row \o Boolean \o A new Boolean object whose internal value is set to the value of the boolean. - \row \o Number \o A new Number object whose internal value is set to the value of the number. - \row \o String \o A new String object whose internal value is set to the value of the string. - \row \o Object \o The result is the object itself (no conversion). - \endtable - - \sa newObject() -*/ -QJSValue QJSEngine::toObject(const QJSValue& value) -{ - Q_D(QJSEngine); - QScriptIsolate api(d, QScriptIsolate::NotNullEngine); - v8::HandleScope handleScope; - return QJSValuePrivate::get(QJSValuePrivate::get(value)->toObject(d)); -} - -/*! - \obsolete - Creates a JavaScript object of class Date from the given \a value. \sa QJSValue::toDateTime() diff --git a/src/declarative/qml/v8/qjsengine.h b/src/declarative/qml/v8/qjsengine.h index ff1aab8787..40f853fd52 100644 --- a/src/declarative/qml/v8/qjsengine.h +++ b/src/declarative/qml/v8/qjsengine.h @@ -101,8 +101,6 @@ public: QT_DEPRECATED QJSValue newRegExp(const QString &pattern, const QString &flags); QT_DEPRECATED QJSValue newDate(double value); QT_DEPRECATED QJSValue newDate(const QDateTime &value); - - QT_DEPRECATED QJSValue toObject(const QJSValue &value); #endif Q_SIGNALS: diff --git a/src/declarative/qml/v8/qjsvalue.cpp b/src/declarative/qml/v8/qjsvalue.cpp index a31fa5fa53..f4709732dd 100644 --- a/src/declarative/qml/v8/qjsvalue.cpp +++ b/src/declarative/qml/v8/qjsvalue.cpp @@ -461,7 +461,7 @@ bool QJSValue::isArray() const Note that function values, variant values, and QObject values are objects, so this function returns true for such values. - \sa toObject(), QJSEngine::newObject() + \sa QJSEngine::newObject() */ bool QJSValue::isObject() const { @@ -677,18 +677,6 @@ quint16 QJSValue::toUInt16() const return d->toUInt16(); } -/*! - \obsolete - - This function is obsolete; use QJSEngine::toObject() instead. -*/ -QJSValue QJSValue::toObject() const -{ - Q_D(const QJSValue); - QScriptIsolate api(d->engine()); - return QJSValuePrivate::get(d->toObject()); -} - #endif // QT_DEPRECATED /*! diff --git a/src/declarative/qml/v8/qjsvalue.h b/src/declarative/qml/v8/qjsvalue.h index d81688c5c6..4e4cfe08ad 100644 --- a/src/declarative/qml/v8/qjsvalue.h +++ b/src/declarative/qml/v8/qjsvalue.h @@ -144,7 +144,6 @@ public: QT_DEPRECATED qint32 toInt32() const; QT_DEPRECATED quint32 toUInt32() const; QT_DEPRECATED quint16 toUInt16() const; - QT_DEPRECATED QJSValue toObject() const; QT_DEPRECATED QRegExp toRegExp() const; QT_DEPRECATED bool instanceOf(const QJSValue &other) const; diff --git a/src/declarative/qml/v8/qjsvalue_impl_p.h b/src/declarative/qml/v8/qjsvalue_impl_p.h index 28b928d62c..f03975366e 100644 --- a/src/declarative/qml/v8/qjsvalue_impl_p.h +++ b/src/declarative/qml/v8/qjsvalue_impl_p.h @@ -256,51 +256,6 @@ double QJSValuePrivate::toNumber() const return 0; // Avoid compiler warning. } -QScriptPassPointer<QJSValuePrivate> QJSValuePrivate::toObject(QV8Engine* engine) const -{ - Q_ASSERT(engine); - if (this->engine() && engine != this->engine()) { - qWarning("QJSEngine::toObject: cannot convert value created in a different engine"); - return InvalidValue(); - } - - v8::HandleScope scope; - switch (m_state) { - case Invalid: - case CNull: - case CUndefined: - return new QJSValuePrivate; - case CString: - return new QJSValuePrivate(engine, engine->makeJSValue(*u.m_string)->ToObject()); - case CNumber: - return new QJSValuePrivate(engine, engine->makeJSValue(u.m_number)->ToObject()); - case CBool: - return new QJSValuePrivate(engine, engine->makeJSValue(u.m_bool)->ToObject()); - case JSValue: - if (m_value->IsObject()) - return const_cast<QJSValuePrivate*>(this); - if (m_value->IsNull() || m_value->IsUndefined()) // avoid "Uncaught TypeError: Cannot convert null to object" - return InvalidValue(); - return new QJSValuePrivate(engine, m_value->ToObject()); - default: - Q_ASSERT_X(false, Q_FUNC_INFO, "Not all states are included in this switch"); - return InvalidValue(); - } -} - -/*! - This method is created only for QJSValue::toObject() purpose which is obsolete. - \internal - */ -QScriptPassPointer<QJSValuePrivate> QJSValuePrivate::toObject() const -{ - if (isJSBased()) - return toObject(engine()); - - // Without an engine there is not much we can do. - return new QJSValuePrivate; -} - QString QJSValuePrivate::toString() const { switch (m_state) { diff --git a/src/declarative/qml/v8/qjsvalue_p.h b/src/declarative/qml/v8/qjsvalue_p.h index 356e1912be..ae79409b03 100644 --- a/src/declarative/qml/v8/qjsvalue_p.h +++ b/src/declarative/qml/v8/qjsvalue_p.h @@ -84,8 +84,6 @@ public: inline bool toBool() const; inline double toNumber() const; - inline QScriptPassPointer<QJSValuePrivate> toObject() const; - inline QScriptPassPointer<QJSValuePrivate> toObject(QV8Engine *engine) const; inline QString toString() const; inline double toInteger() const; inline qint32 toInt32() const; |