Module: wine Branch: master Commit: 707f7eb2a17ccb49a1b7a12ae8f1955002664abc URL: https://source.winehq.org/git/wine.git/?a=commit;h=707f7eb2a17ccb49a1b7a12ae...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Oct 3 18:19:03 2019 +0200
vbscript: Add err.source implementation.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/vbscript/global.c | 4 ++-- dlls/vbscript/interp.c | 1 + dlls/vbscript/tests/api.vbs | 1 + 3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/vbscript/global.c b/dlls/vbscript/global.c index 41a91b6a27..5fa38815c2 100644 --- a/dlls/vbscript/global.c +++ b/dlls/vbscript/global.c @@ -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) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + 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) diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index 3ffbbb1c15..0fb628c59a 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -2170,6 +2170,7 @@ HRESULT exec_script(script_ctx_t *ctx, function_t *func, vbdisp_t *vbthis, DISPP clear_ei(&ctx->ei);
ctx->ei.scode = hres = map_hres(hres); + ctx->ei.bstrSource = get_vbscript_string(VBS_RUNTIME_ERROR); ctx->ei.bstrDescription = get_vbscript_error_string(hres); }else { hres = ctx->ei.scode; diff --git a/dlls/vbscript/tests/api.vbs b/dlls/vbscript/tests/api.vbs index 5c59a9a4b3..1b5c38cdd9 100644 --- a/dlls/vbscript/tests/api.vbs +++ b/dlls/vbscript/tests/api.vbs @@ -134,6 +134,7 @@ sub testCStrError() Error.clear() CStr(null) 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) end sub call testCStrError()