summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-07-09 14:01:41 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-07-09 14:01:41 (GMT)
commit88a737b034b50840e8072971d5280cd3df26fe4c (patch)
tree90b8a0709dcc8888de3c9c171de7dc6895543ed4
parent146c3781d8ad02ccbf6da499e916c25f56b742b0 (diff)
downloadQt-88a737b034b50840e8072971d5280cd3df26fe4c.zip
Qt-88a737b034b50840e8072971d5280cd3df26fe4c.tar.gz
Qt-88a737b034b50840e8072971d5280cd3df26fe4c.tar.bz2
QObject.prototype.toString: return undefined if this-object is not a QObject
Follow behavior of old back-end. Makes qscriptable test pass.
-rw-r--r--src/script/bridge/qscriptqobject.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp
index 1dcf602..8d9b5e4 100644
--- a/src/script/bridge/qscriptqobject.cpp
+++ b/src/script/bridge/qscriptqobject.cpp
@@ -1527,7 +1527,7 @@ static JSC::JSValue JSC_HOST_CALL qobjectProtoFuncToString(JSC::ExecState *exec,
JSC::JSValue thisValue, const JSC::ArgList&)
{
if (!thisValue.isObject(&QObjectWrapperObject::info))
- return throwError(exec, JSC::TypeError, "this object is not a QObject");
+ return JSC::jsUndefined();
QObject *obj = static_cast<QObjectWrapperObject*>(JSC::asObject(thisValue))->value();
const QMetaObject *meta = obj ? obj->metaObject() : &QObject::staticMetaObject;
QString name = obj ? obj->objectName() : QString::fromUtf8("unnamed");