From: Robert Wilhelm robert.wilhelm@gmx.net
--- dlls/vbscript/global.c | 3 +++ dlls/vbscript/tests/api.vbs | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+)
diff --git a/dlls/vbscript/global.c b/dlls/vbscript/global.c index 470db2c1980..8c2e5b85982 100644 --- a/dlls/vbscript/global.c +++ b/dlls/vbscript/global.c @@ -1184,6 +1184,9 @@ static HRESULT Global_LBound(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, case VT_VARIANT|VT_ARRAY|VT_BYREF: sa = *V_ARRAYREF(arg); break; + case VT_EMPTY: + case VT_NULL: + return MAKE_VBSERROR(VBSE_TYPE_MISMATCH); default: FIXME("arg %s not supported\n", debugstr_variant(arg)); return E_NOTIMPL; diff --git a/dlls/vbscript/tests/api.vbs b/dlls/vbscript/tests/api.vbs index a60fa046b69..c0ac6c56cf5 100644 --- a/dlls/vbscript/tests/api.vbs +++ b/dlls/vbscript/tests/api.vbs @@ -292,6 +292,24 @@ Call ok(Lbound(arr2) = 0, "Lbound(x) = " & Lbound(x)) Call ok(Lbound(arr2, 1) = 0, "Lbound(x) = " & Lbound(x)) Call ok(Lbound(arr2, 2) = 0, "Lbound(x) = " & Lbound(x))
+sub testLBoundError() + on error resume next + call Err.clear() + call LBound() + call ok(Err.number = 450, "Err.number = " & Err.number) + call Err.clear() + call LBound(Empty) + call ok(Err.number = 13, "Err.number = " & Err.number) + call Err.clear() + call LBound(Null) + call ok(Err.number = 13, "Err.number = " & Err.number) + call Err.clear() + call LBound(arr, 1, 2) + call ok(Err.number = 450, "Err.number = " & Err.number) + if isEnglishLang then call ok(Err.description = "Wrong number of arguments or invalid property assignment", _ + "Err.description = " & Err.description) +end sub + sub testUBoundError() on error resume next call Err.clear() @@ -309,6 +327,8 @@ sub testUBoundError() if isEnglishLang then call ok(Err.description = "Wrong number of arguments or invalid property assignment", _ "Err.description = " & Err.description) end sub + +call testLBoundError() call testUBoundError()
Dim newObject