@typescript-deploys/pr-build 4.9.0-pr-50293-2 → 4.9.0-pr-50306-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.9";
72
- ts.version = ts.versionMajorMinor + ".0-insiders.20220813";
72
+ ts.version = ts.versionMajorMinor + ".0-insiders.20220815";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -4456,7 +4456,6 @@ var ts;
4456
4456
  ts.sys = (function () {
4457
4457
  var byteOrderMarkIndicator = "\uFEFF";
4458
4458
  function getNodeSystem() {
4459
- var _a;
4460
4459
  var nativePattern = /^native |^\([^)]+\)$|^(internal[\\/]|[a-zA-Z0-9_\s]+(\.js)?$)/;
4461
4460
  var _fs = require("fs");
4462
4461
  var _path = require("path");
@@ -4465,7 +4464,7 @@ var ts;
4465
4464
  try {
4466
4465
  _crypto = require("crypto");
4467
4466
  }
4468
- catch (_b) {
4467
+ catch (_a) {
4469
4468
  _crypto = undefined;
4470
4469
  }
4471
4470
  var activeSession;
@@ -4476,10 +4475,10 @@ var ts;
4476
4475
  var isLinuxOrMacOs = process.platform === "linux" || process.platform === "darwin";
4477
4476
  var platform = _os.platform();
4478
4477
  var useCaseSensitiveFileNames = isFileSystemCaseSensitive();
4479
- var realpathSync = (_a = _fs.realpathSync.native) !== null && _a !== void 0 ? _a : _fs.realpathSync;
4478
+ var fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
4480
4479
  var fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
4481
4480
  var getCurrentDirectory = ts.memoize(function () { return process.cwd(); });
4482
- var _c = createSystemWatchFunctions({
4481
+ var _b = createSystemWatchFunctions({
4483
4482
  pollingWatchFile: createSingleFileWatcherPerName(fsWatchFileWorker, useCaseSensitiveFileNames),
4484
4483
  getModifiedTime: getModifiedTime,
4485
4484
  setTimeout: setTimeout,
@@ -4497,7 +4496,7 @@ var ts;
4497
4496
  defaultWatchFileKind: function () { var _a, _b; return (_b = (_a = sys).defaultWatchFileKind) === null || _b === void 0 ? void 0 : _b.call(_a); },
4498
4497
  inodeWatching: isLinuxOrMacOs,
4499
4498
  sysLog: sysLog,
4500
- }), watchFile = _c.watchFile, watchDirectory = _c.watchDirectory;
4499
+ }), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory;
4501
4500
  var nodeSystem = {
4502
4501
  args: process.argv.slice(2),
4503
4502
  newLine: _os.EOL,
@@ -4847,9 +4846,12 @@ var ts;
4847
4846
  function getDirectories(path) {
4848
4847
  return getAccessibleFileSystemEntries(path).directories.slice();
4849
4848
  }
4849
+ function fsRealPathHandlingLongPath(path) {
4850
+ return path.length < 260 ? _fs.realpathSync.native(path) : _fs.realpathSync(path);
4851
+ }
4850
4852
  function realpath(path) {
4851
4853
  try {
4852
- return realpathSync(path);
4854
+ return fsRealpath(path);
4853
4855
  }
4854
4856
  catch (_a) {
4855
4857
  return path;
@@ -22358,12 +22360,10 @@ var ts;
22358
22360
  node.helpers = ts.map(bundleFileInfo.sources && bundleFileInfo.sources.helpers, function (name) { return ts.getAllUnscopedEmitHelpers().get(name); });
22359
22361
  return node;
22360
22362
  }
22361
- function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapTextOrBuildInfoPath, javascriptPathOrHost, declarationPathOrOptions, buildInfoPath, buildInfo, oldFileOfCurrentEmit) {
22363
+ function createInputFiles(javascriptTextOrReadFileText, declarationTextOrJavascriptPath, javascriptMapPath, javascriptMapTextOrDeclarationPath, declarationMapPath, declarationMapTextOrBuildInfoPath, javascriptPath, declarationPath, buildInfoPath, buildInfo, oldFileOfCurrentEmit) {
22362
22364
  var node = ts.parseNodeFactory.createInputFiles();
22363
22365
  if (!ts.isString(javascriptTextOrReadFileText)) {
22364
22366
  var cache_1 = new ts.Map();
22365
- var host_1 = javascriptPathOrHost;
22366
- var options_1 = declarationPathOrOptions;
22367
22367
  var textGetter_1 = function (path) {
22368
22368
  if (path === undefined)
22369
22369
  return undefined;
@@ -22379,18 +22379,11 @@ var ts;
22379
22379
  return result !== undefined ? result : "/* Input file " + path + " was missing */\r\n";
22380
22380
  };
22381
22381
  var buildInfo_1;
22382
- var getAndCacheBuildInfo = function () {
22383
- var _a, _b, _c;
22384
- if (buildInfo_1 === undefined && declarationMapTextOrBuildInfoPath) {
22385
- if (host_1 === null || host_1 === void 0 ? void 0 : host_1.getBuildInfo) {
22386
- buildInfo_1 = (_a = host_1.getBuildInfo(declarationMapTextOrBuildInfoPath, options_1)) !== null && _a !== void 0 ? _a : false;
22387
- }
22388
- else {
22389
- var result = textGetter_1(declarationMapTextOrBuildInfoPath);
22390
- if (result)
22391
- (_b = host_1 === null || host_1 === void 0 ? void 0 : host_1.buildInfoCallbacks) === null || _b === void 0 ? void 0 : _b.onRead(result.length, options_1);
22392
- buildInfo_1 = result !== undefined ? (_c = ts.getBuildInfo(declarationMapTextOrBuildInfoPath, result)) !== null && _c !== void 0 ? _c : false : false;
22393
- }
22382
+ var getAndCacheBuildInfo_1 = function (getText) {
22383
+ var _a;
22384
+ if (buildInfo_1 === undefined) {
22385
+ var result = getText();
22386
+ buildInfo_1 = result !== undefined ? (_a = ts.getBuildInfo(node.buildInfoPath, result)) !== null && _a !== void 0 ? _a : false : false;
22394
22387
  }
22395
22388
  return buildInfo_1 || undefined;
22396
22389
  };
@@ -22404,7 +22397,7 @@ var ts;
22404
22397
  javascriptMapText: { get: function () { return textGetter_1(javascriptMapPath); } },
22405
22398
  declarationText: { get: function () { return definedTextGetter_1(ts.Debug.checkDefined(javascriptMapTextOrDeclarationPath)); } },
22406
22399
  declarationMapText: { get: function () { return textGetter_1(declarationMapPath); } },
22407
- buildInfo: { get: getAndCacheBuildInfo },
22400
+ buildInfo: { get: function () { return getAndCacheBuildInfo_1(function () { return textGetter_1(declarationMapTextOrBuildInfoPath); }); } }
22408
22401
  });
22409
22402
  }
22410
22403
  else {
@@ -22414,8 +22407,8 @@ var ts;
22414
22407
  node.declarationText = declarationTextOrJavascriptPath;
22415
22408
  node.declarationMapPath = declarationMapPath;
22416
22409
  node.declarationMapText = declarationMapTextOrBuildInfoPath;
22417
- node.javascriptPath = javascriptPathOrHost;
22418
- node.declarationPath = declarationPathOrOptions;
22410
+ node.javascriptPath = javascriptPath;
22411
+ node.declarationPath = declarationPath;
22419
22412
  node.buildInfoPath = buildInfoPath;
22420
22413
  node.buildInfo = buildInfo;
22421
22414
  node.oldFileOfCurrentEmit = oldFileOfCurrentEmit;
@@ -34128,8 +34121,8 @@ var ts;
34128
34121
  entries.push({ value: "" });
34129
34122
  }
34130
34123
  entries.push({ value: "/* " + category + " */" });
34131
- for (var _i = 0, options_2 = options; _i < options_2.length; _i++) {
34132
- var option = options_2[_i];
34124
+ for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
34125
+ var option = options_1[_i];
34133
34126
  var optionName = void 0;
34134
34127
  if (compilerOptionsMap.has(option.name)) {
34135
34128
  optionName = "\"" + option.name + "\": " + JSON.stringify(compilerOptionsMap.get(option.name)) + ((seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ",");
@@ -72992,12 +72985,12 @@ var ts;
72992
72985
  var parent = node.parent;
72993
72986
  var paramTag = node.parent.parent;
72994
72987
  if (ts.isJSDocTypeExpression(node.parent) && ts.isJSDocParameterTag(paramTag)) {
72995
- var host_2 = ts.getHostSignatureFromJSDoc(paramTag);
72988
+ var host_1 = ts.getHostSignatureFromJSDoc(paramTag);
72996
72989
  var isCallbackTag = ts.isJSDocCallbackTag(paramTag.parent.parent);
72997
- if (host_2 || isCallbackTag) {
72990
+ if (host_1 || isCallbackTag) {
72998
72991
  var lastParamDeclaration = isCallbackTag
72999
72992
  ? ts.lastOrUndefined(paramTag.parent.parent.typeExpression.parameters)
73000
- : ts.lastOrUndefined(host_2.parameters);
72993
+ : ts.lastOrUndefined(host_1.parameters);
73001
72994
  var symbol = ts.getParameterSymbolFromJSDoc(paramTag);
73002
72995
  if (!lastParamDeclaration ||
73003
72996
  symbol && lastParamDeclaration.symbol === symbol && ts.isRestParameter(lastParamDeclaration)) {
@@ -75513,9 +75506,9 @@ var ts;
75513
75506
  }
75514
75507
  var parent = ts.walkUpParenthesizedTypes(node.parent);
75515
75508
  if (ts.isInJSFile(parent) && ts.isJSDocTypeExpression(parent)) {
75516
- var host_3 = ts.getJSDocHost(parent);
75517
- if (host_3) {
75518
- parent = ts.getSingleVariableOfVariableStatement(host_3) || host_3;
75509
+ var host_2 = ts.getJSDocHost(parent);
75510
+ if (host_2) {
75511
+ parent = ts.getSingleVariableOfVariableStatement(host_2) || host_2;
75519
75512
  }
75520
75513
  }
75521
75514
  switch (parent.kind) {
@@ -91884,7 +91877,6 @@ var ts;
91884
91877
  }
91885
91878
  }
91886
91879
  function emitBuildInfo(bundle, buildInfoPath) {
91887
- var _a;
91888
91880
  if (!buildInfoPath || targetSourceFile || emitSkipped)
91889
91881
  return;
91890
91882
  var program = host.getProgramBuildInfo();
@@ -91894,9 +91886,7 @@ var ts;
91894
91886
  }
91895
91887
  var version = ts.version;
91896
91888
  var buildInfo = { bundle: bundle, program: program, version: version };
91897
- var buildInfoText = getBuildInfoText(buildInfo);
91898
- (_a = host.buildInfoCallbacks) === null || _a === void 0 ? void 0 : _a.onWrite(buildInfoText.length);
91899
- ts.writeFile(host, emitterDiagnostics, buildInfoPath, buildInfoText, false, undefined, { buildInfo: buildInfo });
91889
+ ts.writeFile(host, emitterDiagnostics, buildInfoPath, getBuildInfoText(buildInfo), false, undefined, { buildInfo: buildInfo });
91900
91890
  }
91901
91891
  function emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo) {
91902
91892
  if (!sourceFileOrBundle || emitOnlyDtsFiles || !jsFilePath) {
@@ -92169,19 +92159,18 @@ var ts;
92169
92159
  });
92170
92160
  }
92171
92161
  function emitUsingBuildInfo(config, host, getCommandLine, customTransformers) {
92172
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("emit", "emitUsingBuildInfo", {}, true);
92173
- ts.performance.mark("beforeEmit");
92174
- var result = emitUsingBuildInfoWorker(config, host, getCommandLine, customTransformers);
92175
- ts.performance.mark("afterEmit");
92176
- ts.performance.measure("Emit", "beforeEmit", "afterEmit");
92177
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
92178
- return result;
92179
- }
92180
- ts.emitUsingBuildInfo = emitUsingBuildInfo;
92181
- function emitUsingBuildInfoWorker(config, host, getCommandLine, customTransformers) {
92182
92162
  var createHash = ts.maybeBind(host, host.createHash);
92183
92163
  var _a = getOutputPathsForBundle(config.options, false), buildInfoPath = _a.buildInfoPath, jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath, declarationMapPath = _a.declarationMapPath;
92184
- var buildInfo = host.getBuildInfo(buildInfoPath, config.options);
92164
+ var buildInfo;
92165
+ if (host.getBuildInfo) {
92166
+ buildInfo = host.getBuildInfo(buildInfoPath, config.options.configFilePath);
92167
+ }
92168
+ else {
92169
+ var buildInfoText = host.readFile(buildInfoPath);
92170
+ if (!buildInfoText)
92171
+ return buildInfoPath;
92172
+ buildInfo = getBuildInfo(buildInfoPath, buildInfoText);
92173
+ }
92185
92174
  if (!buildInfo)
92186
92175
  return buildInfoPath;
92187
92176
  if (!buildInfo.bundle || !buildInfo.bundle.js || (declarationFilePath && !buildInfo.bundle.dts))
@@ -92209,7 +92198,7 @@ var ts;
92209
92198
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
92210
92199
  var ownPrependInput = ts.createInputFiles(jsFileText, declarationText, sourceMapFilePath, sourceMapText, declarationMapPath, declarationMapText, jsFilePath, declarationFilePath, buildInfoPath, buildInfo, true);
92211
92200
  var outputFiles = [];
92212
- var prependNodes = ts.createPrependNodes(config.projectReferences, getCommandLine, function (f) { return host.readFile(f); }, host);
92201
+ var prependNodes = ts.createPrependNodes(config.projectReferences, getCommandLine, function (f) { return host.readFile(f); });
92213
92202
  var sourceFilesForJsEmit = createSourceFilesFromBundleBuildInfo(buildInfo.bundle, buildInfoDirectory, host);
92214
92203
  var changedDtsText;
92215
92204
  var changedDtsData;
@@ -92250,8 +92239,7 @@ var ts;
92250
92239
  newBuildInfo.bundle.dts.sources = dts.sources;
92251
92240
  }
92252
92241
  newBuildInfo.bundle.sourceFiles = sourceFiles;
92253
- var newBuildInfoText = getBuildInfoText(newBuildInfo);
92254
- outputFiles.push({ name: name, text: newBuildInfoText, writeByteOrderMark: writeByteOrderMark, buildInfo: newBuildInfo });
92242
+ outputFiles.push({ name: name, text: getBuildInfoText(newBuildInfo), writeByteOrderMark: writeByteOrderMark, buildInfo: newBuildInfo });
92255
92243
  return;
92256
92244
  case declarationFilePath:
92257
92245
  if (declarationText === text)
@@ -92277,11 +92265,11 @@ var ts;
92277
92265
  redirectTargetsMap: ts.createMultiMap(),
92278
92266
  getFileIncludeReasons: ts.notImplemented,
92279
92267
  createHash: createHash,
92280
- buildInfoCallbacks: host.buildInfoCallbacks,
92281
92268
  };
92282
92269
  emitFiles(ts.notImplementedResolver, emitHost, undefined, ts.getTransformers(config.options, customTransformers));
92283
92270
  return outputFiles;
92284
92271
  }
92272
+ ts.emitUsingBuildInfo = emitUsingBuildInfo;
92285
92273
  function createPrinter(printerOptions, handlers) {
92286
92274
  if (printerOptions === void 0) { printerOptions = {}; }
92287
92275
  if (handlers === void 0) { handlers = {}; }
@@ -96918,12 +96906,15 @@ var ts;
96918
96906
  return createCompilerHostWorker(options, setParentNodes);
96919
96907
  }
96920
96908
  ts.createCompilerHost = createCompilerHost;
96921
- function createGetSourceFile(readFile, getCompilerOptions, setParentNodes) {
96922
- return function (fileName, languageVersionOrOptions, onError) {
96909
+ function createCompilerHostWorker(options, setParentNodes, system) {
96910
+ if (system === void 0) { system = ts.sys; }
96911
+ var existingDirectories = new ts.Map();
96912
+ var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames);
96913
+ function getSourceFile(fileName, languageVersionOrOptions, onError) {
96923
96914
  var text;
96924
96915
  try {
96925
96916
  ts.performance.mark("beforeIORead");
96926
- text = readFile(fileName, getCompilerOptions().charset);
96917
+ text = compilerHost.readFile(fileName);
96927
96918
  ts.performance.mark("afterIORead");
96928
96919
  ts.performance.measure("I/O Read", "beforeIORead", "afterIORead");
96929
96920
  }
@@ -96934,14 +96925,21 @@ var ts;
96934
96925
  text = "";
96935
96926
  }
96936
96927
  return text !== undefined ? ts.createSourceFile(fileName, text, languageVersionOrOptions, setParentNodes) : undefined;
96937
- };
96938
- }
96939
- ts.createGetSourceFile = createGetSourceFile;
96940
- function createWriteFile(writeFile, createDirectory, directoryExists) {
96941
- return function (fileName, data, writeByteOrderMark, onError) {
96928
+ }
96929
+ function directoryExists(directoryPath) {
96930
+ if (existingDirectories.has(directoryPath)) {
96931
+ return true;
96932
+ }
96933
+ if ((compilerHost.directoryExists || system.directoryExists)(directoryPath)) {
96934
+ existingDirectories.set(directoryPath, true);
96935
+ return true;
96936
+ }
96937
+ return false;
96938
+ }
96939
+ function writeFile(fileName, data, writeByteOrderMark, onError) {
96942
96940
  try {
96943
96941
  ts.performance.mark("beforeIOWrite");
96944
- ts.writeFileEnsuringDirectories(fileName, data, writeByteOrderMark, writeFile, createDirectory, directoryExists);
96942
+ ts.writeFileEnsuringDirectories(fileName, data, writeByteOrderMark, function (path, data, writeByteOrderMark) { return system.writeFile(path, data, writeByteOrderMark); }, function (path) { return (compilerHost.createDirectory || system.createDirectory)(path); }, function (path) { return directoryExists(path); });
96945
96943
  ts.performance.mark("afterIOWrite");
96946
96944
  ts.performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite");
96947
96945
  }
@@ -96950,22 +96948,6 @@ var ts;
96950
96948
  onError(e.message);
96951
96949
  }
96952
96950
  }
96953
- };
96954
- }
96955
- ts.createWriteFile = createWriteFile;
96956
- function createCompilerHostWorker(options, setParentNodes, system) {
96957
- if (system === void 0) { system = ts.sys; }
96958
- var existingDirectories = new ts.Map();
96959
- var getCanonicalFileName = ts.createGetCanonicalFileName(system.useCaseSensitiveFileNames);
96960
- function directoryExists(directoryPath) {
96961
- if (existingDirectories.has(directoryPath)) {
96962
- return true;
96963
- }
96964
- if ((compilerHost.directoryExists || system.directoryExists)(directoryPath)) {
96965
- existingDirectories.set(directoryPath, true);
96966
- return true;
96967
- }
96968
- return false;
96969
96951
  }
96970
96952
  function getDefaultLibLocation() {
96971
96953
  return ts.getDirectoryPath(ts.normalizePath(system.getExecutingFilePath()));
@@ -96973,10 +96955,10 @@ var ts;
96973
96955
  var newLine = ts.getNewLineCharacter(options, function () { return system.newLine; });
96974
96956
  var realpath = system.realpath && (function (path) { return system.realpath(path); });
96975
96957
  var compilerHost = {
96976
- getSourceFile: createGetSourceFile(function (fileName) { return compilerHost.readFile(fileName); }, function () { return options; }, setParentNodes),
96958
+ getSourceFile: getSourceFile,
96977
96959
  getDefaultLibLocation: getDefaultLibLocation,
96978
96960
  getDefaultLibFileName: function (options) { return ts.combinePaths(getDefaultLibLocation(), ts.getDefaultLibFileName(options)); },
96979
- writeFile: createWriteFile(function (path, data, writeByteOrderMark) { return system.writeFile(path, data, writeByteOrderMark); }, function (path) { return (compilerHost.createDirectory || system.createDirectory)(path); }, function (path) { return directoryExists(path); }),
96961
+ writeFile: writeFile,
96980
96962
  getCurrentDirectory: ts.memoize(function () { return system.getCurrentDirectory(); }),
96981
96963
  useCaseSensitiveFileNames: function () { return system.useCaseSensitiveFileNames; },
96982
96964
  getCanonicalFileName: getCanonicalFileName,
@@ -98360,7 +98342,6 @@ var ts;
98360
98342
  redirectTargetsMap: redirectTargetsMap,
98361
98343
  getFileIncludeReasons: program.getFileIncludeReasons,
98362
98344
  createHash: ts.maybeBind(host, host.createHash),
98363
- buildInfoCallbacks: host.buildInfoCallbacks,
98364
98345
  };
98365
98346
  }
98366
98347
  function writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data) {
@@ -98387,7 +98368,7 @@ var ts;
98387
98368
  var path = toPath(fileName);
98388
98369
  var sourceFile = getSourceFileByPath(path);
98389
98370
  return sourceFile ? sourceFile.text : filesByName.has(path) ? undefined : host.readFile(path);
98390
- }, host);
98371
+ });
98391
98372
  }
98392
98373
  function isSourceFileFromExternalLibrary(file) {
98393
98374
  return !!sourceFilesFoundSearchingNodeModules.get(file.path);
@@ -100179,7 +100160,7 @@ var ts;
100179
100160
  };
100180
100161
  }
100181
100162
  ts.parseConfigHostFromCompilerHostLike = parseConfigHostFromCompilerHostLike;
100182
- function createPrependNodes(projectReferences, getCommandLine, readFile, host) {
100163
+ function createPrependNodes(projectReferences, getCommandLine, readFile) {
100183
100164
  if (!projectReferences)
100184
100165
  return ts.emptyArray;
100185
100166
  var nodes;
@@ -100191,7 +100172,7 @@ var ts;
100191
100172
  if (!out)
100192
100173
  continue;
100193
100174
  var _a = ts.getOutputPathsForBundle(resolvedRefOpts.options, true), jsFilePath = _a.jsFilePath, sourceMapFilePath = _a.sourceMapFilePath, declarationFilePath = _a.declarationFilePath, declarationMapPath = _a.declarationMapPath, buildInfoPath = _a.buildInfoPath;
100194
- var node = ts.createInputFiles(readFile, jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, buildInfoPath, host, resolvedRefOpts.options);
100175
+ var node = ts.createInputFiles(readFile, jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, buildInfoPath);
100195
100176
  (nodes || (nodes = [])).push(node);
100196
100177
  }
100197
100178
  }
@@ -100861,10 +100842,10 @@ var ts;
100861
100842
  if (!state.cleanedDiagnosticsOfLibFiles) {
100862
100843
  state.cleanedDiagnosticsOfLibFiles = true;
100863
100844
  var program_1 = ts.Debug.checkDefined(state.program);
100864
- var options_3 = program_1.getCompilerOptions();
100845
+ var options_2 = program_1.getCompilerOptions();
100865
100846
  ts.forEach(program_1.getSourceFiles(), function (f) {
100866
100847
  return program_1.isSourceFileDefaultLibrary(f) &&
100867
- !ts.skipTypeChecking(f, options_3, program_1) &&
100848
+ !ts.skipTypeChecking(f, options_2, program_1) &&
100868
100849
  removeSemanticDiagnosticsOf(state, f.resolvedPath);
100869
100850
  });
100870
100851
  }
@@ -103609,10 +103590,25 @@ var ts;
103609
103590
  var useCaseSensitiveFileNames = host.useCaseSensitiveFileNames();
103610
103591
  var hostGetNewLine = ts.memoize(function () { return host.getNewLine(); });
103611
103592
  return {
103612
- getSourceFile: ts.createGetSourceFile(function (fileName, encoding) { return host.readFile(fileName, encoding); }, getCompilerOptions, undefined),
103593
+ getSourceFile: function (fileName, languageVersionOrOptions, onError) {
103594
+ var text;
103595
+ try {
103596
+ ts.performance.mark("beforeIORead");
103597
+ text = host.readFile(fileName, getCompilerOptions().charset);
103598
+ ts.performance.mark("afterIORead");
103599
+ ts.performance.measure("I/O Read", "beforeIORead", "afterIORead");
103600
+ }
103601
+ catch (e) {
103602
+ if (onError) {
103603
+ onError(e.message);
103604
+ }
103605
+ text = "";
103606
+ }
103607
+ return text !== undefined ? ts.createSourceFile(fileName, text, languageVersionOrOptions) : undefined;
103608
+ },
103613
103609
  getDefaultLibLocation: ts.maybeBind(host, host.getDefaultLibLocation),
103614
103610
  getDefaultLibFileName: function (options) { return host.getDefaultLibFileName(options); },
103615
- writeFile: ts.createWriteFile(function (path, data, writeByteOrderMark) { return host.writeFile(path, data, writeByteOrderMark); }, function (path) { return host.createDirectory(path); }, function (path) { return host.directoryExists(path); }),
103611
+ writeFile: writeFile,
103616
103612
  getCurrentDirectory: ts.memoize(function () { return host.getCurrentDirectory(); }),
103617
103613
  useCaseSensitiveFileNames: function () { return useCaseSensitiveFileNames; },
103618
103614
  getCanonicalFileName: ts.createGetCanonicalFileName(useCaseSensitiveFileNames),
@@ -103628,8 +103624,20 @@ var ts;
103628
103624
  readDirectory: ts.maybeBind(host, host.readDirectory),
103629
103625
  disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
103630
103626
  storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
103631
- buildInfoCallbacks: host.buildInfoCallbacks,
103632
103627
  };
103628
+ function writeFile(fileName, text, writeByteOrderMark, onError) {
103629
+ try {
103630
+ ts.performance.mark("beforeIOWrite");
103631
+ ts.writeFileEnsuringDirectories(fileName, text, writeByteOrderMark, function (path, data, writeByteOrderMark) { return host.writeFile(path, data, writeByteOrderMark); }, function (path) { return host.createDirectory(path); }, function (path) { return host.directoryExists(path); });
103632
+ ts.performance.mark("afterIOWrite");
103633
+ ts.performance.measure("I/O Write", "beforeIOWrite", "afterIOWrite");
103634
+ }
103635
+ catch (e) {
103636
+ if (onError) {
103637
+ onError(e.message);
103638
+ }
103639
+ }
103640
+ }
103633
103641
  }
103634
103642
  ts.createCompilerHostFromProgramHost = createCompilerHostFromProgramHost;
103635
103643
  function setGetSourceFileAsHashVersioned(compilerHost, host) {
@@ -103726,19 +103734,17 @@ var ts;
103726
103734
  var ts;
103727
103735
  (function (ts) {
103728
103736
  function readBuilderProgram(compilerOptions, host) {
103729
- var _a;
103730
103737
  var buildInfoPath = ts.getTsBuildInfoEmitOutputFilePath(compilerOptions);
103731
103738
  if (!buildInfoPath)
103732
103739
  return undefined;
103733
103740
  var buildInfo;
103734
103741
  if (host.getBuildInfo) {
103735
- buildInfo = host.getBuildInfo(buildInfoPath, compilerOptions);
103742
+ buildInfo = host.getBuildInfo(buildInfoPath, compilerOptions.configFilePath);
103736
103743
  }
103737
103744
  else {
103738
103745
  var content = host.readFile(buildInfoPath);
103739
103746
  if (!content)
103740
103747
  return undefined;
103741
- (_a = host.buildInfoCallbacks) === null || _a === void 0 ? void 0 : _a.onRead(content.length, compilerOptions);
103742
103748
  buildInfo = ts.getBuildInfo(buildInfoPath, content);
103743
103749
  }
103744
103750
  if (!buildInfo || buildInfo.version !== ts.version || !buildInfo.program)
@@ -103972,7 +103978,7 @@ var ts;
103972
103978
  }
103973
103979
  reportFileChangeDetectedOnCreateProgram = false;
103974
103980
  if (host.afterProgramCreate && program !== builderProgram) {
103975
- host.afterProgramCreate(builderProgram, compilerHost);
103981
+ host.afterProgramCreate(builderProgram);
103976
103982
  }
103977
103983
  compilerHost.readFile = originalReadFile;
103978
103984
  compilerHost.fileExists = originalFileExists;
@@ -104534,7 +104540,7 @@ var ts;
104534
104540
  return ts.loadWithTypeDirectiveCache(ts.Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, containingFileMode, loader_4);
104535
104541
  };
104536
104542
  }
104537
- compilerHost.getBuildInfo = function (fileName, options) { return getBuildInfo(state, fileName, options, toResolvedConfigFilePath(state, options.configFilePath), undefined); };
104543
+ compilerHost.getBuildInfo = function (fileName, configFilePath) { return getBuildInfo(state, fileName, toResolvedConfigFilePath(state, configFilePath), undefined); };
104538
104544
  var _a = ts.createWatchFactory(hostWithWatch, options), watchFile = _a.watchFile, watchDirectory = _a.watchDirectory, writeLog = _a.writeLog;
104539
104545
  var state = {
104540
104546
  host: host,
@@ -104973,7 +104979,7 @@ var ts;
104973
104979
  }
104974
104980
  function emit(writeFileCallback, cancellationToken, customTransformers) {
104975
104981
  var _a;
104976
- var _b, _c, _d, _e, _f;
104982
+ var _b, _c, _d;
104977
104983
  ts.Debug.assertIsDefined(program);
104978
104984
  ts.Debug.assert(step === BuildStep.Emit);
104979
104985
  var saved = program.saveEmitState();
@@ -104983,7 +104989,6 @@ var ts;
104983
104989
  var emitResult = ts.emitFilesAndReportErrors(program, reportDeclarationDiagnostics, undefined, undefined, function (name, text, writeByteOrderMark, _onError, _sourceFiles, data) { return outputFiles.push({ name: name, text: text, writeByteOrderMark: writeByteOrderMark, buildInfo: data === null || data === void 0 ? void 0 : data.buildInfo }); }, cancellationToken, false, customTransformers || ((_c = (_b = state.host).getCustomTransformers) === null || _c === void 0 ? void 0 : _c.call(_b, project))).emitResult;
104984
104990
  if (declDiagnostics) {
104985
104991
  program.restoreEmitState(saved);
104986
- (_d = state.compilerHost.buildInfoCallbacks) === null || _d === void 0 ? void 0 : _d.revertLastWrite();
104987
104992
  (_a = buildErrors(state, projectPath, program, config, declDiagnostics, BuildResultFlags.DeclarationEmitErrors, "Declaration file"), buildResult = _a.buildResult, step = _a.step);
104988
104993
  return {
104989
104994
  emitSkipped: true,
@@ -104991,8 +104996,7 @@ var ts;
104991
104996
  };
104992
104997
  }
104993
104998
  var host = state.host, compilerHost = state.compilerHost;
104994
- (_e = compilerHost.buildInfoCallbacks) === null || _e === void 0 ? void 0 : _e.clearLastWrite();
104995
- var resultFlags = ((_f = program.hasChangedEmitSignature) === null || _f === void 0 ? void 0 : _f.call(program)) ? BuildResultFlags.None : BuildResultFlags.DeclarationOutputUnchanged;
104999
+ var resultFlags = ((_d = program.hasChangedEmitSignature) === null || _d === void 0 ? void 0 : _d.call(program)) ? BuildResultFlags.None : BuildResultFlags.DeclarationOutputUnchanged;
104996
105000
  var emitterDiagnostics = ts.createDiagnosticCollection();
104997
105001
  var emittedOutputs = new ts.Map();
104998
105002
  var options = program.getCompilerOptions();
@@ -105058,7 +105062,7 @@ var ts;
105058
105062
  return emitDiagnostics;
105059
105063
  }
105060
105064
  function emitBundle(writeFileCallback, customTransformers) {
105061
- var _a, _b, _c, _d;
105065
+ var _a, _b;
105062
105066
  ts.Debug.assert(kind === InvalidatedProjectKind.UpdateBundle);
105063
105067
  if (state.options.dry) {
105064
105068
  reportStatus(state, ts.Diagnostics.A_non_dry_build_would_update_output_of_project_0, project);
@@ -105070,11 +105074,10 @@ var ts;
105070
105074
  reportStatus(state, ts.Diagnostics.Updating_output_of_project_0, project);
105071
105075
  var compilerHost = state.compilerHost;
105072
105076
  state.projectCompilerOptions = config.options;
105073
- (_b = (_a = state.host).beforeEmitBundle) === null || _b === void 0 ? void 0 : _b.call(_a, config, compilerHost);
105074
105077
  var outputFiles = ts.emitUsingBuildInfo(config, compilerHost, function (ref) {
105075
105078
  var refName = resolveProjectName(state, ref.path);
105076
105079
  return parseConfigFile(state, refName, toResolvedConfigFilePath(state, refName));
105077
- }, customTransformers || ((_d = (_c = state.host).getCustomTransformers) === null || _d === void 0 ? void 0 : _d.call(_c, project)));
105080
+ }, customTransformers || ((_b = (_a = state.host).getCustomTransformers) === null || _b === void 0 ? void 0 : _b.call(_a, project)));
105078
105081
  if (ts.isString(outputFiles)) {
105079
105082
  reportStatus(state, ts.Diagnostics.Cannot_update_output_of_project_0_because_there_was_error_reading_file_1, project, relName(state, outputFiles));
105080
105083
  step = BuildStep.BuildInvalidatedProjectOfBundle;
@@ -105266,12 +105269,12 @@ var ts;
105266
105269
  if (state.write)
105267
105270
  ts.listFiles(program, state.write);
105268
105271
  if (state.host.afterProgramEmitAndDiagnostics) {
105269
- state.host.afterProgramEmitAndDiagnostics(program, state.compilerHost);
105272
+ state.host.afterProgramEmitAndDiagnostics(program);
105270
105273
  }
105271
105274
  program.releaseProgram();
105272
105275
  }
105273
105276
  else if (state.host.afterEmitBundle) {
105274
- state.host.afterEmitBundle(config, state.compilerHost);
105277
+ state.host.afterEmitBundle(config);
105275
105278
  }
105276
105279
  state.projectCompilerOptions = state.baseCompilerOptions;
105277
105280
  }
@@ -105366,16 +105369,13 @@ var ts;
105366
105369
  var existing = state.buildInfoCache.get(resolvedConfigPath);
105367
105370
  return (existing === null || existing === void 0 ? void 0 : existing.path) === path ? existing : undefined;
105368
105371
  }
105369
- function getBuildInfo(state, buildInfoPath, options, resolvedConfigPath, modifiedTime) {
105370
- var _a;
105372
+ function getBuildInfo(state, buildInfoPath, resolvedConfigPath, modifiedTime) {
105371
105373
  var path = toPath(state, buildInfoPath);
105372
105374
  var existing = state.buildInfoCache.get(resolvedConfigPath);
105373
105375
  if (existing !== undefined && existing.path === path) {
105374
105376
  return existing.buildInfo || undefined;
105375
105377
  }
105376
105378
  var value = state.readFileWithCache(buildInfoPath);
105377
- if (value)
105378
- (_a = (modifiedTime ? state.host : state.compilerHost).buildInfoCallbacks) === null || _a === void 0 ? void 0 : _a.onRead(value.length, options);
105379
105379
  var buildInfo = value ? ts.getBuildInfo(buildInfoPath, value) : undefined;
105380
105380
  state.buildInfoCache.set(resolvedConfigPath, { path: path, buildInfo: buildInfo || false, modifiedTime: modifiedTime || ts.missingFileModifiedTime });
105381
105381
  return buildInfo;
@@ -105454,7 +105454,7 @@ var ts;
105454
105454
  missingOutputFileName: buildInfoPath
105455
105455
  };
105456
105456
  }
105457
- var buildInfo = getBuildInfo(state, buildInfoPath, project.options, resolvedPath, buildInfoTime);
105457
+ var buildInfo = getBuildInfo(state, buildInfoPath, resolvedPath, buildInfoTime);
105458
105458
  if (!buildInfo) {
105459
105459
  return {
105460
105460
  type: ts.UpToDateStatusType.ErrorReadingFile,
@@ -106143,7 +106143,6 @@ var ts;
106143
106143
  StatisticType[StatisticType["time"] = 0] = "time";
106144
106144
  StatisticType[StatisticType["count"] = 1] = "count";
106145
106145
  StatisticType[StatisticType["memory"] = 2] = "memory";
106146
- StatisticType[StatisticType["size"] = 3] = "size";
106147
106146
  })(StatisticType = ts.StatisticType || (ts.StatisticType = {}));
106148
106147
  function countLines(program) {
106149
106148
  var counts = getCountsMap();
@@ -106697,25 +106696,22 @@ var ts;
106697
106696
  if (reportWatchModeWithoutSysSupport(sys, reportDiagnostic))
106698
106697
  return;
106699
106698
  var buildHost_1 = ts.createSolutionBuilderWithWatchHost(sys, undefined, reportDiagnostic, ts.createBuilderStatusReporter(sys, shouldBePretty(sys, buildOptions)), createWatchStatusReporter(sys, buildOptions));
106700
- var solutionPerformance_1 = enableSolutionPerformance(sys, buildOptions, buildHost_1);
106699
+ var solutionPerformance_1 = enableSolutionPerformance(sys, buildOptions);
106701
106700
  updateSolutionBuilderHost(sys, cb, buildHost_1, solutionPerformance_1);
106702
106701
  var onWatchStatusChange_1 = buildHost_1.onWatchStatusChange;
106703
- var reportBuildStatistics_1 = false;
106704
106702
  buildHost_1.onWatchStatusChange = function (d, newLine, options, errorCount) {
106705
106703
  onWatchStatusChange_1 === null || onWatchStatusChange_1 === void 0 ? void 0 : onWatchStatusChange_1(d, newLine, options, errorCount);
106706
- if (reportBuildStatistics_1 && (d.code === ts.Diagnostics.Found_0_errors_Watching_for_file_changes.code ||
106707
- d.code === ts.Diagnostics.Found_1_error_Watching_for_file_changes.code)) {
106704
+ if (d.code === ts.Diagnostics.Found_0_errors_Watching_for_file_changes.code ||
106705
+ d.code === ts.Diagnostics.Found_1_error_Watching_for_file_changes.code) {
106708
106706
  reportSolutionBuilderTimes(builder_1, solutionPerformance_1);
106709
106707
  }
106710
106708
  };
106711
106709
  var builder_1 = ts.createSolutionBuilderWithWatch(buildHost_1, projects, buildOptions, watchOptions);
106712
106710
  builder_1.build();
106713
- reportSolutionBuilderTimes(builder_1, solutionPerformance_1);
106714
- reportBuildStatistics_1 = true;
106715
106711
  return builder_1;
106716
106712
  }
106717
106713
  var buildHost = ts.createSolutionBuilderHost(sys, undefined, reportDiagnostic, ts.createBuilderStatusReporter(sys, shouldBePretty(sys, buildOptions)), createReportErrorSummary(sys, buildOptions));
106718
- var solutionPerformance = enableSolutionPerformance(sys, buildOptions, buildHost);
106714
+ var solutionPerformance = enableSolutionPerformance(sys, buildOptions);
106719
106715
  updateSolutionBuilderHost(sys, cb, buildHost, solutionPerformance);
106720
106716
  var builder = ts.createSolutionBuilder(buildHost, projects, buildOptions);
106721
106717
  var exitStatus = buildOptions.clean ? builder.clean() : builder.build();
@@ -106734,7 +106730,7 @@ var ts;
106734
106730
  var currentDirectory = host.getCurrentDirectory();
106735
106731
  var getCanonicalFileName = ts.createGetCanonicalFileName(host.useCaseSensitiveFileNames());
106736
106732
  ts.changeCompilerHostLikeToUseCache(host, function (fileName) { return ts.toPath(fileName, currentDirectory, getCanonicalFileName); });
106737
- enableStatisticsAndTracing(sys, options, host, false);
106733
+ enableStatisticsAndTracing(sys, options, false);
106738
106734
  var programOptions = {
106739
106735
  rootNames: fileNames,
106740
106736
  options: options,
@@ -106744,14 +106740,14 @@ var ts;
106744
106740
  };
106745
106741
  var program = ts.createProgram(programOptions);
106746
106742
  var exitStatus = ts.emitFilesAndReportErrorsAndGetExitStatus(program, reportDiagnostic, function (s) { return sys.write(s + sys.newLine); }, createReportErrorSummary(sys, options));
106747
- reportStatistics(sys, program, host, undefined);
106743
+ reportStatistics(sys, program, undefined);
106748
106744
  cb(program);
106749
106745
  return sys.exit(exitStatus);
106750
106746
  }
106751
106747
  function performIncrementalCompilation(sys, cb, reportDiagnostic, config) {
106752
106748
  var options = config.options, fileNames = config.fileNames, projectReferences = config.projectReferences;
106749
+ enableStatisticsAndTracing(sys, options, false);
106753
106750
  var host = ts.createIncrementalCompilerHost(options, sys);
106754
- enableStatisticsAndTracing(sys, options, host, false);
106755
106751
  var exitStatus = ts.performIncrementalCompilation({
106756
106752
  host: host,
106757
106753
  system: sys,
@@ -106762,7 +106758,7 @@ var ts;
106762
106758
  reportDiagnostic: reportDiagnostic,
106763
106759
  reportErrorSummary: createReportErrorSummary(sys, options),
106764
106760
  afterProgramEmitAndDiagnostics: function (builderProgram) {
106765
- reportStatistics(sys, builderProgram.getProgram(), host, undefined);
106761
+ reportStatistics(sys, builderProgram.getProgram(), undefined);
106766
106762
  cb(builderProgram);
106767
106763
  }
106768
106764
  });
@@ -106770,35 +106766,28 @@ var ts;
106770
106766
  }
106771
106767
  function updateSolutionBuilderHost(sys, cb, buildHost, solutionPerformance) {
106772
106768
  updateCreateProgram(sys, buildHost, true);
106773
- buildHost.afterProgramEmitAndDiagnostics = function (program, host) {
106774
- reportStatistics(sys, program.getProgram(), host, solutionPerformance);
106769
+ buildHost.afterProgramEmitAndDiagnostics = function (program) {
106770
+ reportStatistics(sys, program.getProgram(), solutionPerformance);
106775
106771
  cb(program);
106776
106772
  };
106777
- buildHost.beforeEmitBundle = function (config, host) { return enableStatisticsAndTracing(sys, config.options, host, true); };
106778
- buildHost.afterEmitBundle = function (config, host) {
106779
- reportStatistics(sys, config, host, solutionPerformance);
106780
- cb(config);
106781
- };
106773
+ buildHost.afterEmitBundle = cb;
106782
106774
  }
106783
106775
  function updateCreateProgram(sys, host, isBuildMode) {
106784
106776
  var compileUsingBuilder = host.createProgram;
106785
106777
  host.createProgram = function (rootNames, options, host, oldProgram, configFileParsingDiagnostics, projectReferences) {
106786
106778
  ts.Debug.assert(rootNames !== undefined || (options === undefined && !!oldProgram));
106787
106779
  if (options !== undefined) {
106788
- enableStatisticsAndTracing(sys, options, host, isBuildMode);
106780
+ enableStatisticsAndTracing(sys, options, isBuildMode);
106789
106781
  }
106790
106782
  return compileUsingBuilder(rootNames, options, host, oldProgram, configFileParsingDiagnostics, projectReferences);
106791
106783
  };
106792
106784
  }
106793
- function updateWatchCompilationHost(system, cb, watchCompilerHost, options) {
106794
- updateCreateProgram(system, watchCompilerHost, false);
106795
- if (system === ts.sys && options.extendedDiagnostics) {
106796
- createBuildInfoCallbacks(watchCompilerHost, options);
106797
- }
106785
+ function updateWatchCompilationHost(sys, cb, watchCompilerHost) {
106786
+ updateCreateProgram(sys, watchCompilerHost, false);
106798
106787
  var emitFilesUsingBuilder = watchCompilerHost.afterProgramCreate;
106799
- watchCompilerHost.afterProgramCreate = function (builderProgram, host) {
106800
- emitFilesUsingBuilder(builderProgram, host);
106801
- reportStatistics(system, builderProgram.getProgram(), host, undefined);
106788
+ watchCompilerHost.afterProgramCreate = function (builderProgram) {
106789
+ emitFilesUsingBuilder(builderProgram);
106790
+ reportStatistics(sys, builderProgram.getProgram(), undefined);
106802
106791
  cb(builderProgram);
106803
106792
  };
106804
106793
  }
@@ -106814,7 +106803,7 @@ var ts;
106814
106803
  reportDiagnostic: reportDiagnostic,
106815
106804
  reportWatchStatus: createWatchStatusReporter(system, configParseResult.options)
106816
106805
  });
106817
- updateWatchCompilationHost(system, cb, watchCompilerHost, configParseResult.options);
106806
+ updateWatchCompilationHost(system, cb, watchCompilerHost);
106818
106807
  watchCompilerHost.configFileParsingResult = configParseResult;
106819
106808
  watchCompilerHost.extendedConfigCache = extendedConfigCache;
106820
106809
  return ts.createWatchProgram(watchCompilerHost);
@@ -106828,24 +106817,21 @@ var ts;
106828
106817
  reportDiagnostic: reportDiagnostic,
106829
106818
  reportWatchStatus: createWatchStatusReporter(system, options)
106830
106819
  });
106831
- updateWatchCompilationHost(system, cb, watchCompilerHost, options);
106820
+ updateWatchCompilationHost(system, cb, watchCompilerHost);
106832
106821
  return ts.createWatchProgram(watchCompilerHost);
106833
106822
  }
106834
- function enableSolutionPerformance(system, options, buildHost) {
106823
+ function enableSolutionPerformance(system, options) {
106835
106824
  if (system === ts.sys && options.extendedDiagnostics) {
106836
106825
  ts.performance.enable();
106837
- return createSolutionPerfomrance(buildHost);
106826
+ return createSolutionPerfomrance();
106838
106827
  }
106839
106828
  }
106840
- function createSolutionPerfomrance(buildHost) {
106829
+ function createSolutionPerfomrance() {
106841
106830
  var statistics;
106842
- var buildInfoCallbacks = createBuildInfoCallbacks(buildHost, undefined);
106843
106831
  return {
106844
106832
  addAggregateStatistic: addAggregateStatistic,
106845
- hasStatistics: hasStatistics,
106846
- forEachAggregateStatistics: forEachAggregateStatistics,
106833
+ forEachAggregateStatistics: forEachAggreateStatistics,
106847
106834
  clear: clear,
106848
- buildInfoCallbacks: buildInfoCallbacks,
106849
106835
  };
106850
106836
  function addAggregateStatistic(s) {
106851
106837
  var existing = statistics === null || statistics === void 0 ? void 0 : statistics.get(s.name);
@@ -106859,15 +106845,11 @@ var ts;
106859
106845
  (statistics !== null && statistics !== void 0 ? statistics : (statistics = new ts.Map())).set(s.name, s);
106860
106846
  }
106861
106847
  }
106862
- function hasStatistics(name) {
106863
- return !!(statistics === null || statistics === void 0 ? void 0 : statistics.has(name));
106864
- }
106865
- function forEachAggregateStatistics(cb) {
106848
+ function forEachAggreateStatistics(cb) {
106866
106849
  statistics === null || statistics === void 0 ? void 0 : statistics.forEach(cb);
106867
106850
  }
106868
106851
  function clear() {
106869
106852
  statistics = undefined;
106870
- buildInfoCallbacks.clear();
106871
106853
  }
106872
106854
  }
106873
106855
  function reportSolutionBuilderTimes(builder, solutionPerformance) {
@@ -106882,8 +106864,6 @@ var ts;
106882
106864
  reportSolutionBuilderCountStatistic("SolutionBuilder::Projects built");
106883
106865
  reportSolutionBuilderCountStatistic("SolutionBuilder::Timestamps only updates");
106884
106866
  reportSolutionBuilderCountStatistic("SolutionBuilder::Bundles updated");
106885
- reportBuildInfoReadOrWriteStatistic(solutionPerformance.buildInfoCallbacks.getRead(), "read");
106886
- reportBuildInfoReadOrWriteStatistic(solutionPerformance.buildInfoCallbacks.getWrite(), "write");
106887
106867
  solutionPerformance.forEachAggregateStatistics(function (s) {
106888
106868
  s.name = "Aggregate " + s.name;
106889
106869
  statistics.push(s);
@@ -106894,7 +106874,6 @@ var ts;
106894
106874
  });
106895
106875
  ts.performance.disable();
106896
106876
  ts.performance.enable();
106897
- solutionPerformance.clear();
106898
106877
  reportAllStatistics(ts.sys, statistics);
106899
106878
  function reportSolutionBuilderCountStatistic(name) {
106900
106879
  var value = ts.performance.getCount(name);
@@ -106905,18 +106884,6 @@ var ts;
106905
106884
  function getNameFromSolutionBuilderMarkOrMeasure(name) {
106906
106885
  return name.replace("SolutionBuilder::", "");
106907
106886
  }
106908
- function reportBuildInfoReadOrWriteStatistic(s, type) {
106909
- if (s.count) {
106910
- var countStatisticName = "BuildInfo " + type;
106911
- if (s.count !== 1)
106912
- statistics.push({ name: countStatisticName, value: s.count, type: StatisticType.count });
106913
- statistics.push({ name: "BuildInfo " + type + " size", value: s.size, type: StatisticType.size });
106914
- if (solutionPerformance.hasStatistics(countStatisticName)) {
106915
- solutionPerformance.addAggregateStatistic({ name: countStatisticName, value: s.count, type: StatisticType.count });
106916
- solutionPerformance.addAggregateStatistic({ name: "BuildInfo " + type + " size", value: s.size, type: StatisticType.size });
106917
- }
106918
- }
106919
- }
106920
106887
  }
106921
106888
  function canReportDiagnostics(system, compilerOptions) {
106922
106889
  return system === ts.sys && (compilerOptions.diagnostics || compilerOptions.extendedDiagnostics);
@@ -106924,123 +106891,19 @@ var ts;
106924
106891
  function canTrace(system, compilerOptions) {
106925
106892
  return system === ts.sys && compilerOptions.generateTrace;
106926
106893
  }
106927
- function enableStatisticsAndTracing(system, compilerOptions, host, isBuildMode) {
106894
+ function enableStatisticsAndTracing(system, compilerOptions, isBuildMode) {
106928
106895
  if (canReportDiagnostics(system, compilerOptions)) {
106929
106896
  ts.performance.enable(system);
106930
106897
  }
106931
106898
  if (canTrace(system, compilerOptions)) {
106932
106899
  ts.startTracing(isBuildMode ? "build" : "project", compilerOptions.generateTrace, compilerOptions.configFilePath);
106933
106900
  }
106934
- if (system === ts.sys && host) {
106935
- if (compilerOptions.extendedDiagnostics && ts.isIncrementalCompilation(compilerOptions)) {
106936
- createBuildInfoCallbacks(host, compilerOptions);
106937
- }
106938
- else {
106939
- createNoOpBuildInfoCallbacks(host);
106940
- }
106941
- }
106942
- }
106943
- var zeroCount = { count: 0, size: 0 };
106944
- function createNoOpBuildInfoCallbacks(host) {
106945
- var oldCallbacks = host.buildInfoCallbacks;
106946
- oldCallbacks === null || oldCallbacks === void 0 ? void 0 : oldCallbacks.clearLastRead();
106947
- return host.buildInfoCallbacks = {
106948
- onRead: ts.noop,
106949
- onWrite: ts.noop,
106950
- getRead: function () { return zeroCount; },
106951
- getWrite: function () { return zeroCount; },
106952
- getLastRead: ts.returnUndefined,
106953
- onTransferLastRead: ts.noop,
106954
- clearLastRead: ts.noop,
106955
- revertLastWrite: ts.noop,
106956
- clearLastWrite: ts.noop,
106957
- close: function (host) { return host.buildInfoCallbacks = oldCallbacks; },
106958
- clear: ts.noop,
106959
- };
106960
- }
106961
- function createBuildInfoCallbacks(host, options) {
106962
- var read = initializedCountAndSize();
106963
- var write = initializedCountAndSize();
106964
- var lastRead;
106965
- var lastWrite;
106966
- var oldCallbacks = host.buildInfoCallbacks;
106967
- if (oldCallbacks) {
106968
- var oldLastRead = oldCallbacks.getLastRead();
106969
- if (oldLastRead && oldLastRead.compilerOptions === options) {
106970
- onReadOrWrite(read, oldLastRead.size);
106971
- oldCallbacks.onTransferLastRead();
106972
- }
106973
- else {
106974
- oldCallbacks.clearLastRead();
106975
- }
106976
- }
106977
- return host.buildInfoCallbacks = {
106978
- onRead: onRead,
106979
- onWrite: onWrite,
106980
- getRead: function () { return read; },
106981
- getWrite: function () { return write; },
106982
- getLastRead: function () { return lastRead; },
106983
- onTransferLastRead: onTransferLastRead,
106984
- clearLastRead: function () { return lastRead = undefined; },
106985
- revertLastWrite: revertLastWrite,
106986
- clearLastWrite: function () { return lastWrite = undefined; },
106987
- close: function (host) { return host.buildInfoCallbacks = oldCallbacks; },
106988
- clear: clear,
106989
- };
106990
- function clear() {
106991
- ts.Debug.assert(!oldCallbacks);
106992
- clearReadOrWrite(read);
106993
- clearReadOrWrite(write);
106994
- lastRead = undefined;
106995
- lastWrite = undefined;
106996
- }
106997
- function clearReadOrWrite(countAndSize) {
106998
- countAndSize.count = 0;
106999
- countAndSize.size = 0;
107000
- }
107001
- function onTransferLastRead() {
107002
- revertReadOrWrite(read, lastRead.size);
107003
- lastRead = undefined;
107004
- }
107005
- function revertLastWrite() {
107006
- if (lastWrite) {
107007
- revertReadOrWrite(write, lastWrite);
107008
- lastWrite = undefined;
107009
- }
107010
- }
107011
- function revertReadOrWrite(countAndSize, size) {
107012
- countAndSize.count--;
107013
- countAndSize.size -= size;
107014
- }
107015
- function onRead(size, compilerOptions) {
107016
- onReadOrWrite(read, size);
107017
- if (compilerOptions)
107018
- lastRead = { size: size, compilerOptions: compilerOptions };
107019
- else
107020
- lastRead = undefined;
107021
- }
107022
- function onWrite(size) {
107023
- onReadOrWrite(write, size);
107024
- lastWrite = size;
107025
- }
107026
- function onReadOrWrite(countAndSize, size) {
107027
- countAndSize.count++;
107028
- countAndSize.size += size;
107029
- }
107030
- }
107031
- function initializedCountAndSize() {
107032
- return { count: 0, size: 0 };
107033
106901
  }
107034
106902
  function isSolutionMarkOrMeasure(name) {
107035
106903
  return ts.startsWith(name, "SolutionBuilder::");
107036
106904
  }
107037
- function isProgram(programOrConfig) {
107038
- return !programOrConfig.options;
107039
- }
107040
- function reportStatistics(sys, programOrConfig, host, solutionPerformance) {
107041
- var program = isProgram(programOrConfig) ? programOrConfig : undefined;
107042
- var config = isProgram(programOrConfig) ? undefined : programOrConfig;
107043
- var compilerOptions = program ? program.getCompilerOptions() : config.options;
106905
+ function reportStatistics(sys, program, solutionPerformance) {
106906
+ var compilerOptions = program.getCompilerOptions();
107044
106907
  if (canTrace(sys, compilerOptions)) {
107045
106908
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.stopTracing();
107046
106909
  }
@@ -107048,23 +106911,21 @@ var ts;
107048
106911
  if (canReportDiagnostics(sys, compilerOptions)) {
107049
106912
  statistics = [];
107050
106913
  var memoryUsed = sys.getMemoryUsage ? sys.getMemoryUsage() : -1;
107051
- if (program) {
107052
- reportCountStatistic("Files", program.getSourceFiles().length);
107053
- var lineCounts = countLines(program);
107054
- if (compilerOptions.extendedDiagnostics) {
107055
- for (var _i = 0, _a = ts.arrayFrom(lineCounts.keys()); _i < _a.length; _i++) {
107056
- var key = _a[_i];
107057
- reportCountStatistic("Lines of " + key, lineCounts.get(key));
107058
- }
107059
- }
107060
- else {
107061
- reportCountStatistic("Lines", ts.reduceLeftIterator(lineCounts.values(), function (sum, count) { return sum + count; }, 0));
106914
+ reportCountStatistic("Files", program.getSourceFiles().length);
106915
+ var lineCounts = countLines(program);
106916
+ if (compilerOptions.extendedDiagnostics) {
106917
+ for (var _i = 0, _a = ts.arrayFrom(lineCounts.keys()); _i < _a.length; _i++) {
106918
+ var key = _a[_i];
106919
+ reportCountStatistic("Lines of " + key, lineCounts.get(key));
107062
106920
  }
107063
- reportCountStatistic("Identifiers", program.getIdentifierCount());
107064
- reportCountStatistic("Symbols", program.getSymbolCount());
107065
- reportCountStatistic("Types", program.getTypeCount());
107066
- reportCountStatistic("Instantiations", program.getInstantiationCount());
107067
106921
  }
106922
+ else {
106923
+ reportCountStatistic("Lines", ts.reduceLeftIterator(lineCounts.values(), function (sum, count) { return sum + count; }, 0));
106924
+ }
106925
+ reportCountStatistic("Identifiers", program.getIdentifierCount());
106926
+ reportCountStatistic("Symbols", program.getSymbolCount());
106927
+ reportCountStatistic("Types", program.getTypeCount());
106928
+ reportCountStatistic("Instantiations", program.getInstantiationCount());
107068
106929
  if (memoryUsed >= 0) {
107069
106930
  reportStatisticalValue({ name: "Memory used", value: memoryUsed, type: StatisticType.memory }, true);
107070
106931
  }
@@ -107074,18 +106935,11 @@ var ts;
107074
106935
  var checkTime = isPerformanceEnabled ? ts.performance.getDuration("Check") : 0;
107075
106936
  var emitTime = isPerformanceEnabled ? ts.performance.getDuration("Emit") : 0;
107076
106937
  if (compilerOptions.extendedDiagnostics) {
107077
- if (program) {
107078
- var caches = program.getRelationCacheSizes();
107079
- reportCountStatistic("Assignability cache size", caches.assignable);
107080
- reportCountStatistic("Identity cache size", caches.identity);
107081
- reportCountStatistic("Subtype cache size", caches.subtype);
107082
- reportCountStatistic("Strict subtype cache size", caches.strictSubtype);
107083
- }
107084
- if (host === null || host === void 0 ? void 0 : host.buildInfoCallbacks) {
107085
- reportBuildInfoReadOrWriteStatistic(host.buildInfoCallbacks.getRead(), "read");
107086
- reportBuildInfoReadOrWriteStatistic(host.buildInfoCallbacks.getWrite(), "write");
107087
- host.buildInfoCallbacks.close(host);
107088
- }
106938
+ var caches = program.getRelationCacheSizes();
106939
+ reportCountStatistic("Assignability cache size", caches.assignable);
106940
+ reportCountStatistic("Identity cache size", caches.identity);
106941
+ reportCountStatistic("Subtype cache size", caches.subtype);
106942
+ reportCountStatistic("Strict subtype cache size", caches.strictSubtype);
107089
106943
  if (isPerformanceEnabled) {
107090
106944
  ts.performance.forEachMeasure(function (name, duration) {
107091
106945
  if (!isSolutionMarkOrMeasure(name))
@@ -107135,17 +106989,6 @@ var ts;
107135
106989
  function reportTimeStatistic(name, time, aggregate) {
107136
106990
  reportStatisticalValue({ name: name, value: time, type: StatisticType.time }, aggregate);
107137
106991
  }
107138
- function reportBuildInfoReadOrWriteStatistic(s, type) {
107139
- if (s.count) {
107140
- if (s.count === 1) {
107141
- solutionPerformance === null || solutionPerformance === void 0 ? void 0 : solutionPerformance.addAggregateStatistic({ name: "BuildInfo " + type, value: s.count, type: StatisticType.count });
107142
- }
107143
- else {
107144
- reportCountStatistic("BuildInfo " + type, s.count);
107145
- }
107146
- reportStatisticalValue({ name: "BuildInfo " + type + " size", value: s.size, type: StatisticType.size }, true);
107147
- }
107148
- }
107149
106992
  }
107150
106993
  function reportAllStatistics(sys, statistics) {
107151
106994
  var nameSize = 0;
@@ -107172,7 +107015,6 @@ var ts;
107172
107015
  case StatisticType.time:
107173
107016
  return (s.value / 1000).toFixed(2) + "s";
107174
107017
  case StatisticType.memory:
107175
- case StatisticType.size:
107176
107018
  return Math.round(s.value / 1000) + "K";
107177
107019
  default:
107178
107020
  ts.Debug.assertNever(s.type);