VM namespace

Virtual Machine (VM) related methods and properties.

Methods of this namespace are not always available to the script - they depend on feature parameters of VM creation.



(obj: any, name: string | symbol): any | undefined

Gets property of obj by its name.

Equivalent of const name = "..."; var val = obj.(name);

(obj: any, name:string | symbol, val: any): any | undefined

Sets property of obj by its name.

Equivalent of const name = "..."; obj.(name) = val;

(entity: any) : integer

Returns "unique" identifier of an entity. For heap allocated entities (object, array, string, etc) it returns some sequential number (int32).  For value types (integer, float, length, etc.) it returns value of hash(entity). Note that uniqueness of id is not strict - there is very low but still probability of conflicts.


r/w, function - global unhandled exception handler. Accepts function(err) : true | false that will receive error object. If that function returns true then the exception is considered as handled and will not be output to stderr port.
r-only - list of pending (active) async tasks: 
for (var task in VM.pendingAsyncTasks)
  debug task: task.function.fullName;