[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373
eric at webkit.org
eric at webkit.org
Thu Apr 8 01:43:24 UTC 2010
The following commit has been merged in the webkit-1.2 branch:
commit 6cf0f98c4030c4f21699c6e3e3e3a77205beabc5
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Feb 10 02:53:05 2010 +0000
2010-02-09 Jedrzej Nowacki <jedrzej.nowacki at nokia.com>
Reviewed by Simon Hausmann.
New functions nullValue() and undefinedValue().
[Qt] QScriptEngine should contain nullValue and undefinedValue methods
https://bugs.webkit.org/show_bug.cgi?id=34749
* qt/api/qscriptengine.cpp:
(QScriptEngine::nullValue):
(QScriptEngine::undefinedValue):
* qt/api/qscriptengine.h:
* qt/tests/qscriptengine/tst_qscriptengine.cpp:
(tst_QScriptEngine::nullValue):
(tst_QScriptEngine::undefinedValue):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54580 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 2ab245f..2002418 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -2,6 +2,23 @@
Reviewed by Simon Hausmann.
+ New functions nullValue() and undefinedValue().
+
+ [Qt] QScriptEngine should contain nullValue and undefinedValue methods
+ https://bugs.webkit.org/show_bug.cgi?id=34749
+
+ * qt/api/qscriptengine.cpp:
+ (QScriptEngine::nullValue):
+ (QScriptEngine::undefinedValue):
+ * qt/api/qscriptengine.h:
+ * qt/tests/qscriptengine/tst_qscriptengine.cpp:
+ (tst_QScriptEngine::nullValue):
+ (tst_QScriptEngine::undefinedValue):
+
+2010-02-09 Jedrzej Nowacki <jedrzej.nowacki at nokia.com>
+
+ Reviewed by Simon Hausmann.
+
Fixes for QScriptValue::toNumber().
Fix ECMA compliance in QScriptValue for values unbound
diff --git a/JavaScriptCore/qt/api/qscriptengine.cpp b/JavaScriptCore/qt/api/qscriptengine.cpp
index f12f410..fbeb902 100644
--- a/JavaScriptCore/qt/api/qscriptengine.cpp
+++ b/JavaScriptCore/qt/api/qscriptengine.cpp
@@ -86,3 +86,23 @@ void QScriptEngine::collectGarbage()
{
d_ptr->collectGarbage();
}
+
+/*!
+ Returns a QScriptValue of the primitive type Null.
+
+ \sa undefinedValue()
+*/
+QScriptValue QScriptEngine::nullValue()
+{
+ return QScriptValue(this, QScriptValue::NullValue);
+}
+
+/*!
+ Returns a QScriptValue of the primitive type Undefined.
+
+ \sa nullValue()
+*/
+QScriptValue QScriptEngine::undefinedValue()
+{
+ return QScriptValue(this, QScriptValue::UndefinedValue);
+}
diff --git a/JavaScriptCore/qt/api/qscriptengine.h b/JavaScriptCore/qt/api/qscriptengine.h
index cf61d35..b8bd5e6 100644
--- a/JavaScriptCore/qt/api/qscriptengine.h
+++ b/JavaScriptCore/qt/api/qscriptengine.h
@@ -38,6 +38,8 @@ public:
QScriptValue evaluate(const QString& program, const QString& fileName = QString(), int lineNumber = 1);
void collectGarbage();
+ QScriptValue nullValue();
+ QScriptValue undefinedValue();
private:
friend class QScriptEnginePrivate;
diff --git a/JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp b/JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp
index 37f3d11..b36e364 100644
--- a/JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp
+++ b/JavaScriptCore/qt/tests/qscriptengine/tst_qscriptengine.cpp
@@ -35,6 +35,8 @@ public slots:
private slots:
void evaluate();
void collectGarbage();
+ void nullValue();
+ void undefinedValue();
};
/* Evaluating a script that throw an unhandled exception should return an invalid value. */
@@ -54,5 +56,22 @@ void tst_QScriptEngine::collectGarbage()
engine.collectGarbage();
QCOMPARE(foo.call().toString(), QString::fromAscii("pong"));
}
+
+void tst_QScriptEngine::nullValue()
+{
+ QScriptEngine engine;
+ QScriptValue value = engine.nullValue();
+ QVERIFY(value.isValid());
+ QVERIFY(value.isNull());
+}
+
+void tst_QScriptEngine::undefinedValue()
+{
+ QScriptEngine engine;
+ QScriptValue value = engine.undefinedValue();
+ QVERIFY(value.isValid());
+ QVERIFY(value.isUndefined());
+}
+
QTEST_MAIN(tst_QScriptEngine)
#include "tst_qscriptengine.moc"
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list