Hi guys, been doing some work on uROJSONParser today and I suggest you review TROJSONValue.IntLoadFromStream to support a trailing comma ( , ) in an array. Its common to see servers output such a stream and javascript in the browser seems to handle it. Javascript in a browser seems to handle this as it should be ignored. At the very least, you should put a null item on the end of the array if re-factoring the entire code is too hard so at least it doesn’t crash trying to turn ] into a number.
else if lChar = ']' then begin // array
clear;
end
else begin // number
AsNumber:= ReadNumber(AStream);
end;
let x = [1,2,3,4,5,];
x.forEach(function(value) { console.log(value); } );
let x = [1,2,3,4,5,null];
x.forEach(function(value) { console.log(value); } );
I wouldn’t use the delphi library as a guide to anything. Try it in chrome and you will see. If it works in chrome and therefore in NodeJS, then that’s the standard
And its the same in Firefox and Spidermonkey, so therefore, that’s just how it is.
The reason we use your library instead of the Delphi one is because the Delphi one is rubbish.