vbscript: Reset error number on error mode change.
This commit is contained in:
parent
055129485d
commit
be583662d4
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue