summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptvalue.cpp
diff options
context:
space:
mode:
authorJedrzej Nowacki <jedrzej.nowacki@nokia.com>2009-07-09 11:03:48 (GMT)
committerJedrzej Nowacki <jedrzej.nowacki@nokia.com>2009-07-09 11:33:23 (GMT)
commit5bf417cf836636aab1dcadffaa73f26966880dff (patch)
tree7a98577d2399a06631666a5b2249d5d574bf76bc /src/script/api/qscriptvalue.cpp
parentdadfb997897141ccd47808b2e9b38807f0042c53 (diff)
downloadQt-5bf417cf836636aab1dcadffaa73f26966880dff.zip
Qt-5bf417cf836636aab1dcadffaa73f26966880dff.tar.gz
Qt-5bf417cf836636aab1dcadffaa73f26966880dff.tar.bz2
Fix autotest checking QScriptValue::objectId method.
(QScriptValue::objectId() and QScriptEnigne::objectById)
Diffstat (limited to 'src/script/api/qscriptvalue.cpp')
-rw-r--r--src/script/api/qscriptvalue.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp
index dbab779..13cef76 100644
--- a/src/script/api/qscriptvalue.cpp
+++ b/src/script/api/qscriptvalue.cpp
@@ -243,7 +243,7 @@ qsreal ToInteger(qsreal n)
} // namespace QScript
-QScriptValuePrivate::QScriptValuePrivate() : engine(this), valid(true)
+QScriptValuePrivate::QScriptValuePrivate() : engine(this), valid(true), id(-1)
{
ref = 0;
}
@@ -2480,13 +2480,8 @@ void QScriptValue::setScriptClass(QScriptClass *scriptClass)
*/
qint64 QScriptValue::objectId() const
{
- if (!isObject())
- return -1;
- Q_ASSERT_X(false, Q_FUNC_INFO, "not implemented");
- // lazily initialized mapping from JSObject* to id?
- return -1;
+ return d_ptr?d_ptr->id:-1;
}
-
QT_END_NAMESPACE
#endif // QT_NO_SCRIPT