From: Francis De Brabandere <francisdb@gmail.com> An error raised inside a function obtained from GetRef and invoked from script under the caller's On Error Resume Next must propagate to that caller, not be reported to the host via IActiveScriptSite::OnScriptError. --- dlls/vbscript/tests/run.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/dlls/vbscript/tests/run.c b/dlls/vbscript/tests/run.c index decde599d0c..8f7eb301c09 100644 --- a/dlls/vbscript/tests/run.c +++ b/dlls/vbscript/tests/run.c @@ -3540,6 +3540,32 @@ static void test_redefine_scope(void) } } +static void test_getref_error_reporting(void) +{ + /* An error raised inside a function reference obtained from GetRef, when + * the reference is called from script under the caller's On Error Resume + * Next, must propagate to that caller rather than be reported to the host. */ + static const WCHAR *src = + L"Dim cb : Set cb = GetRef(\"RaisesError\")\n" + L"Sub CallIndirect\n" + L" On Error Resume Next\n" + L" cb\n" + L" On Error Goto 0\n" + L"End Sub\n" + L"Sub RaisesError\n" + L" Err.Raise 5\n" + L"End Sub\n" + L"CallIndirect\n"; + HRESULT hres; + + SET_EXPECT(OnScriptError); + hres = parse_script_wr(src); + ok(hres == S_OK, "parse_script_wr returned %08lx\n", hres); + todo_wine ok(!called_OnScriptError, + "error in a GetRef reference under the caller's On Error Resume Next was reported to the host\n"); + CLEAR_CALLED(OnScriptError); +} + static void test_msgbox(void) { HRESULT hres; @@ -4237,6 +4263,7 @@ static void run_tests(void) test_option_explicit_errors(); test_parse_errors(); test_redefine_scope(); + test_getref_error_reporting(); test_parse_context(); test_callbacks(); test_multiple_parse(); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10980