Merged
Conversation
blakeembrey
commented
Apr 1, 2026
| }); | ||
|
|
||
| it("should throw on eol backslash in quoted param", () => { | ||
| expect(() => parse('/foo/:"bar\\')).toThrow( |
Member
Author
There was a problem hiding this comment.
Within quotes are fine to increment the undefined because it's already handling the Unterminated quote error. If we wanted to be extra safe we could add the same error there, but I think it's simpler and clearer to keep the current error message.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #434 +/- ##
=======================================
Coverage 99.74% 99.74%
=======================================
Files 1 1
Lines 389 392 +3
Branches 148 150 +2
=======================================
+ Hits 388 391 +3
Misses 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #433. Most straightforward approach that takes minimal bytes.
An alternative might be to re-introduce the
consumefunction that throws an error itself, andtryConsumetoken by token, but I removed that a while back to reduce bytes and function call overhead. The main difference would come down to the error message, which using atryConsumestyle approach would hit the universal error message and print something likeUnexpected end at index 9, expected charfrom:I don't think adding the overhead back is worth it in this case, it's simpler to treat it as a one off error to handle.