Signed-off-by: Robert Wilhelm robert.wilhelm@gmx.net --- dlls/vbscript/global.c | 4 ++++ dlls/vbscript/tests/api.vbs | 2 ++ 2 files changed, 6 insertions(+)
diff --git a/dlls/vbscript/global.c b/dlls/vbscript/global.c index d4b9344206..59265fd23d 100644 --- a/dlls/vbscript/global.c +++ b/dlls/vbscript/global.c @@ -2202,11 +2202,15 @@ static HRESULT Global_TypeName(BuiltinDisp *This, VARIANT *arg, unsigned args_cn static const WCHAR BooleanW[] = {'B', 'o', 'o', 'l', 'e', 'a', 'n', 0}; static const WCHAR EmptyW[] = {'E', 'm', 'p', 't', 'y', 0}; static const WCHAR NullW[] = {'N', 'u', 'l', 'l', 0}; + static const WCHAR ArrayW[] = {'V', 'a', 'r', 'i', 'a', 'n', 't', '(', ')', 0};
TRACE("(%s)\n", debugstr_variant(arg));
assert(args_cnt == 1);
+ if (V_ISARRAY(arg)) + return return_string(res, ArrayW); + switch(V_VT(arg)) { case VT_UI1: return return_string(res, ByteW); diff --git a/dlls/vbscript/tests/api.vbs b/dlls/vbscript/tests/api.vbs index 6add0579e8..4834029183 100644 --- a/dlls/vbscript/tests/api.vbs +++ b/dlls/vbscript/tests/api.vbs @@ -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))) -- 2.26.2