On Thu Apr 16 15:05:46 2026 +0000, Jacek Caban wrote:
The shadowing problem seems a bit more complicated than that. For example, when a named item is available, both it and a global variable may shadow the identifier. We may also be shadowed by a variable from a user-supplied `IDispatch`, in which case we do not have such a pointer reference at all. Such an `IDispatch` may have a mutable property set, which means it may start shadowing during execution. I would expect native vbscript to do some caching anyway, but I do not know how without testing. Perhaps, for example, it performs the lookup on demand and caches the result? This way, we would not pay the cost for unused identifiers. In jscript, the optimization is effectively disabled for global code in practice (`base_scope` is not set for global code, causing it to fall back to string lookup). Maybe that would be good enough for your use case as well? In general this whole stack was very promising before I found !10544 Now the wins are less meaningful. Need some time to go through these again.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10515#note_136638