On Wed Feb 26 10:46:52 2025 +0000, Jacek Caban wrote:
This obviously needs a test. While we do want to remove the check, it was originally intended to preserve assumptions about the caller and callee sharing the same context, similar to how we check context in places like `disp_call`. For example, one such assumption is that we don’t propagate the caller’s context when making a call to another context. This will need to be fixed first, but the tricky question is: what else are we missing?
I can try to add a test, but it's obviously wrong the way it is now (see below). Either way, I don't think the fix for lack of context propagation should be done here, it feels like it's unrelated and a bit of a hack, even if it's missing (the propagation).
What this patch fixes is rather that on a differing context, we don't end up using the jsdisp at all now, instead we use the mshtml's Dispatch instead. This results in inconsistency and some checks not holding even while they should on differing contexts (e.g. the non-function constructors being treated as generic disp objects). Maybe I can add a test with that to show you what I mean.
I don't think it's right to *ever* use the mshtml's disp in scripts, except when forwarding from the jsdisp, or from C/COM code, no matter the ctx.