Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array length/memory errors with the range operator #240

Closed
deepilla opened this issue Jun 22, 2018 · 0 comments · Fixed by #342
Closed

Array length/memory errors with the range operator #240

deepilla opened this issue Jun 22, 2018 · 0 comments · Fixed by #342
Labels

Comments

@deepilla
Copy link
Contributor

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?

@deepilla deepilla changed the title Array/Memory errors with the range operator Array length/memory errors with the range operator Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants