Repository navigation
Do not remap a scope local's JS name again - #126
Open
NullVoxPopuli-ai-agent wants to merge 1 commit into
Open
NullVoxPopuli-ai-agent wants to merge 1 commit into
NullVoxPopuli-ai-agent wants to merge 1 commit into
Conversation
remapAndBindIdentifiers replaces an hbs name with its JS name, and Babel
then visits the new identifier. If that JS name is also an hbs name in
the same scope, the plugin remapped it a second time:
- `{ a: b, b: c }` made `{{a}}` resolve to `c` instead of `b`
- `{ a: b, b: a }` overflowed the stack
Skip the new identifier after the replacement.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
If one scope local renames to the hbs name of another scope local, the wire format gets the wrong value or the build crashes. This PR fixes that.
↳
{{a}}resolves toc. It must resolve tob.↳
RangeError: Maximum call stack size exceededCause
remapAndBindIdentifiersreplaces each hbs name in the compiler output with its JS name. Babel then visits the new identifier. If that JS name is also an hbs name in the same scope, the plugin remaps it again.4.0.1 has this bug.
Fix
path.skip()after the replacement, so Babel does not visit the new identifier.Tests
Both fail on
mainand pass with the fix. The full suite passes on the default ember-source, 6.4, 5.12 and 3.28 (the last two withNO_LEXICAL_THIS=true).🤖 Generated with Claude Code