renan-guimaraes / dwscript

Automatically exported from code.google.com/p/dwscript
0 stars 0 forks source link

TdwsJSONWriter does not handle arrays of arrays correctly #297

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

procedure Test;
var
   arr: TdwsJSONArray;
begin
   arr := TdwsJSONArray.Create;
   arr.Add(TdwsJSONArray.Create);
   arr.Add(TdwsJSONArray.Create);
   arr.ToString;
end;

Expected: This should work.
Observed: 

procedure TdwsJSONWriter.BeginArray;
begin
   Assert(FState in [wsNone, wsObjectValue, wsArray]); //assertion failure here, as FState is wsArrayValue upon beginning to serialize the second sub-array

Original issue reported on code.google.com by masonwhe...@gmail.com on 3 Oct 2012 at 2:03

GoogleCodeExporter commented 9 years ago
Fixed

Original comment by zar...@gmail.com on 3 Oct 2012 at 6:34