[fpc-pascal] PAS2JS: JSON suggestion

2018-01-11 Thread warleyalex via fpc-pascal
IMHO, the TJSJSON external class definition is incorrect. Currently, we have class function, if you want to use the stringify method, use this wierd way: TJSJSON.stringify( jsObject); I think code that don't have mutual dependencies should be separate in units: unit ECMA.Json;interface{$mode objfpc

Re: [fpc-pascal] PAS2JS: operations with array of record

2018-01-11 Thread warleyalex via fpc-pascal
Thanks a lot for the feedback. it worked as expected! The solution was: /* in DWScript world */var recA : JA;recB : JB;recC : JC;for var k:=0 to 2 do begin recC.id := k; recC.name := 'abc'+IntToStr(k); recC.age := 10+k; recB.field1 := 'rec'+ IntToStr(k); recB.params.Add(recC); recA.fi

[fpc-pascal] PAS2JS: operations with array of record

2018-01-10 Thread warleyalex via fpc-pascal
Since it's missing the Pas2JS specific forum, I don't know if here is correct place to post things about "Pas2JS".  I'm using it a lot and it's very promising. I came across with issue when dealing with array of records. I would like to convert this little piece of DWScript code to Pas2JS, unfor