[Fix] Prevent infinite recursion when a Window is exposed via js_api (#1838)
Exposing a js_api object that referenced a webview.Window (e.g. storing the window on the API instance) made function discovery walk into window.native. The native GUI object tree is effectively unbounded and many of its properties return a fresh object on every access (AccessibilityObject.Owner.Accessibility Object..., Bounds.Empty.Empty..., Style.Bold.Bold...), so the id() based cycle guard never matched and the walk recursed until a RecursionError. - Skip webview.Window.native during function discovery. Native objects cannot be bridged to Javascript and their tree is unbounded, so there is no reason to walk them. - Add a JS_API_MAX_DEPTH setting (default 10) as a general backstop against any other pathological object graph, with a warning when the limit is reached. - Document the new setting and add a regression test.
R
r0x0r committed
143ff6b52230c08200fd614655a7ee9ccbede2fd
Parent: 497ca3d