MCPcopy Create free account
hub / github.com/nodejs/node / parseOldFileOfCurrentEmit

Function parseOldFileOfCurrentEmit

test/fixtures/snapshot/typescript.js:27540–27572  ·  view source on GitHub ↗
(bundleFileInfo)

Source from the content-addressed store, hash-verified

27538 return node;
27539 }
27540 function parseOldFileOfCurrentEmit(bundleFileInfo) {
27541 var texts;
27542 var syntheticReferences;
27543 for (var _i = 0, _a = bundleFileInfo.sections; _i < _a.length; _i++) {
27544 var section = _a[_i];
27545 switch (section.kind) {
27546 case "internal" /* BundleFileSectionKind.Internal */:
27547 case "text" /* BundleFileSectionKind.Text */:
27548 texts = ts.append(texts, ts.setTextRange(ts.factory.createUnparsedTextLike(section.data, section.kind === "internal" /* BundleFileSectionKind.Internal */), section));
27549 break;
27550 case "no-default-lib" /* BundleFileSectionKind.NoDefaultLib */:
27551 case "reference" /* BundleFileSectionKind.Reference */:
27552 case "type" /* BundleFileSectionKind.Type */:
27553 case "type-import" /* BundleFileSectionKind.TypeResolutionModeImport */:
27554 case "type-require" /* BundleFileSectionKind.TypeResolutionModeRequire */:
27555 case "lib" /* BundleFileSectionKind.Lib */:
27556 syntheticReferences = ts.append(syntheticReferences, ts.setTextRange(ts.factory.createUnparsedSyntheticReference(section), section));
27557 break;
27558 // Ignore
27559 case "prologue" /* BundleFileSectionKind.Prologue */:
27560 case "emitHelpers" /* BundleFileSectionKind.EmitHelpers */:
27561 case "prepend" /* BundleFileSectionKind.Prepend */:
27562 break;
27563 default:
27564 ts.Debug.assertNever(section);
27565 }
27566 }
27567 var node = ts.factory.createUnparsedSource(ts.emptyArray, syntheticReferences, texts !== null && texts !== void 0 ? texts : ts.emptyArray);
27568 ts.setEachParent(syntheticReferences, node);
27569 ts.setEachParent(texts, node);
27570 node.helpers = ts.map(bundleFileInfo.sources && bundleFileInfo.sources.helpers, function (name) { return ts.getAllUnscopedEmitHelpers().get(name); });
27571 return node;
27572 }
27573 function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapTextOrBuildInfoPath, javascriptPath, declarationPath, buildInfoPath, buildInfo, oldFileOfCurrentEmit) {
27574 var node = ts.parseNodeFactory.createInputFiles();
27575 if (!ts.isString(javascriptTextOrReadFileText)) {

Callers 1

createUnparsedSourceFileFunction · 0.85

Calls 3

mapMethod · 0.65
getMethod · 0.65
appendMethod · 0.45

Tested by

no test coverage detected