fix(ivy): don't update parent pointers in the ivy switch transform (#27170)

Now that the Ivy switch transform uses ts.getMutableClone() to copy
statements, there's no need to set .parent pointers on the resulting
updated nodes. Doing this was causing assertion failures deep in
TypeScript in some cases.

PR Close #27170
This commit is contained in:
Alex Rickabaugh 2018-11-19 11:14:45 +01:00 committed by Misko Hevery
parent e56c8bf8d1
commit 4390e10dfd
1 changed files with 0 additions and 9 deletions

View File

@ -120,9 +120,6 @@ function flipIvySwitchesInVariableStatement(
/* name */ decl.name,
/* type */ decl.type,
/* initializer */ newIdentifier);
// Keeping parent pointers up to date is important for emit.
newIdentifier.parent = newDeclarations[i];
}
const newDeclList = ts.updateVariableDeclarationList(
@ -134,12 +131,6 @@ function flipIvySwitchesInVariableStatement(
/* modifiers */ stmt.modifiers,
/* declarationList */ newDeclList);
// Keeping parent pointers up to date is important for emit.
for (const decl of newDeclarations) {
decl.parent = newDeclList;
}
newDeclList.parent = newStmt;
newStmt.parent = stmt.parent;
return newStmt;
}