diff --git a/packages/fcl-js/src/jstree.pp b/packages/fcl-js/src/jstree.pp index f6267d09cc..935dd395d3 100644 --- a/packages/fcl-js/src/jstree.pp +++ b/packages/fcl-js/src/jstree.pp @@ -230,7 +230,7 @@ Type Property Elements[AIndex : Integer] : TJSArrayLiteralElement Read GetE ; default; end; - { TJSArrayLiteral - [element1,...] } + { TJSArrayLiteral - [element1,...] or Args of a function } TJSArrayLiteral = Class(TJSElement) private @@ -328,6 +328,7 @@ Type Public Destructor Destroy; override; procedure AddArg(El: TJSElement); + procedure InsertArg(Index: integer; El: TJSElement); Property Expr : TJSElement Read FExpr Write FExpr; Property Args : TJSArguments Read FArgs Write FArgs; end; @@ -1698,6 +1699,14 @@ begin Args.Elements.AddElement.Expr:=El; end; +procedure TJSCallExpression.InsertArg(Index: integer; El: TJSElement); +var + NewEl: TJSArrayLiteralElement; +begin + NewEl:=TJSArrayLiteralElement(Args.Elements.Insert(Index)); + NewEl.Expr:=El; +end; + { TJSUnary } Class function TJSUnary.PrefixOperatorToken: tjsToken;