Previously, everything returned from createObject was ObjectType
Now, it looks at the arguments, and if passed string literals, it is able to infer either the built-in Component/Object or a custom component:
dateTime = createObject("roDatetime") ' this is the InterfaceType `roDateTime`
dateTime.getHours() ' this is an integer
button = createObject("roSgnode", "Poster") ' this is the ComponentType `roSgNodePoster`
button.uri ' this is a string
if the args are not string literals, it still just returns ObjectType....
function getObject(objectName as string)
return createObject(objectName) ' this is just ObjectType
end function
Ok. Hmmm. I don’t know about making support for overloading functions yet, so maybe I’ll change this so it’s just a special case, and does not change the interface/constructors for anything yet.
Previously, everything returned from
createObject
wasObjectType
Now, it looks at the arguments, and if passed string literals, it is able to infer either the built-in Component/Object or a custom component:
if the args are not string literals, it still just returns ObjectType....