vbscript: Reset error number on error mode change.

This commit is contained in:
Jacek Caban 2014-06-13 17:27:44 +02:00 committed by Alexandre Julliard
parent 055129485d
commit be583662d4
2 changed files with 15 additions and 0 deletions

View File

@ -1276,6 +1276,7 @@ static HRESULT interp_errmode(exec_ctx_t *ctx)
TRACE("%d\n", err_mode);
ctx->resume_next = err_mode;
ctx->script->err_number = S_OK;
return S_OK;
}

View File

@ -284,6 +284,20 @@ x = 0
call callTestOnError(false)
call ok(x = 1, "x = " & x)
sub testOnErrorClear()
on error resume next
call ok(Err.Number = 0, "Err.Number = " & Err.Number)
throwInt(E_TESTERROR)
call ok(Err.Number = E_TESTERROR, "Err.Number = " & Err.Number)
on error goto 0
call ok(Err.Number = 0, "Err.Number = " & Err.Number)
x = "ok"
end sub
call testOnErrorClear()
call ok(x = "ok", "testOnErrorClear failed")
sub testForEachError()
on error resume next