fix(ivy): clone ts.SourceFile in ivy_switch when triggered (#27032)
Make a copy of the ts.SourceFile before modifying it in the ivy_switch transform. It's suspected that the Bazel tsc_wrapped host's SourceFile cache has issues when the ts.SourceFiles are mutated. PR Close #27032
This commit is contained in:
parent
c31e78f670
commit
d97994b27f
|
@ -42,6 +42,7 @@ function flipIvySwitchInFile(sf: ts.SourceFile): ts.SourceFile {
|
||||||
|
|
||||||
// Only update the statements in the SourceFile if any have changed.
|
// Only update the statements in the SourceFile if any have changed.
|
||||||
if (newStatements !== undefined) {
|
if (newStatements !== undefined) {
|
||||||
|
sf = ts.getMutableClone(sf);
|
||||||
sf.statements = ts.createNodeArray(newStatements);
|
sf.statements = ts.createNodeArray(newStatements);
|
||||||
}
|
}
|
||||||
return sf;
|
return sf;
|
||||||
|
|
Loading…
Reference in New Issue