fix(49854): fix start index to emit statements after super (#49858)

This commit is contained in:
Oleksandr T
2022-07-21 02:02:30 +03:00
committed by GitHub
parent 5702941c2f
commit 5d2e62a810
5 changed files with 322 additions and 19 deletions

View File

@@ -1113,7 +1113,8 @@ namespace ts {
}
// Add remaining statements from the body, skipping the super() call if it was found and any (already added) prologue statements
addRange(statements, visitNodes(body.statements, visitor, isStatement, superStatementIndex + 1 + prologueStatementCount));
const start = superStatementIndex >= 0 ? superStatementIndex + 1 : prologueStatementCount;
addRange(statements, visitNodes(body.statements, visitor, isStatement, start));
// End the lexical environment.
statements = factory.mergeLexicalEnvironment(statements, endLexicalEnvironment());