diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-07-09 14:01:41 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-07-09 14:01:41 (GMT) |
commit | 88a737b034b50840e8072971d5280cd3df26fe4c (patch) | |
tree | 90b8a0709dcc8888de3c9c171de7dc6895543ed4 /src/script | |
parent | 146c3781d8ad02ccbf6da499e916c25f56b742b0 (diff) | |
download | Qt-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.
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/bridge/qscriptqobject.cpp | 2 |
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"); |