vbscript: Support arrays in TypeName.

Signed-off-by: Robert Wilhelm <robert.wilhelm@gmx.net>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Robert Wilhelm 2020-08-24 11:57:40 +02:00 committed by Alexandre Julliard
parent b72d8118da
commit 769dd6aed4
2 changed files with 5 additions and 0 deletions

View File

@ -2203,6 +2203,9 @@ static HRESULT Global_TypeName(BuiltinDisp *This, VARIANT *arg, unsigned args_cn
assert(args_cnt == 1);
if (V_ISARRAY(arg))
return return_string(res, L"Variant()");
switch(V_VT(arg)) {
case VT_UI1:
return return_string(res, ByteW);

View File

@ -1380,6 +1380,8 @@ Call ok(TypeName(CStr(0.5)) = "String", "TypeName(CStr(0.5)) = " & TypeName(CStr
Call ok(getVT(TypeName(CStr(0.5))) = "VT_BSTR", "getVT(TypeName(CStr(0.5))) = " & getVT(TypeName(CStr(0.5))))
Call ok(TypeName(True) = "Boolean", "TypeName(True) = " & TypeName(True))
Call ok(getVT(TypeName(True)) = "VT_BSTR", "getVT(TypeName(True)) = " & getVT(TypeName(True)))
Call ok(TypeName(arr) = "Variant()", "TypeName(arr) = " & TypeName(arr))
Call ok(getVT(TypeName(arr)) = "VT_BSTR", "getVT(TypeName(arr)) = " & getVT(TypeName(arr)))
Call ok(VarType(Empty) = vbEmpty, "VarType(Empty) = " & VarType(Empty))
Call ok(getVT(VarType(Empty)) = "VT_I2", "getVT(VarType(Empty)) = " & getVT(VarType(Empty)))