You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The range operator doesn't do any checks on the size of the arrays that it creates. If you try to create an array larger than JavaScript can handle, e.g. [1..1e10], you get an Invalid array length error. Note that this is a JavaScript error rather than a JSONata error. Maybe JSONata could check for this case and handle it more gracefully.
Along similar lines, the array [1..1e9] is legal but my machine runs out of memory trying to evaluate it. I suspect that if memory were not an issue, the expression would still be prohibitively slow to run. Is it worth imposing an upper bound on range operator array size?
The text was updated successfully, but these errors were encountered:
deepilla
changed the title
Array/Memory errors with the range operator
Array length/memory errors with the range operator
Jun 25, 2018
The range operator doesn't do any checks on the size of the arrays that it creates. If you try to create an array larger than JavaScript can handle, e.g.
[1..1e10]
, you get an Invalid array length error. Note that this is a JavaScript error rather than a JSONata error. Maybe JSONata could check for this case and handle it more gracefully.Along similar lines, the array
[1..1e9]
is legal but my machine runs out of memory trying to evaluate it. I suspect that if memory were not an issue, the expression would still be prohibitively slow to run. Is it worth imposing an upper bound on range operator array size?The text was updated successfully, but these errors were encountered: