Fix transform crash with destructured parameter property (#63043)

This commit is contained in:
Jake Bailey
2026-01-23 15:48:05 -08:00
committed by GitHub
parent d9d9eeafa0
commit b19a9da2a3
6 changed files with 212 additions and 0 deletions

View File

@@ -1055,6 +1055,10 @@ export function transformTypeScript(context: TransformationContext): Transformer
if (parametersWithPropertyAssignments) {
for (const parameter of parametersWithPropertyAssignments) {
// Ignore parameter properties with destructured names; we will have errored on them earlier.
if (!isIdentifier(parameter.name)) {
continue;
}
const parameterProperty = factory.createPropertyDeclaration(
/*modifiers*/ undefined,
parameter.name,