Commit 707f7eb2 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

vbscript: Add err.source implementation.

parent 0d9f024d
...@@ -2500,8 +2500,8 @@ static HRESULT Err_Number(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARI ...@@ -2500,8 +2500,8 @@ static HRESULT Err_Number(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARI
static HRESULT Err_Source(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) static HRESULT Err_Source(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res)
{ {
FIXME("\n"); TRACE("\n");
return E_NOTIMPL; return !This->desc ? E_UNEXPECTED : err_string_prop(&This->desc->ctx->ei.bstrSource, args, args_cnt, res);
} }
static HRESULT Err_Clear(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) static HRESULT Err_Clear(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res)
......
...@@ -2170,6 +2170,7 @@ HRESULT exec_script(script_ctx_t *ctx, function_t *func, vbdisp_t *vbthis, DISPP ...@@ -2170,6 +2170,7 @@ HRESULT exec_script(script_ctx_t *ctx, function_t *func, vbdisp_t *vbthis, DISPP
clear_ei(&ctx->ei); clear_ei(&ctx->ei);
ctx->ei.scode = hres = map_hres(hres); ctx->ei.scode = hres = map_hres(hres);
ctx->ei.bstrSource = get_vbscript_string(VBS_RUNTIME_ERROR);
ctx->ei.bstrDescription = get_vbscript_error_string(hres); ctx->ei.bstrDescription = get_vbscript_error_string(hres);
}else { }else {
hres = ctx->ei.scode; hres = ctx->ei.scode;
......
...@@ -134,6 +134,7 @@ sub testCStrError() ...@@ -134,6 +134,7 @@ sub testCStrError()
Error.clear() Error.clear()
CStr(null) CStr(null)
call ok(Err.number = 94, "Err.number = " & Err.number) call ok(Err.number = 94, "Err.number = " & Err.number)
if isEnglishLang then call ok(Err.source = "Microsoft VBScript runtime error", "Err.source = " & Err.source)
if isEnglishLang then call ok(Err.description = "Invalid use of Null", "Err.description = " & Err.description) if isEnglishLang then call ok(Err.description = "Invalid use of Null", "Err.description = " & Err.description)
end sub end sub
call testCStrError() call testCStrError()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment