Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: don't pretty-print with out-of-range indexes (#298)
The code I added to catch ParseErrors from JS code was using (`pos`, `pos + 1`) as the range, but if the position was at the very end of the string (e.g. due to unbalanced parens), it would cause a crash because the end position would be null. To fix, I changed it to instead just use the last character in the code in that case rather than one after the last.
- Loading branch information