Commit 95845e9f authored by Robert Wilhelm's avatar Robert Wilhelm Committed by Alexandre Julliard

vbscript: Return type mismatch for LBound(Empty) and LBound(NULL).

parent f23a50d1
......@@ -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;
......
......@@ -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
......
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