From 24bf48e3dd305dbc4fdcae5f8751792835ffd46a Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Mon, 16 Jan 2012 15:01:29 +0100 Subject: Remove QJSValue::toInteger() function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rationale: This is a remnant from QtScript. A function called toInteger() that returns a double looks strange. Use toInt32() to convert a QJSValue to an integer. Task-number: QTBUG-23604 Change-Id: I2829704c64b077fca264b660c46248c3f35cb5c0 Reviewed-by: Simon Hausmann Reviewed-by: Jędrzej Nowacki --- src/declarative/qml/v8/qjsvalue.cpp | 27 +-------------------------- src/declarative/qml/v8/qjsvalue.h | 1 - 2 files changed, 1 insertion(+), 27 deletions(-) (limited to 'src/declarative/qml/v8') diff --git a/src/declarative/qml/v8/qjsvalue.cpp b/src/declarative/qml/v8/qjsvalue.cpp index f4709732dd..9fe9bb38e8 100644 --- a/src/declarative/qml/v8/qjsvalue.cpp +++ b/src/declarative/qml/v8/qjsvalue.cpp @@ -541,7 +541,7 @@ QString QJSValue::toString() const attempt to convert the object to a primitive value (possibly resulting in an uncaught script exception). - \sa isNumber(), toInteger(), toInt(), toUInt(), toUInt16() + \sa isNumber(), toInt(), toUInt(), toUInt16() */ double QJSValue::toNumber() const { @@ -569,31 +569,6 @@ bool QJSValue::toBool() const return d->toBool(); } -#ifdef QT_DEPRECATED - -/*! - \obsolete - - Returns the integer value of this QJSValue, using the conversion - rules described in \l{ECMA-262} section 9.4, "ToInteger". - - Note that if this QJSValue is an object, calling this function - has side effects on the script engine, since the engine will call - the object's valueOf() function (and possibly toString()) in an - attempt to convert the object to a primitive value (possibly - resulting in an uncaught script exception). - - \sa toNumber() -*/ -double QJSValue::toInteger() const -{ - Q_D(const QJSValue); - QScriptIsolate api(d->engine()); - return d->toInteger(); -} - -#endif // QT_DEPRECATED - /*! Returns the signed 32-bit integer value of this QJSValue, using the conversion rules described in \l{ECMA-262} section 9.5, "ToInt32". diff --git a/src/declarative/qml/v8/qjsvalue.h b/src/declarative/qml/v8/qjsvalue.h index 4e4cfe08ad..84fe64d051 100644 --- a/src/declarative/qml/v8/qjsvalue.h +++ b/src/declarative/qml/v8/qjsvalue.h @@ -140,7 +140,6 @@ public: QT_DEPRECATED bool isValid() const; QT_DEPRECATED bool isFunction() const; - QT_DEPRECATED double toInteger() const; QT_DEPRECATED qint32 toInt32() const; QT_DEPRECATED quint32 toUInt32() const; QT_DEPRECATED quint16 toUInt16() const; -- cgit v1.2.3