MCPcopy Index your code
hub / github.com/nodejs/node / cloneBuilderProgramState

Function cloneBuilderProgramState

test/fixtures/snapshot/typescript.js:120204–120225  ·  view source on GitHub ↗

* Creates a clone of the state

(state)

Source from the content-addressed store, hash-verified

120202 * Creates a clone of the state
120203 */
120204 function cloneBuilderProgramState(state) {
120205 var _a;
120206 var newState = ts.BuilderState.clone(state);
120207 newState.semanticDiagnosticsPerFile = state.semanticDiagnosticsPerFile && new ts.Map(state.semanticDiagnosticsPerFile);
120208 newState.changedFilesSet = new ts.Set(state.changedFilesSet);
120209 newState.affectedFiles = state.affectedFiles;
120210 newState.affectedFilesIndex = state.affectedFilesIndex;
120211 newState.currentChangedFilePath = state.currentChangedFilePath;
120212 newState.currentAffectedFilesSignatures = state.currentAffectedFilesSignatures && new ts.Map(state.currentAffectedFilesSignatures);
120213 newState.currentAffectedFilesExportedModulesMap = (_a = state.currentAffectedFilesExportedModulesMap) === null || _a === void 0 ? void 0 : _a.clone();
120214 newState.seenAffectedFiles = state.seenAffectedFiles && new ts.Set(state.seenAffectedFiles);
120215 newState.cleanedDiagnosticsOfLibFiles = state.cleanedDiagnosticsOfLibFiles;
120216 newState.semanticDiagnosticsFromOldState = state.semanticDiagnosticsFromOldState && new ts.Set(state.semanticDiagnosticsFromOldState);
120217 newState.program = state.program;
120218 newState.compilerOptions = state.compilerOptions;
120219 newState.affectedFilesPendingEmit = state.affectedFilesPendingEmit && state.affectedFilesPendingEmit.slice();
120220 newState.affectedFilesPendingEmitKind = state.affectedFilesPendingEmitKind && new ts.Map(state.affectedFilesPendingEmitKind);
120221 newState.affectedFilesPendingEmitIndex = state.affectedFilesPendingEmitIndex;
120222 newState.seenEmittedFiles = state.seenEmittedFiles && new ts.Map(state.seenEmittedFiles);
120223 newState.programEmitComplete = state.programEmitComplete;
120224 return newState;
120225 }
120226 /**
120227 * Verifies that source file is ok to be used in calls that arent handled by next
120228 */

Callers 1

createBuilderProgramFunction · 0.85

Calls 2

sliceMethod · 0.65
cloneMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…