Jacek Caban (@jacek) commented about dlls/vbscript/global.c:
+ if(res) + return VariantCopy(res, arg); + return S_OK; + } + + hres = compile_script(This->ctx, V_BSTR(arg), NULL, NULL, 0, 0, + SCRIPTTEXT_ISEXPRESSION | SCRIPTTEXT_NOERRORREPORT, &code); + if(FAILED(hres)) { + /* Compilation failed. If compile_error didn't set up a proper VBS error, + * fall back to VBSE_SYNTAX_ERROR. */ + if(HRESULT_FACILITY(This->ctx->ei.scode) != FACILITY_VBS) { + clear_ei(&This->ctx->ei); + This->ctx->ei.scode = MAKE_VBSERROR(VBSE_SYNTAX_ERROR); + This->ctx->ei.bstrSource = get_vbscript_string(VBS_COMPILE_ERROR); + This->ctx->ei.bstrDescription = get_vbscript_string(VBSE_SYNTAX_ERROR); + } Why do we need this? The compiler seems to record an error in all cases except for out-of-memory. There is a lot of room for improvements for more accurate error codes (as shown by your other MRs), but those belong to compiler/parser.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10368#note_134364