From 88a737b034b50840e8072971d5280cd3df26fe4c Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 9 Jul 2009 16:01:41 +0200 Subject: QObject.prototype.toString: return undefined if this-object is not a QObject Follow behavior of old back-end. Makes qscriptable test pass. --- src/script/bridge/qscriptqobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(JSC::asObject(thisValue))->value(); const QMetaObject *meta = obj ? obj->metaObject() : &QObject::staticMetaObject; QString name = obj ? obj->objectName() : QString::fromUtf8("unnamed"); -- cgit v0.12