Yes (I mean, no, it should use
ObjHasOwnProp). It so happens that I have already prepared updates to this part of the documentation due to changes being made in the next alpha.
Also, "Class" is incorrect; it has been "Prototype" since instance and static members were separated.
Code: Select all
TypeOf(Value)
{
if Value is Object && ObjHasOwnProp(Value, "__Class")
return "Prototype"
if (comClass := ComObjType(Value, "Class")) != ""
return comClass
while Value := ObjGetBase(Value)
if ObjHasOwnProp(Value, "__Class")
return Value.__Class
return "Object"
}
I renamed it because it also works for values which aren't Object, and in the next alpha it will also work for generic COM wrapper objects.
Actually, I realize this version isn't quite correct because
Value is Object will return false for prototype objects such as
Integer.Prototype.