Repository navigation
Fix crash in decorator metadata emit for decorated object literal members - #64633
Merged
Jake Bailey (jakebailey) merged 1 commit intoOct 6, 2026
Conversation
Contributor
|
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
Copilot started reviewing on behalf of
Mateusz Burzyński (Andarist)
October 5, 2026 08:22
View session
| tx.currentLexicalScope = node | ||
| } | ||
|
|
||
| func (tx *MetadataTransformer) visitObjectLiteralExpression(node *ast.Node) *ast.Node { |
Contributor
Author
There was a problem hiding this comment.
- test code is intentionally invalid but parsing-wise permitted, it only has grammar errors
- the transforms/emitting is traditionally OK with such inputs, doing its best to emit "something"
The fix here matches Strada conceptually. Strada passed down parent (also in the case of object literal expressions). This patch just reuses the neighboring pattern (the same thing as in visitClassExpression) for doing the equivalent here in Corsa
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new compiler test is missing required reference baselines.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Fixes a decorator metadata emit crash involving decorated object literal members.
Changes:
- Tracks object literals as metadata-transform parents.
- Adds a compiler regression test.
| File | Description |
|---|---|
metadata.go |
Prevents object members from being treated as class elements. |
decoratorMetadataObjectLiteralMethodNoCrash.ts |
Covers top-level and class-nested object literals. |
Mateusz Burzyński (Andarist)
force-pushed
the
fix-decorator-metadata-object-literal-crash
branch
from
October 5, 2026 10:48
488edf3 to
51fed26
Compare
Jake Bailey (jakebailey)
approved these changes
Oct 6, 2026
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.

fixes crash reported here #64613 (comment)