tdegrunt / jsonschema

JSON Schema validation
Other
1.83k stars 263 forks source link

maximum call stack size exceeded when having a lot of errors #344

Closed dpralon closed 2 years ago

dpralon commented 3 years ago

If I have a lot of errors when validating an array with a lot of documents, the function ValidatorResult.prototype.importErrors in helpers.js crashes when doing : Array.prototype.push.apply(this.errors, res.errors) because apply will push as many parameters as the number of elements in the res.errors array, on the stack, hence the exception. This line can be replaced with : this.errors = this.errors.concat(res.errors)