Download Winsoft JSEngine v4.5 Full Source for Delphi/C++ Builder 6 - 11 and Lazarus

Winsoft JSEngine v4.5 Full Source for Delphi/C++ Builder 6 - 11 and Lazarus

Winsoft JSEngine v4.5 Full Source for Delphi/C++ Builder 6 - 11 and Lazarus
Winsoft JSEngine v4.5 Full Source for Delphi/C++ Builder 6 - 11 and Lazarus


jаvascript engine for Delphi and C++ Builder.

uses Microsoft ChakraCore jаvascript engine
supports Windows 32 and Windows 64
available for Delphi/C++ Builder 6 - 11 and Lazarus 2.0.12
source code included in registered version
distributing library in applications is royalty free

type
{$ifdef D2009PLUS}
  WString = string;
{$else}
  WString = WideString;
{$endif D2009PLUS}

  EJsEngine = class(Exception)
  end;

  TNativeFunctionEvent = procedure (Sender: TObject; Callee: JsValueRef; IsConstructCall: Boolean; Arguments: array of JsValueRef; var Result: JsValueRef) of object;

  TRuntimeAttribute =
  (
    raNoBackgroundWork, raScriptInterrupt, raIdleProcessing,
    raNoNativeCodeGeneration, raDisableEval, raExperimentalFeatures,
    raDispatchToDebugger
  );
  TRuntimeAttributes = set of TRuntimeAttribute;

  TJsEngine = class
  public
    constructor Create(RuntimeAttributes: TRuntimeAttributes = []);
    destructor Destroy; override;

    function Call(Function_: JsValueRef; Arguments: array of JsValueRef): JsValueRef;
    function Call(const FunctionName: string; Arguments: array of JsValueRef): JsValueRef;
    procedure CollectGarbage;
    function ContextOf(Value: JsValueRef): JsContextRef;
    function ConvertToStringValue(Value: JsValueRef): JsValueRef;
    function ConvertToString(Value: JsValueRef): WString;
    function ConvertToBoolean(Value: JsValueRef): JsValueRef;
    function ConvertToNumber(Value: JsValueRef): JsValueRef;
    function ConvertToObject(Value: JsValueRef): JsValueRef;
    function CreateArray(Length: Integer): JsValueRef;
    function CreateArrayBuffer(Length: Integer): JsValueRef;
    function CreateBoolean(Value: Boolean): JsValueRef; overload;
    function CreateContext: JsContextRef;
    function CreateError(const Message: WString): JsValueRef;
    function CreateNumber(Value: Double): JsValueRef; overload;
    function CreateNumber(Value: Integer): JsValueRef; overload;
    function CreateObject: JsValueRef;
    procedure CreateProperty(Object_: JsValueRef; const PropertyName, GetterName, SetterName: WString; Enumerable: Boolean = False; Configurable: Boolean = False);
    procedure CreateProperty(Object_: JsValueRef; const PropertyName: WString; Value: JsValueRef; Writable: Boolean = True; Enumerable: Boolean = False; Configurable: Boolean = False);
    function CreateRangeError(const Message: WString): JsValueRef;
    function CreateReferenceError(const Message: WString): JsValueRef;
    function CreateString(const Value: WString): JsValueRef;
    function CreateSyntaxError(const Message: WString): JsValueRef;
    function CreateTypeError(const Message: WString): JsValueRef;
    function CreateURIError(const Message: WString): JsValueRef;
    procedure DeleteIndexedProperty(Object_: JsValueRef; Index: Integer);
    function DeleteProperty(Object_: JsValueRef; const PropertyName: WString; UseStrictRules: Boolean = True): Boolean;
    function GetAndClearException: JsValueRef;
    function GetArgument(Arguments: PJsValueRef; Index: Integer): JsValueRef;
    function GetArrayItem(Array_: JsValueRef; Index: Integer): JsValueRef;
    function GetArrayLength(Array_: JsValueRef): Integer;
    function GetErrorColumn(Error: JsValueRef): Integer;
    function GetErrorLine(Error: JsValueRef): Integer;
    function GetErrorMessage(Error: JsValueRef): WString;
    function GetErrorName(Error: JsValueRef): WString;
    function GetErrorSource(Error: JsValueRef): WString;
    function GetIndexedProperty(Object_: JsValueRef; Index: Integer): JsValueRef;
    function GetOwnPropertyNames(Object_: JsValueRef): TStringDynArray;
    function GetPrototype(Object_: JsValueRef): JsValueRef;
    function GetProperty(Object_: JsValueRef; const PropertyName: WString): JsValueRef;
    function GetValueType(Value: JsValueRef): JsValueType;
    function HasIndexedProperty(Object_: JsValueRef; Index: Integer): Boolean;
    function HasProperty(Object_: JsValueRef; const PropertyName: WString): Boolean;
    procedure Idle(NextIdleTick: LongWord = 0);
    function IsArray(Value: JsValueRef): Boolean;
    function IsArrayBuffer(Value: JsValueRef): Boolean;
    function IsBoolean(Value: JsValueRef): Boolean;
    function IsDataView(Value: JsValueRef): Boolean;
    function IsEqual(Object1, Object2: JsValueRef): Boolean;
    function IsError(Value: JsValueRef): Boolean;
    function IsExtensible(Object_: JsValueRef): Boolean;
    function IsFunction(Value: JsValueRef): Boolean;
    function IsInstanceOf(Object_, Constructor_: JsValueRef): Boolean;
    function IsNull(Value: JsValueRef): Boolean;
    function IsNumber(Value: JsValueRef): Boolean;
    function IsObject(Value: JsValueRef): Boolean;
    function IsStrictEqual(Object1, Object2: JsValueRef): Boolean;
    function IsString(Value: JsValueRef): Boolean;
    function IsStringProperty(PropertyId: JsPropertyIdRef): Boolean;
    function IsSymbol(Value: JsValueRef): Boolean;
    function IsSymbolProperty(PropertyId: JsPropertyIdRef): Boolean;
    function IsTypedArray(Value: JsValueRef): Boolean;
    function IsUndefined(Value: JsValueRef): Boolean;
    function ParseScript(const Script: WString; const Url: WString = ''): JsValueRef;
    procedure PreventExtension(Object_: JsValueRef);
    function RegisterFunction(const Name: WString): JsValueRef;
    function RegisterFunction(const Name: WString; NativeFunction: JsNativeFunction; CallbackState: Pointer): JsValueRef;
    function RegisterMethod(Object_: JsValueRef; const Name: WString): JsValueRef;
    function RegisterMethod(Object_: JsValueRef; const Name: WString; NativeFunction: JsNativeFunction; CallbackState: Pointer): JsValueRef;
    function RunScript(const Script: WString; const Url: WString = ''): JsValueRef;
    function RuntimeOf(Context: JsContextRef): JsRuntimeHandle;
    procedure SetException(Exception: JsValueRef);
    procedure SetIndexedProperty(Object_: JsValueRef; Index: Integer; Value: JsValueRef);
    procedure SetProperty(Object_: JsValueRef; const PropertyName: WString; Value: JsValueRef; UseStrictRules: Boolean = True);
    procedure SetPrototype(Object_, Prototype: JsValueRef);
    function ToBoolean(Value: JsValueRef): Boolean;
    function ToDouble(Value: JsValueRef): Double;
    function ToInteger(Value: JsValueRef): Integer;
    function ToString(Value: JsValueRef): WString;

    property Context: JsContextRef read;
    property CurrentContext: JsContextRef read write;
    property FalseValue: JsValueRef read;
    property GlobalObject: JsValueRef read;
    property HasException: Boolean read;
    property MemoryLimit: LongWord read write;
    property MemoryUsage: LongWord read;
    property NullValue: JsValueRef read;
    property PropertyId[const Name: WString]: JsPropertyIdRef read;
    property PropertyName[PropertyId: JsPropertyIdRef]: WString read;
    property Runtime: JsRuntimeHandle read;
    property TrueValue: JsValueRef read;
    property UndefinedValue: JsValueRef read;

    property OnNativeFunction: TNativeFunctionEvent read write;
  end;

procedure Check(Error: JsErrorCode);


What's new

Version 4.5
updated ChakraCore DLL libraries
added Delphi/C++ Builder 11 files


Only for V.I.P
Warning! You are not allowed to view this text.
  • 12