Special Variables

General Variables

The following special variables are accessible in general template script.

thisbox

A reference to the Box defined by the XML node containing it. It can also be thought of as a Box property.

thisobj

A reference to the Object/Array/etc defined by the XML node containing it.

static

The static context of the template in which it is called.

vexi

The immutable global vexi object.

Function Variables

The following special variables are accessible in the body of a function.

arguments

An immutable array of the arguments passed into a function. Its length is detirmined when the function is called and not by the method signature.

callee

The current function being executed.

this

this is a keyword

The context of the execution. When a function is being accessed as the property of an object the context is the object. For example in a.f() in the body of f this refers to a.

If a function is executed as a var then this==null.

In top level code the value of this may be assigned to a relevant context.

Trap Variables

The following special variables are accessible in the body of a trap.

cascade

cascade is a keyword

In a read trap, read from cascade to get the value from traps lower in the read trap chain or, if there are no further traps, the object property the trap is placed upon. (Reading directly from the property will invoke the read trap chain again, possibly causing an infinite loop.)

In a write trap, putting to cascade will caused lower traps in the write trap chain to be executed or, if there are no further traps, the value passed to cascade is put to the object property the trap is placed upon. (Writing directly to the property will invoke the write trap chain again, possibly causing an infinite loop.)

trapname

The name of the property upon which a trap is been placed.

trapee

Synonym for this

The object upon which a trap is been placed.

callee

The trap function - useful for anonymous removal of traps.

 


Copyright © 2011 The Vexi Project (vexi.sourceforge.net)