Ensure the updates with crashes reverts the change to scriptInfo (#58846)
This commit is contained in:
Родитель
dca9182ca8
Коммит
46fe067a06
|
@ -2245,8 +2245,12 @@ export abstract class Project implements LanguageServiceHost, ModuleResolutionHo
|
|||
|
||||
this.getScriptInfo(rootFile)?.editContent(0, originalText.length, updatedText);
|
||||
this.updateGraph();
|
||||
cb(this.program!, originalProgram, (this.program?.getSourceFile(rootFile))!);
|
||||
this.getScriptInfo(rootFile)?.editContent(0, this.program!.getSourceFile(rootFile)!.getText().length, originalText);
|
||||
try {
|
||||
cb(this.program!, originalProgram, (this.program?.getSourceFile(rootFile))!);
|
||||
}
|
||||
finally {
|
||||
this.getScriptInfo(rootFile)?.editContent(0, this.program!.getSourceFile(rootFile)!.getText().length, originalText);
|
||||
}
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
|
|
Загрузка…
Ссылка в новой задаче