On Thu May 30 19:34:47 2024 +0000, Gabriel Ivăncescu wrote:
There is a difference between C/C++ and JS that we need to cover one
way or another. C implementation is bound to a specific object type, which makes using `impl_from_*` possible. To keep that possibility in hooks, they need to be bound to a specific object type as well. More idiomatically: hooks are a part of C implementation of JS functions and C implementations are specific to object instance type. Well yes, of course they check for the object type compatibility, but in the end they should still preserve their "function identity" instead of being looked up from the object everytime, even if it's completely detached from it.
Do you have a branch where I could see it in action?
I need to fix a couple things but I will update the branch tomorrow with the prototype chains most likely. (it's probably not 100% perfectly designed but I mean the general idea)
I've updated the branch with prototype chains; there's a lot of commits in-between so please ignore them for now (some are split, some aren't ready for upstream review), since order (same as from Proton) is like:
basic proxy impl->cycle collection integration->proper global host window->basic prototypes (only one, no chains)->constructors->prototype chains
Probably first commit of interest would be `d672d8b44ef084106c59b30fa01952fe4daf9189` aka `mshtml: Copy the builtin data to the proxy prototype on init.`
Or you can just run the tests and change the BuiltinFuncCall to use the DISPID (no need to check IID for testing), proxy_prop_info should already get the dispid anyway (for proxy props) and see why it fails.