Despite of its name Object is a class that contains methods of objects in tiscript. Last line here will be evaluated to true:
var obj = { one:1, two:2 }; // creating object from literal
if( obj instanceof Object )
stdout.printf( "I am an instance of Object" ); // will output this
Properties | |
| className | readonly, string. Name of the class if object was created as instance of user defined class. |
| length | readonly, integer. Returns total number of members this instance contains. |
Methods | |
| this | ( )
constructor, creates instance of Object class - object per se. |
| toString toLocaleString |
( ) : string
Returns string |
| valueOf | ( ) : value
Returns object itself. |
| clone | ( ) : value
Makes copy of the object and returns it. |
| exists | ( tag: value, [deep = false] ) : true | false
Checks property by its tag for existence. If deep == true then does deep lookup - in objects itself and its chain of classes. |
| remove | ( tag: value ) : void
Removes property of the object by its tag (a.k.a. name). |
| call | ( func: function, [p1:value, p2:value, ... pN:value [, argv: array] ] ) : value
Calls the func with context of this equal to the object. Parameters if given passed to the function. If argv is provided then its memebers will be added to the list of parameters of the call. |
| show | ( [out: Stream] ) : void
Reports class name and list of property name/values of the object. Intended to use for debugging purposes. |
| eval | ( what: string | Stream [, namespace: object] ): value
Evaluates (interprets) what with context of this equal to the object. If namespace object is given then it is used as global namespace for evaluated code. |
| propertyAt | ( tag: value ) : value
Does lookup in the object for member/property by its tag. This is a direct equivalent of obj.tag construction. |