Jacek Caban (@jacek) commented about dlls/jscript/function.c:
if(SUCCEEDED(hres)) { V_VT(&ret) = VT_EMPTY;
hres = IWineJSDispatchHost_Construct(function->host_iface, ctx->lcid, flags, &dp, &ret, &ei,
&ctx->jscaller->IServiceProvider_iface);
hres = IWineJSDispatchHost_Construct(function->host_iface, ctx->lcid, flags, &dp, r ? &ret : NULL,
&ei, &ctx->jscaller->IServiceProvider_iface);
It doesn't seem right to pass NULL constructor result, I think we should fix error handling instead and always clear the variant on success.