Add else clause to handle empty blocks in using for-of transform

Co-authored-by: weswigham <2932786+weswigham@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-08-01 00:41:33 +00:00
parent 606bc4bbac
commit ce30fd05a9

View File

@ -331,6 +331,9 @@ export function transformESNext(context: TransformationContext): (x: SourceFile
factory.createBlock([node.statement], /*multiLine*/ true);
statements.push(wrappedStatement);
}
else {
statements.push(...(isBlock(node.statement) ? node.statement.statements : [node.statement]))
}
return visitNode(
factory.updateForOfStatement(