Skip to content

Fix crash on malformed super destructuring - #63973

Open
Mateusz Burzyński (Andarist) wants to merge 1 commit into
microsoft:mainfrom
Andarist:fix/crash-malformed-super-destructuring
Open

Fix crash on malformed super destructuring#63973
Mateusz Burzyński (Andarist) wants to merge 1 commit into
microsoft:mainfrom
Andarist:fix/crash-malformed-super-destructuring

Conversation

@Andarist

Copy link
Copy Markdown
Contributor

fixes #63964

Copilot AI balanced review requested due to automatic review settings August 23, 2026 17:40
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Aug 23, 2026
@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Aug 23, 2026
}

func (tx *esDecoratorTransformer) visitArrayAssignmentElement(node *ast.Node) *ast.Node {
debug.Assert(ast.IsArrayBindingOrAssignmentElement(node))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

same reasoning as #63972 (comment)

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.

Pull request overview

Prevents a compiler panic when malformed super destructuring appears in a decorated class static block.

Changes:

  • Adjusts decorator assignment-element handling.
  • Adds a regression test and compiler baselines.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tsc/internal/transformers/estransforms/esdecorator.go Relaxes array assignment-element handling.
tsc/testdata/tests/cases/compiler/malformedSuperDestructuringInDecoratedClassStaticBlock.ts Adds the crash reproducer.
tsc/testdata/baselines/reference/compiler/malformedSuperDestructuringInDecoratedClassStaticBlock.errors.txt Records expected diagnostics.
tsc/testdata/baselines/reference/compiler/malformedSuperDestructuringInDecoratedClassStaticBlock.js Records expected emit.
tsc/testdata/baselines/reference/compiler/malformedSuperDestructuringInDecoratedClassStaticBlock.symbols Records expected symbols.
tsc/testdata/baselines/reference/compiler/malformedSuperDestructuringInDecoratedClassStaticBlock.types Records expected types.

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


func (tx *esDecoratorTransformer) visitArrayAssignmentElement(node *ast.Node) *ast.Node {
debug.Assert(ast.IsArrayBindingOrAssignmentElement(node))
if ast.IsSpreadElement(node) {
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.

Crash: malformed super destructuring in a decorated class static block panics

2 participants