mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-17 22:03:56 -07:00
This commit enables proper property enumeration and inspection for GUI proxy objects in debugging sessions using the SpiderMonkey Debugger API. Interface (IGUIProxyObject): - Added a pure virtual method getPropsNames() to expose cached property names from the GUI object implementation. Proxy handler (JSI_GUIProxy): - Implemented ownPropertyKeys() to enumerate all visible properties of the proxy, including: -- Built-in GUI fields: "name", "parent", "children". -- Dynamic settings stored in m_Settings. -- Script event handlers prefixed with "on" from m_ScriptHandlers. -- Function properties returned by getPropsNames(). - Implemented getOwnPropertyDescriptor() to synthesize descriptors for debugger queries: -- Returns undefined if the property is not defined. -- Returns a read-only enumerable descriptor otherwise. - Both methods are marked final and override SpiderMonkey's BaseProxyHandler. Why: - SpiderMonkey’s Debugger API requires ownPropertyKeys and getOwnPropertyDescriptor for proxy objects to be introspectable in dev tools like VS Code. - Without these, properties of GUI objects are hidden during debugging. - This change improves the developer experience by making all meaningful GUI object fields visible and explorable at runtime. |
||
|---|---|---|
| .. | ||
| ObjectBases | ||
| ObjectTypes | ||
| Scripting | ||
| SettingTypes | ||
| tests | ||
| CGUI.cpp | ||
| CGUI.h | ||
| CGUIScrollBarHorizontal.cpp | ||
| CGUIScrollBarHorizontal.h | ||
| CGUIScrollBarVertical.cpp | ||
| CGUIScrollBarVertical.h | ||
| CGUISetting.cpp | ||
| CGUISetting.h | ||
| CGUISprite.cpp | ||
| CGUISprite.h | ||
| CGUIText.cpp | ||
| CGUIText.h | ||
| GUIManager.cpp | ||
| GUIManager.h | ||
| GUIObjectEventBroadcaster.h | ||
| GUIObjectTypes.cpp | ||
| GUIRenderer.cpp | ||
| GUIRenderer.h | ||
| GUIStringConversions.cpp | ||
| GUITooltip.cpp | ||
| GUITooltip.h | ||
| IGUIScrollBar.cpp | ||
| IGUIScrollBar.h | ||
| SGUIIcon.h | ||
| SGUIMessage.h | ||
| SGUIStyle.h | ||