Object object
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 "[object Object]". |
| 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. |
| seal |
( [strict:true|false] ) : object
Locks structure of the object - after the call any attempt to add or remove object's property will throw an error. Values of existing properties can be changed though. Returns the object iself. If strict parameter is provided and it is exactly true then any attempt to get unknown property will throw an error. |
| isSealed |
( [strict:true|false] ) : true | false | undefined
Returns true if the object is sealed. If strict parameter is provided and is exactly true then the method returns true only if seal(true) was called for it. |
| freeze |
( [strict:true|false] ) : object
Locks the object - makes it immutable - any attempt to add, remove and modify value of any object's property will throw an error. Returns the object itself. If there is a strict parameter and it is exactly true then any attempt to get unknown property will throw an error. |
| isFrozen |
( [strict:true|false] ) : true | false | undefined
Returns true if the object is frozen. If strict parameter is provided and is exactly true then the method returns true only if freeze(true) was called for it. |
|