mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-04-07 18:07:49 +02:00
* Added JSValueArrayOf
This commit is contained in:
parent
276d288ca0
commit
c0a7e45415
@ -962,6 +962,7 @@ var
|
||||
// JSExceptValue can be used in catch blocks to access the JS throw value
|
||||
JSExceptValue: JSValue; external name '$e';
|
||||
|
||||
Function JSValueArrayOf(Args : Array of const) : TJSValueDynArray;
|
||||
function new(aElements: TJSValueDynArray) : TJSObject; overload;
|
||||
function JSDelete(const Obj: JSValue; const PropName: string): boolean; assembler; overload;
|
||||
|
||||
@ -1016,6 +1017,18 @@ Const
|
||||
|
||||
implementation
|
||||
|
||||
Function JSValueArrayOf(Args : Array of const) : TJSValueDynArray;
|
||||
|
||||
var
|
||||
I : Integer;
|
||||
|
||||
begin
|
||||
SetLength(Result,Length(Args));
|
||||
for I:=0 to Length(Args)-1 do
|
||||
Result[i]:=Args[i].VJSValue
|
||||
end;
|
||||
|
||||
|
||||
function new(aElements: TJSValueDynArray): TJSObject;
|
||||
|
||||
function toString(I : Integer): string; external name 'String';
|
||||
|
Loading…
Reference in New Issue
Block a user