Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix issue with RangeError called on concat.apply() When calling the flatten function with a sufficiently large array it will throw: RangeError: Maximum call stack size exceeded This was found when processing very large xml documents and using a // selector in select(). This is due to the maximum argument length limit in javascript/node. Calling apply() with a sufficiently large array will throw a RangeError. See https://bugs.webkit.org/show_bug.cgi?id=80797 for details. Chunk the array into chunks that are smaller than the maximum argument list size using `slice()` and call `concat.apply()` on each chunk so that we never get the range error. * Argument limit issue - remove use of prototypeSlice and unnecessary use of min() Co-authored-by: Mike Noseworthy <mike.noseworthy@gmail.com>
- Loading branch information