fix(emitter): preserve parentheses around arrow function object literal body#47
Merged
Brooooooklyn merged 1 commit intomainfrom Mar 3, 2026
Merged
Conversation
…al body
When user code like `() => ({ key: val })` was parsed by OXC, the object
literal was wrapped in a ParenthesizedExpression, converting to
`Parenthesized(LiteralMap(...))` in the output AST. The emitter's arrow
function body check only matched direct `LiteralMap`, missing the wrapped
case and emitting `() => { key: val }` (a block with a label) instead.
Fix by unwrapping one level of `Parenthesized` before checking for
`LiteralMap` in the arrow function body emission.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
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.

When user code like
() => ({ key: val })was parsed by OXC, the objectliteral was wrapped in a ParenthesizedExpression, converting to
Parenthesized(LiteralMap(...))in the output AST. The emitter's arrowfunction body check only matched direct
LiteralMap, missing the wrappedcase and emitting
() => { key: val }(a block with a label) instead.Fix by unwrapping one level of
Parenthesizedbefore checking forLiteralMapin the arrow function body emission.Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Note
Cursor Bugbot is generating a summary for commit 06d9e25. Configure here.