Fix transformed constructor code when there is code between prologue statements and super call (#48765)

This commit is contained in:
Patrick Szmucer
2022-04-19 17:19:25 +01:00
committed by GitHub
parent 6894f913ec
commit 2e619fdc80
5 changed files with 140 additions and 1 deletions

View File

@@ -1146,7 +1146,7 @@ namespace ts {
[
...existingPrologue,
...prologue,
...(superStatementIndex <= existingPrologue.length ? emptyArray : visitNodes(constructor.body.statements, visitor, isStatement, existingPrologue.length, superStatementIndex)),
...(superStatementIndex <= existingPrologue.length ? emptyArray : visitNodes(constructor.body.statements, visitor, isStatement, existingPrologue.length, superStatementIndex - existingPrologue.length)),
...statements
]
),