mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -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. |
||
|---|---|---|
| .. | ||
| GuiScriptConversions.cpp | ||
| JSInterface_CGUISize.cpp | ||
| JSInterface_CGUISize.h | ||
| JSInterface_GUIManager.cpp | ||
| JSInterface_GUIManager.h | ||
| JSInterface_GUIProxy.cpp | ||
| JSInterface_GUIProxy.h | ||
| JSInterface_GUIProxy_impl.h | ||
| JSInterface_GUISize.cpp | ||
| JSInterface_GUISize.h | ||
| ScriptFunctions.cpp | ||
| ScriptFunctions.h | ||