* Added JSValueArrayOf

This commit is contained in:
Michaël Van Canneyt 2023-03-14 22:26:23 +01:00
parent 276d288ca0
commit c0a7e45415

View File

@ -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';