Skip to content

Fix crash on malformed object destructuring assignment in decorated class - #64472

Open
Mateusz Burzyński (Andarist) wants to merge 2 commits into
microsoft:mainfrom
Andarist:fix/crash-malformed-object-destructuring-esdecorators
Open

Mateusz Burzyński (Andarist) wants to merge 2 commits into
microsoft:mainfrom
Andarist:fix/crash-malformed-object-destructuring-esdecorators

Conversation

@Andarist

Copy link
Copy Markdown
Contributor

fixes a crash reported here: #64458 (comment)

This PR is similar to #63972 and #63973

Copilot AI balanced review requested due to automatic review settings September 26, 2026 19:12
@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Sep 26, 2026
@typescript-automation

Copy link
Copy Markdown

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The crash should be fixed without removing an existing debug assertion and masking the visitor-contract violation.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds regression coverage for malformed object destructuring inside a decorated class.

Changes:

  • Adds a malformed destructuring compiler test.
  • Adds diagnostic, emit, symbol, and type baselines.
  • Removes an assertion from the ES decorator transformer.
File Description
tsc/​internal/​transformers/​estransforms/​esdecorator.go Avoids the reported crash by removing an assertion.
tsc/​testdata/​tests/​cases/​compiler/​malformedObjectDestructuringAssignmentESDecorators.ts Adds the regression case.
tsc/​testdata/​baselines/​reference/​compiler/​malformedObjectDestructuringAssignmentESDecorators.errors.txt Records expected diagnostics.
tsc/​testdata/​baselines/​reference/​compiler/​malformedObjectDestructuringAssignmentESDecorators.js Records expected emit.
tsc/​testdata/​baselines/​reference/​compiler/​malformedObjectDestructuringAssignmentESDecorators.symbols Records expected symbols.
tsc/​testdata/​baselines/​reference/​compiler/​malformedObjectDestructuringAssignmentESDecorators.types Records expected types.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@@ -2261,7 +2261,6 @@ func (tx *esDecoratorTransformer) visitAssignmentRestProperty(node *ast.Node) *a
}

func (tx *esDecoratorTransformer) visitObjectAssignmentElement(node *ast.Node) *ast.Node {

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

2 participants