Jacek Caban (@jacek) commented about dlls/vbscript/vbdisp.c:
if(dispIdMember != DISPID_VALUE) return DISP_E_MEMBERNOTFOUND;
- return exec_script(This->ctx, TRUE, This->func, NULL, pDispParams, pVarResult); + /* When the reference is invoked from within running script (e.g. under the + * caller's On Error Resume Next), the error must propagate back to that + * caller as an HRESULT rather than be reported to the host. Only a call + * originating outside the engine acts as an external caller. */ + return exec_script(This->ctx, !This->ctx->current_exec, This->func, NULL, pDispParams, pVarResult);
I think this is not accurate. If a script calls an external `IDispatch`, which then calls back the function reference then `current_exec` will be non-null, but the caller is external. In jscript, we have `DISPATCH_JSCRIPT_CALLEREXECSSOURCE` to distinguish that. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10980#note_141237