* Add constructor to TJSArray that accepts array of const

This commit is contained in:
Michaël Van Canneyt 2024-06-06 09:23:42 +02:00
parent cc1403e4db
commit dbc3d6b98f

View File

@ -616,6 +616,7 @@ type
procedure _SetElements(Index: NativeInt; const AValue: TJOB_JSValue);
procedure _SetLength(const AValue: NativeInt);
public
constructor Create(aArgs : Array of const); overload;
function isArray(a: TJOB_JSValue): Boolean; overload;
function concat(el: TJOB_JSValue): IJSArray; overload; {varargs;}
//function copyWithin(aTarget: NativeInt): IJSArray;overload; // not in IE
@ -1600,6 +1601,11 @@ begin
WriteJSPropertyLongInt('length',AValue);
end;
constructor TJSArray.Create(aArgs: array of const);
begin
JOBCreate(aArgs);
end;
function TJSArray.isArray(a: TJOB_JSValue): Boolean;
begin
Result:=InvokeJSBooleanResult('isArray',[a]);