Jacek Caban (@jacek) commented about dlls/jscript/function.c:
return E_OUTOFMEMORY;
- hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
- if(SUCCEEDED(hres) && dispex)
hres = IDispatchEx_GetDispID(dispex, name, fdexNameCaseSensitive, &dispid);
- else {
hres = IDispatch_GetIDsOfNames(disp, &IID_NULL, &name, 1, 0, &dispid);
dispex = NULL;
- }
- SysFreeString(name);
- if(SUCCEEDED(hres) && dispid == DISPID_UNKNOWN)
hres = DISP_E_UNKNOWNNAME;
- if(FAILED(hres)) {
if(hres == DISP_E_UNKNOWNNAME)
hres = JS_E_JSCRIPT_EXPECTED;
goto fail;
- }
It seems that we could use a helper like `disp_propget_name` and maybe `disp_get_idx`. Below you open code things like dispatching exceptions, jsval conversion etc. I think it would be better to keep it for `dispex.c`. With those helpers, maybe we could just pass `IDispatch` to `array_to_args` instead of duplicating it.