Fix parsing of stray commas in let/const declarations#1249
Open
skdoosh wants to merge 1 commit intoquick-lint:masterfrom
Open
Fix parsing of stray commas in let/const declarations#1249skdoosh wants to merge 1 commit intoquick-lint:masterfrom
skdoosh wants to merge 1 commit intoquick-lint:masterfrom
Conversation
|
CLA Assistant Lite bot Thank you for your contribution! Like many free software projects, you must sign our Contributor License Agreement before we can accept your contribution. EDIT: All contributors have signed quick-lint-js' Contributor License Agreement (CLA-v1.md). |
Author
|
I have read and hereby agree to quick-lint-js' Contributor License Agreement (CLA-v1.md). |
Author
|
recheck |
Author
|
Hi @strager , this PR fixes the stray comma / unexpected token diagnostic in parse-let-bindings. All other tests pass and no other code is changed. Ready for review. |
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.
Fix parsing diagnostics for let and const statements. Fixes issue #639 :
Correctly distinguishes between no bindings (e.g., let\nx) and stray commas in multi-variable declarations (e.g., const [a, setA] = useState(), const [b, setB] = useState();).
Ensures the appropriate diagnostic is emitted:
Diag_Let_With_No_Bindings for entirely missing bindings.
Diag_Stray_Comma_In_Let_Statement for extra commas between declarations.
Diag_Unexpected_Token_In_Variable_Declaration otherwise.
Does not add any new tests or change existing functionality outside this parsing case.