This is actually a bug in changes made to the Objective-C binding. I have a patch.
Broken by r20343, which fixed bug 13129.
My fix breaks the Democracy application. So I don't really have a fix!
Correcting the selector names in -[WebScriptObject methodForSelector:] and -[WebScriptObject respondsToSelector:] does no good. PyObjC, normal method dispatch, and Distributed Objects, are all far too low level to use either of those methods.
I think we'll have to add the count method back if we want to call it. What's less clear is exactly what PyObjC code is doing something bad when it sees a count method. I downloaded the PyObjC source code and could not find it.
You're right. I'm not sure what made me think respondsToSelector: and friends would work for this. I couldn't find where in PyObjC's code things went wrong either, but the stack trace when "count" is invoked is underneath PyObject_IsTrue which determines which Python objects are considered true in a boolean context. For number-like objects this is those with non-zero value, for sequence-like objects it is those with non-zero length. The fact this results in "count" being invoked suggests that Python or PyObjC believes the WebScriptObject is sequence-like in some way. I'm not sure how or why exactly this is happening, nor who arranges for PyObject_IsTrue to call through to "count".
It seems like rolling out the obviously incorrect fix r20343 and reopening bug 13129 so it can be addressed correctly would be the right thing to do here. Do you agree Darin?
Created attachment 13904 [details]
This uses valueForKey: rather than count. Arguably this addressing the symptom rather than the cause, but the presence of -[WebScriptObject count] breaks at least one third-party app which is bad news.
Created attachment 13907 [details]
Mitz pointed out that I had missed removing the interface declaration in DebuggerDocument that had been preventing the use of -count from generating a warning.
Comment on attachment 13907 [details]
Landed in r20643.
Closing since Drosera has been replaced by the new Web Inspector debugger. Moving to the New Bugs component so the Drosera component can be closed and removed.