Properties
- Code: String Reads and writes the code contained in the class. This property may be empty, even though Compiled is true.
- Compiled: Boolean When true the class contains an image of the compiled javascript in Code.
- constructor Create; overload; Creates an empty class with no javascript.
- constructor Create(const ACode: String); overload; Automatically populates the Code property with the javascript in ACode.
- constructor Create(const ACode: String; AEngine: TJSEngine); overload; Automatically populates the Code property, then compiles it using the provided TJSEngine instance.
- procedure Compile(AEngine: TJSEngine); Compiles the contained javascript and sets Compiled to true.
- procedure Execute(AEngine: TJSEngine); overload; Executes the javascript using the provided TJSEngine instance in the global scope.
- procedure Execute(AEngine: TJSEngine; AScope: TJSObject); overload; Executes the javascript using the provided TJSEngine instance in the specified scope.
- procedure LoadCompiled(const AFile: String; AEngine: TJSEngine); Loads the precompiled javascript code from the specified file. The Compiled property is set to true, and the Code property is emptied.
- procedure LoadCompiledFromStream(AStream: TStream; AEngine: TJSEngine); Loads the precompiled javascript code from the specified stream. The Compiled property is set to true, and the Code property is emptied.
- procedure LoadRaw(const AFile: String); Loads raw (text) javascript from the specified file. The Compiled property is set to false.
- procedure SaveCompiled(const AFile: String; AEngine: TJSEngine); Attempts to save the compiled javascript to the specified file. If the javascript has not yet been compiled, it will attempt to do so.
- procedure SaveCompiledToStream(AStream: TStream; AEngine: TJSEngine); Saves the compiled javascript to the specified stream. If the javascript has not yet been compiled, it will attempt to do so.
- procedure SaveRaw(const AFile: String); Saves the raw (text) javascript to the specified file.