Skip to content

Commit

Permalink
Ignore indexed properties when stringifying + update test
Browse files Browse the repository at this point in the history
  • Loading branch information
EricGrange committed Jan 25, 2022
1 parent 55eca20 commit 17f4bff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Source/dwsJSONScript.pas
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,9 @@ class procedure JSONScript.StringifyComposite(exec : TdwsExecution;
for i:=0 to compSym.Members.Count-1 do begin
sym:=compSym.Members[i];
if sym.ClassType=TPropertySymbol then begin
propSym:=TPropertySymbol(sym);
propSym := TPropertySymbol(sym);
if propSym.HasArrayIndices then
continue;
if (propSym.Visibility>=cvPublished) and (propSym.ReadSym<>nil) then
sym:=propSym.ReadSym
else continue;
Expand Down
1 change: 1 addition & 0 deletions Test/JSONConnectorPass/stringify_class_getter.pas
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ TTest = class
property Num : Float read (3.14);
property Arr : array of String read (StrSplit('abc,de', ','));
property Sub : TSubTest;
property Indexed[i : Integer] : String read (i.ToString);
end;

var i := new TTest;
Expand Down

0 comments on commit 17f4bff

Please sign in to comment.