mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 21:53:42 -06:00
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:
parent
606bc4bbac
commit
ce30fd05a9
@ -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(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user