FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix crash on malformed object destructuring assignment in decorated class by Andarist · Pull Request #64472 · microsoft/TypeScript · GitHub

Repository navigation

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

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

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

Conversation

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
github-project-automation Bot moved this to Not started in PR Backlog Sep 26, 2026
typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Sep 26, 2026

Copy link
Copy Markdown
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 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

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 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yes, removing an assert without an explanation is dubious.

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

Labels

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

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL