From fd7fce388e31174a5179d92b56911d974bf11024 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Wed, 18 Jan 2012 06:53:39 +0100 Subject: Remove QJSEngine::nullValue() function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rationale: It's strange to have a null value factory function. There should just be one way of constructing null values: By passing NullValue to the QJSValue constructor. The nullValue() 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 nullValue() calls by evaluate("null") in the autotests. Task-number: QTBUG-23604 Change-Id: Ie40b61fa64e070b90c6245fd21554963073c5f80 Reviewed-by: Jędrzej Nowacki --- src/declarative/qml/v8/qjsengine.cpp | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'src/declarative/qml/v8/qjsengine.cpp') diff --git a/src/declarative/qml/v8/qjsengine.cpp b/src/declarative/qml/v8/qjsengine.cpp index 542c20d3d2..b818c18f1c 100644 --- a/src/declarative/qml/v8/qjsengine.cpp +++ b/src/declarative/qml/v8/qjsengine.cpp @@ -311,27 +311,10 @@ QJSValue QJSEngine::evaluate(const QString& program, const QString& fileName, in #ifdef QT_DEPRECATED -/*! - \obsolete - - Returns a QJSValue of the primitive type Null. - - \sa nullValue() -*/ -QJSValue QJSEngine::nullValue() -{ - Q_D(QJSEngine); - QScriptIsolate api(d, QScriptIsolate::NotNullEngine); - v8::HandleScope handleScope; - return QJSValuePrivate::get(new QJSValuePrivate(d, v8::Null())); -} - /*! \obsolete Returns a QJSValue of the primitive type Undefined. - - \sa nullValue() */ QJSValue QJSEngine::undefinedValue() { @@ -380,7 +363,7 @@ QJSValue QJSEngine::newArray(uint length) Signals and slots, properties and children of \a object are available as properties of the created QJSValue. - If \a object is a null pointer, this function returns nullValue(). + If \a object is a null pointer, this function returns a null value. If a default prototype has been registered for the \a object's class (or its superclass, recursively), the prototype of the new script -- cgit v1.2.3