Repository navigation
Fix #1050: refer to a munged catch binding by its gensym - #1051
Merged
Merged
Conversation
`emit-special 'try` registered the catch binding in `:var->ident` under its munged name, but references in the body are looked up by the original symbol. A name that needs munging (e.g. `abort-error`) was then emitted without the gensym suffix and was undefined. Register the original symbol, as `let` does.
borkdude
reviewed
Oct 15, 2026
Less string processing, as suggested in review.
Member
|
Thanks for your PR! If you want to share, by any chance, what you're using squint for, I'd be happy to hear it. |
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.
Please answer the following questions and leave the below in as part of your PR.
This PR corresponds to an issue with a clear problem statement.
This PR contains a test to prevent against future regressions
I have updated the CHANGELOG.md file with a description of the addressed issue.
Fixes #1050.
emit-special 'trymunged the catch binding first and registered it in:var->identunder the munged name. References in the catch body are looked up by the original
symbol, so a name that needs munging missed the entry and was emitted without the
gensym suffix. This PR registers the original symbol as the key and the munged
gensym as the value, the same way
letdoes.The new assertions in
try-catch-testcoverabort-error,ok?, anderr!. Theerr!casealso has an outer
letwith the same name. Without the fix, all three assertions fail: thefirst two with a
ReferenceError, and the third because the body silently reads the outerlocal. With the fix,
bb test:node,bb test:bbandbb test:cljall pass locally(Windows 11, Node 22).