diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2012-01-18 07:03:48 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-02 12:07:13 +0100 |
commit | 52b77f94ab193c40096a5a3c106fcb2128085a30 (patch) | |
tree | ab6559cbcfc9babead88477d798e15679c0f69eb /src/declarative/qml | |
parent | fe6173c580ea58529d3b784c8396eabe3a394e85 (diff) |
Remove QJSEngine::undefinedValue() function
Rationale: It's strange to have an undefined value factory function.
There should just be one way of constructing undefined values: By
passing UndefinedValue to the QJSValue constructor.
The undefinedValue() function created a value that was bound to the
engine; the QJSValue constructor does not. In order to ensure that
we're testing the same behavior as before, I've replaced
undefinedValue() calls by toScriptValue(QVariant()) in the autotests.
Task-number: QTBUG-23604
Change-Id: Ie9295b7af49c853b5a4a3445da48c325fef8d6b1
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/v8/qjsengine.cpp | 17 | ||||
-rw-r--r-- | src/declarative/qml/v8/qjsengine.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/v8/qjsvalue.cpp | 2 |
3 files changed, 0 insertions, 21 deletions
diff --git a/src/declarative/qml/v8/qjsengine.cpp b/src/declarative/qml/v8/qjsengine.cpp index b818c18f1c..0c0cc1f9b5 100644 --- a/src/declarative/qml/v8/qjsengine.cpp +++ b/src/declarative/qml/v8/qjsengine.cpp @@ -309,23 +309,6 @@ QJSValue QJSEngine::evaluate(const QString& program, const QString& fileName, in return QJSValuePrivate::get(d->evaluate(program, fileName, lineNumber)); } -#ifdef QT_DEPRECATED - -/*! - \obsolete - - Returns a QJSValue of the primitive type Undefined. -*/ -QJSValue QJSEngine::undefinedValue() -{ - Q_D(QJSEngine); - QScriptIsolate api(d, QScriptIsolate::NotNullEngine); - v8::HandleScope handleScope; - return QJSValuePrivate::get(new QJSValuePrivate(d, v8::Undefined())); -} - -#endif // QT_DEPRECATED - /*! Creates a JavaScript object of class Object. diff --git a/src/declarative/qml/v8/qjsengine.h b/src/declarative/qml/v8/qjsengine.h index 558d5ed024..94c4dffde4 100644 --- a/src/declarative/qml/v8/qjsengine.h +++ b/src/declarative/qml/v8/qjsengine.h @@ -87,8 +87,6 @@ public: QT_DEPRECATED bool hasUncaughtException() const; QT_DEPRECATED QJSValue uncaughtException() const; QT_DEPRECATED void clearExceptions(); - - QT_DEPRECATED QJSValue undefinedValue(); #endif Q_SIGNALS: diff --git a/src/declarative/qml/v8/qjsvalue.cpp b/src/declarative/qml/v8/qjsvalue.cpp index 9e98eace67..8be6a40e16 100644 --- a/src/declarative/qml/v8/qjsvalue.cpp +++ b/src/declarative/qml/v8/qjsvalue.cpp @@ -261,8 +261,6 @@ bool QJSValue::isString() const /*! Returns true if this QJSValue is of the primitive type Undefined; otherwise returns false. - - \sa QJSEngine::undefinedValue() */ bool QJSValue::isUndefined() const { |