OSDN Git Service

QmlDebugger: hiding "this" from debugger when empty
authorChristiaan Janssen <christiaan.janssen@nokia.com>
Wed, 9 Mar 2011 15:06:19 +0000 (16:06 +0100)
committerChristiaan Janssen <christiaan.janssen@nokia.com>
Wed, 9 Mar 2011 15:10:06 +0000 (16:10 +0100)
Reviewed-by: Kai Koehne
share/qtcreator/qml/qmljsdebugger/jsdebuggeragent.cpp

index c6a302a..d72922d 100644 (file)
@@ -275,7 +275,8 @@ QList<JSAgentWatchData> JSDebuggerAgentPrivate::getLocals(QScriptContext *ctx)
         QScriptValue thisObject = ctx->thisObject();
         locals = expandObject(activationObject);
         if (thisObject.isObject()
-                && thisObject.objectId() != engine()->globalObject().objectId())
+                && thisObject.objectId() != engine()->globalObject().objectId()
+                && QScriptValueIterator(thisObject).hasNext())
             locals.prepend(fromScriptValue("this", thisObject));
         recordKnownObjects(locals);
         knownObjectIds << activationObject.objectId();