Delphi
| projects: | Home Articles JavaScript Bridge |
|---|---|
| resources: | Bugs Mailing List Source Code Sidebar |
Bridge Classes: TJSBoolean
This class contains a boolean value (accessed by the property Value) which can be
accessed and modified by both native code (Delphi / Kylix) and script. A change from either codespace
is immediately reflected in the other codespace. This class will provide basic functionality even when
not connected to a JavaScript engine. This class is presently not threadsafe.
Properties
- Connected: Boolean
When true the object is connected to an instance ofTJSEngine, permitting interaction with script code. - Destroying: Boolean
Developers should not need to access this property. It is used when an instance ofTJSEngineis shut down. - Engine: TJSEngine
Use this property to access the engine to which theTJSBooleanis connected. - JScriptVal: jsval
Only advanced developers should use this property. It can be used in SpiderMonkey callback functions, or API calls, for instance. - JSName: string
This is the name associated with the variable in JavaScript. - JSObject: PJSObject
Only advanced users should use this property. A developer can use this value when working with the SpiderMonkey API. - Parent: TJSObject
The parent is the scope from which the currentTJSBooleanis accessible. If no parent was assigned when theTJSBooleanwas created it will default toTJSEngine.Global. - Value: Boolean
Access this property to get or set the boolean value for both Delphi / Kylix and JavaScript.
Methods
- constructor Create(AValue: PJSObject; AEngine: TJSEngine; const AName: string);
Creates a newTJSBooleanat the global scope namedAName. - constructor Create(AValue: PJSObject; AEngine: TJSEngine; const AName: string; AParent: TJSObject);
Creates a newTJSBooleanat the specified scope namedAName. - procedure Connect(AEngine: TJSEngine; AName: string; AParent: TJSObject);
procedure Connect(AEngine: TJSEngine; AName: string);
Connects theTJSBooleanto the engine. The first declaration will assign the JavaScript object to the specified scope, while the second will default the scope to global.