Commit 00057128 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

vbscript: Implement TypeName(Nothing).

parent abbf0524
......@@ -2505,6 +2505,8 @@ static HRESULT Global_TypeName(BuiltinDisp *This, VARIANT *arg, unsigned args_cn
case VT_NULL:
return return_string(res, L"Null");
case VT_DISPATCH:
if (!V_DISPATCH(arg))
return return_string(res, L"Nothing");
if (SUCCEEDED(IDispatch_GetTypeInfo(V_DISPATCH(arg), 0, GetUserDefaultLCID(), &typeinfo)))
{
hres = ITypeInfo_GetDocumentation(typeinfo, MEMBERID_NIL, &name, NULL, NULL, NULL);
......
......@@ -1566,7 +1566,9 @@ MyObject.myval = 0
Call ok(CSng(MyObject) = 0, "CSng(MyObject) = " & CSng(MyObject))
Call ok(getVT(CSng(MyObject)) = "VT_R4", "getVT(CSng(MyObject)) = " & getVT(CSng(MyObject)))
Call ok(TypeName(Empty) = "Empty", "TypeName(MyEmpty) = " & TypeName(Empty))
Call ok(TypeName(Nothing) = "Nothing", "TypeName(Nothing) = " & TypeName(Nothing))
Call ok(getVT(TypeName(Nothing)) = "VT_BSTR", "getVT(TypeName(Nothing)) = " & getVT(TypeName(Nothing)))
Call ok(TypeName(Empty) = "Empty", "TypeName(Empty) = " & TypeName(Empty))
Call ok(getVT(TypeName(Empty)) = "VT_BSTR", "getVT(TypeName(Empty)) = " & getVT(TypeName(Empty)))
Call ok(TypeName(Null) = "Null", "TypeName(Null) = " & TypeName(Null))
Call ok(getVT(TypeName(Null)) = "VT_BSTR", "getVT(TypeName(Null)) = " & getVT(TypeName(Null)))
......
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