On Wed Apr 24 22:01:05 2024 +0000, Jacek Caban wrote:
Scratch the reference to the implementation, let me put it differently: why do you need a separate interface for functions? They are always called on "this" object, so why not use `IJSDisatchHost` of "this" object? Its implementation may get a function descriptor from the ID. The only additional thing from function descriptor that you need earlier is IID, to make sure that the object implements required interface. You could just make that a part of function description. I think we already discussed this part years ago. Things like `get_dispex_for_hook` should not be needed in the first place. `prop_fixup` is an implementation detail (not a pretty one) that shouldn't be a part of the interface in its current form. When you need to check if the prototype is still valid, you may just query that value's description, for example.
The "this" object can be anything. It doesn't have to be a mshtml object. So what happens then? That's why I store the entire function context along with the this object in the function interface. For the props, we do have a mshtml object (the one holding the prop), so we don't need that, hence why it's a different interface.
You did mention the IID. The only way I can see how this can work out is by duplicating the interface checks from mshtml into jscript. Is that actually a good idea? I'd rather not duplicate code if mshtml can already handle it. BTW, how do I even store the IID without the function context (in the function interface, not the proxy)?
For `prop_fixup`, do you mean to use PropGetInfo? Or did I misunderstand? Honestly, I believe I tried that at first and something didn't work out, but that was awhile ago, maybe I was wrong or something changed since then. Not sure.