square/PonyDebugger — pull request #96 by KingOfBrian (2014-01-02 20:31:45+00:00)
Title: Add support for superclass properties

The current implementation only displays the current classes properties, not all of the properties that belong to the superclasses. There's a simple fix, which doesn't obide by the debugger API, which is to ignore the 'ownProperties', and return all of the properties. I like this implementation, because it's simple, and unlike javascript, a given instance can not be extended to have additional properties, so it seems (to me) to make sense. Also, I have yet to have the chrome debugger call getProperties with ownProperties == NO, and if it did, PonyDebugger behavior would not change.

The other fix I had in mind was to change the way PD_propertyDescriptors functioned. This would return an array of PDRuntimePropertyDescriptor for the immediate properties, and it would register a new object, say PDSuperContainer, that would specify the superclass name and the object it represents. Then when the browser requested properties on the PDSuperContainer object, a custom PD_propertyDescriptors would return just the properties for the specified class, and another PDSuperContainer if the superclass was not NSObject.

I'd prefer to make the first implementation, since it simpler, however, my first priority is a submit that would be accepted, so I thought I'd see if anyone out here has any preference.

Thoughts?