Jacek Caban (@jacek) commented about dlls/jscript/jsutils.c:
hres = IWineJSDispatchHost_GetJSDispatch(disp_host, &jsdisp_iface); IWineJSDispatchHost_Release(disp_host); if(SUCCEEDED(hres)) {
jsdisp_t *jsdisp = as_jsdisp((IDispatch *)jsdisp_iface);
if(jsdisp->ctx == ctx) {
*r = jsval_obj(jsdisp);
return S_OK;
}else {
jsdisp_release(jsdisp);
}
*r = jsval_obj(as_jsdisp((IDispatch *)jsdisp_iface));
return S_OK;
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?