From 900d6f7c9042a686cebc2c50343bfa50ca66b04f Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 17 Jan 2019 12:29:23 -0800 Subject: [PATCH] renames --- src/compiler/builder.ts | 12 ++++++------ src/compiler/tsbuild.ts | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index e8a2bae0513..44ae6a299d8 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -516,11 +516,11 @@ namespace ts { const result = createRedirectedBuilderProgram(state, configFileParsingDiagnostics); result.getState = () => state; - result.backupCurrentState = () => { + result.backupState = () => { Debug.assert(backupState === undefined); backupState = cloneBuilderProgramState(state); }; - result.useBackupState = () => { + result.restoreState = () => { state = Debug.assertDefined(backupState); backupState = undefined; }; @@ -715,8 +715,8 @@ namespace ts { export function createRedirectedBuilderProgram(state: { program: Program | undefined; compilerOptions: CompilerOptions; }, configFileParsingDiagnostics: ReadonlyArray): BuilderProgram { return { getState: notImplemented, - backupCurrentState: noop, - useBackupState: noop, + backupState: noop, + restoreState: noop, getProgram, getProgramOrUndefined: () => state.program, releaseProgram: () => state.program = undefined, @@ -766,9 +766,9 @@ namespace ts { /*@internal*/ getState(): BuilderProgramState; /*@internal*/ - backupCurrentState(): void; + backupState(): void; /*@internal*/ - useBackupState(): void; + restoreState(): void; /** * Returns current program */ diff --git a/src/compiler/tsbuild.ts b/src/compiler/tsbuild.ts index 61b3c610f5a..01c4801b106 100644 --- a/src/compiler/tsbuild.ts +++ b/src/compiler/tsbuild.ts @@ -1129,7 +1129,7 @@ namespace ts { } // Before emitting lets backup state, so we can revert it back if there are declaration errors to handle emit and declaration errors correctly - program.backupCurrentState(); + program.backupState(); let newestDeclarationFileContentChangedTime = minimumDate; let anyDtsChanged = false; let declDiagnostics: Diagnostic[] | undefined; @@ -1138,7 +1138,7 @@ namespace ts { emitFilesAndReportErrors(program, reportDeclarationDiagnostics, writeFileName, /*reportSummary*/ undefined, (name, text, writeByteOrderMark) => outputFiles.push({ name, text, writeByteOrderMark })); // Don't emit .d.ts if there are decl file errors if (declDiagnostics) { - program.useBackupState(); + program.restoreState(); return buildErrors(declDiagnostics, BuildResultFlags.DeclarationEmitErrors, "Declaration file"); }