Run-time type information is in-part supported by DWScript, including the ability to enumerate properties and class members. RTTI is implemented by the DWScript JavaScript compiler, if the "Emit RTTI information" is defined in the a projects build configuration. Currently only published properties are part of this information.


Once activated, the following class:


type

  TBase = class

  published

    Field: Int32 = 1;

  end;


Results in the following RTTI JavaScript object:


var $RTTI = [

       {

T: {ID:TBase},

A: { ClassType: RTTIPropertyAttribute,

N: "Field",

T: {ID:Number},

C: 3,

G: function (s) { return s.Field },

S: function (s,v) { s.Field=v } }

}

];