typescript 4.8.0-dev.20220809 → 4.9.0-dev.20220812

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.
@@ -85,11 +85,11 @@ var ts;
85
85
  (function (ts) {
86
86
  // WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values.
87
87
  // If changing the text in this section, be sure to test `configurePrerelease` too.
88
- ts.versionMajorMinor = "4.8";
88
+ ts.versionMajorMinor = "4.9";
89
89
  // The following is baselined as a literal template type without intervention
90
90
  /** The version of the TypeScript compiler release */
91
91
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
92
- ts.version = ts.versionMajorMinor + ".0-dev.20220809";
92
+ ts.version = ts.versionMajorMinor + ".0-dev.20220812";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -111,7 +111,11 @@ var ts;
111
111
  // Internet Explorer's Map doesn't support iteration, so don't use it.
112
112
  var gMap = globals === null || globals === void 0 ? void 0 : globals.Map;
113
113
  // eslint-disable-next-line no-in-operator
114
- return typeof gMap !== "undefined" && "entries" in gMap.prototype && new gMap([[0, 0]]).size === 1 ? gMap : undefined;
114
+ var constructor = typeof gMap !== "undefined" && "entries" in gMap.prototype && new gMap([[0, 0]]).size === 1 ? gMap : undefined;
115
+ if (!constructor) {
116
+ throw new Error("No compatible Map implementation found.");
117
+ }
118
+ return constructor;
115
119
  }
116
120
  NativeCollections.tryGetNativeMap = tryGetNativeMap;
117
121
  /**
@@ -121,23 +125,18 @@ var ts;
121
125
  // Internet Explorer's Set doesn't support iteration, so don't use it.
122
126
  var gSet = globals === null || globals === void 0 ? void 0 : globals.Set;
123
127
  // eslint-disable-next-line no-in-operator
124
- return typeof gSet !== "undefined" && "entries" in gSet.prototype && new gSet([0]).size === 1 ? gSet : undefined;
128
+ var constructor = typeof gSet !== "undefined" && "entries" in gSet.prototype && new gSet([0]).size === 1 ? gSet : undefined;
129
+ if (!constructor) {
130
+ throw new Error("No compatible Set implementation found.");
131
+ }
132
+ return constructor;
125
133
  }
126
134
  NativeCollections.tryGetNativeSet = tryGetNativeSet;
127
135
  })(NativeCollections || (NativeCollections = {}));
128
136
  /* @internal */
129
- ts.Map = getCollectionImplementation("Map", "tryGetNativeMap", "createMapShim");
130
- /* @internal */
131
- ts.Set = getCollectionImplementation("Set", "tryGetNativeSet", "createSetShim");
137
+ ts.Map = NativeCollections.tryGetNativeMap();
132
138
  /* @internal */
133
- function getCollectionImplementation(name, nativeFactory, shimFactory) {
134
- var _a;
135
- // NOTE: ts.ShimCollections will be defined for typescriptServices.js but not for tsc.js, so we must test for it.
136
- var constructor = (_a = NativeCollections[nativeFactory]()) !== null && _a !== void 0 ? _a : ts.ShimCollections === null || ts.ShimCollections === void 0 ? void 0 : ts.ShimCollections[shimFactory](ts.getIterator);
137
- if (constructor)
138
- return constructor;
139
- throw new Error("TypeScript requires an environment that provides a compatible native " + name + " implementation.");
140
- }
139
+ ts.Set = NativeCollections.tryGetNativeSet();
141
140
  })(ts || (ts = {}));
142
141
  /* @internal */
143
142
  var ts;
@@ -853,15 +852,18 @@ var ts;
853
852
  function insertSorted(array, insert, compare, allowDuplicates) {
854
853
  if (array.length === 0) {
855
854
  array.push(insert);
856
- return;
855
+ return true;
857
856
  }
858
857
  var insertIndex = binarySearch(array, insert, identity, compare);
859
858
  if (insertIndex < 0) {
860
859
  array.splice(~insertIndex, 0, insert);
860
+ return true;
861
861
  }
862
- else if (allowDuplicates) {
862
+ if (allowDuplicates) {
863
863
  array.splice(insertIndex, 0, insert);
864
+ return true;
864
865
  }
866
+ return false;
865
867
  }
866
868
  ts.insertSorted = insertSorted;
867
869
  function sortAndDeduplicate(array, comparer, equalityComparer) {
@@ -3541,6 +3543,8 @@ var ts;
3541
3543
  typeof performance.mark === "function" &&
3542
3544
  typeof performance.measure === "function" &&
3543
3545
  typeof performance.now === "function" &&
3546
+ typeof performance.clearMarks === "function" &&
3547
+ typeof performance.clearMeasures === "function" &&
3544
3548
  typeof PerformanceObserver === "function";
3545
3549
  }
3546
3550
  function tryGetWebPerformanceHooks() {
@@ -3585,7 +3589,9 @@ var ts;
3585
3589
  if (end === "__performance.measure-fix__") {
3586
3590
  nodePerformance_1.clearMarks("__performance.measure-fix__");
3587
3591
  }
3588
- }
3592
+ },
3593
+ clearMarks: function (name) { return nodePerformance_1.clearMarks(name); },
3594
+ clearMeasures: function (name) { return nodePerformance_1.clearMeasures(name); },
3589
3595
  };
3590
3596
  }
3591
3597
  return {
@@ -3718,6 +3724,30 @@ var ts;
3718
3724
  durations.forEach(function (duration, measureName) { return cb(measureName, duration); });
3719
3725
  }
3720
3726
  performance.forEachMeasure = forEachMeasure;
3727
+ function forEachMark(cb) {
3728
+ marks.forEach(function (_time, markName) { return cb(markName); });
3729
+ }
3730
+ performance.forEachMark = forEachMark;
3731
+ function clearMeasures(name) {
3732
+ if (name !== undefined)
3733
+ durations.delete(name);
3734
+ else
3735
+ durations.clear();
3736
+ performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.clearMeasures(name);
3737
+ }
3738
+ performance.clearMeasures = clearMeasures;
3739
+ function clearMarks(name) {
3740
+ if (name !== undefined) {
3741
+ counts.delete(name);
3742
+ marks.delete(name);
3743
+ }
3744
+ else {
3745
+ counts.clear();
3746
+ marks.clear();
3747
+ }
3748
+ performanceImpl === null || performanceImpl === void 0 ? void 0 : performanceImpl.clearMarks(name);
3749
+ }
3750
+ performance.clearMarks = clearMarks;
3721
3751
  /**
3722
3752
  * Indicates whether the performance API is enabled.
3723
3753
  */
@@ -7822,12 +7852,9 @@ var ts;
7822
7852
  * Normalize path separators, converting `\` into `/`.
7823
7853
  */
7824
7854
  function normalizeSlashes(path) {
7825
- var index = path.indexOf("\\");
7826
- if (index === -1) {
7827
- return path;
7828
- }
7829
- backslashRegExp.lastIndex = index; // prime regex with known position
7830
- return path.replace(backslashRegExp, ts.directorySeparator);
7855
+ return path.indexOf("\\") !== -1
7856
+ ? path.replace(backslashRegExp, ts.directorySeparator)
7857
+ : path;
7831
7858
  }
7832
7859
  ts.normalizeSlashes = normalizeSlashes;
7833
7860
  /**
@@ -9528,6 +9555,7 @@ var ts;
9528
9555
  Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_resolved: diag(6398, ts.DiagnosticCategory.Message, "Reusing_resolution_of_type_reference_directive_0_from_1_found_in_cache_from_location_2_it_was_not_re_6398", "Reusing resolution of type reference directive '{0}' from '{1}' found in cache from location '{2}', it was not resolved."),
9529
9556
  Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted: diag(6399, ts.DiagnosticCategory.Message, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitte_6399", "Project '{0}' is out of date because buildinfo file '{1}' indicates that some of the changes were not emitted"),
9530
9557
  Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files: diag(6400, ts.DiagnosticCategory.Message, "Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_fil_6400", "Project '{0}' is up to date but needs to update timestamps of output files that are older than input files"),
9558
+ Project_0_is_out_of_date_because_there_was_error_reading_file_1: diag(6401, ts.DiagnosticCategory.Message, "Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401", "Project '{0}' is out of date because there was error reading file '{1}'"),
9531
9559
  The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"),
9532
9560
  The_expected_type_comes_from_this_index_signature: diag(6501, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."),
9533
9561
  The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."),
@@ -19371,21 +19399,17 @@ var ts;
19371
19399
  return getStringFromExpandedCharCodes(expandedCharCodes);
19372
19400
  }
19373
19401
  ts.base64decode = base64decode;
19402
+ function readJsonOrUndefined(path, hostOrText) {
19403
+ var jsonText = ts.isString(hostOrText) ? hostOrText : hostOrText.readFile(path);
19404
+ if (!jsonText)
19405
+ return undefined;
19406
+ // gracefully handle if readFile fails or returns not JSON
19407
+ var result = ts.parseConfigFileTextToJson(path, jsonText);
19408
+ return !result.error ? result.config : undefined;
19409
+ }
19410
+ ts.readJsonOrUndefined = readJsonOrUndefined;
19374
19411
  function readJson(path, host) {
19375
- try {
19376
- var jsonText = host.readFile(path);
19377
- if (!jsonText)
19378
- return {};
19379
- var result = ts.parseConfigFileTextToJson(path, jsonText);
19380
- if (result.error) {
19381
- return {};
19382
- }
19383
- return result.config;
19384
- }
19385
- catch (e) {
19386
- // gracefully handle if readFile fails or returns not JSON
19387
- return {};
19388
- }
19412
+ return readJsonOrUndefined(path, host) || {};
19389
19413
  }
19390
19414
  ts.readJson = readJson;
19391
19415
  function directoryProbablyExists(directoryName, host) {
@@ -27736,9 +27760,10 @@ var ts;
27736
27760
  };
27737
27761
  var buildInfo_1;
27738
27762
  var getAndCacheBuildInfo_1 = function (getText) {
27763
+ var _a;
27739
27764
  if (buildInfo_1 === undefined) {
27740
27765
  var result = getText();
27741
- buildInfo_1 = result !== undefined ? ts.getBuildInfo(result) : false;
27766
+ buildInfo_1 = result !== undefined ? (_a = ts.getBuildInfo(node.buildInfoPath, result)) !== null && _a !== void 0 ? _a : false : false;
27742
27767
  }
27743
27768
  return buildInfo_1 || undefined;
27744
27769
  };
@@ -45798,6 +45823,9 @@ var ts;
45798
45823
  case 203 /* BindingElement */:
45799
45824
  bindBindingElementFlow(node);
45800
45825
  break;
45826
+ case 164 /* Parameter */:
45827
+ bindParameterFlow(node);
45828
+ break;
45801
45829
  case 205 /* ObjectLiteralExpression */:
45802
45830
  case 204 /* ArrayLiteralExpression */:
45803
45831
  case 296 /* PropertyAssignment */:
@@ -46538,20 +46566,38 @@ var ts;
46538
46566
  }
46539
46567
  }
46540
46568
  function bindBindingElementFlow(node) {
46541
- if (ts.isBindingPattern(node.name)) {
46542
- // When evaluating a binding pattern, the initializer is evaluated before the binding pattern, per:
46543
- // - https://tc39.es/ecma262/#sec-destructuring-binding-patterns-runtime-semantics-iteratorbindinginitialization
46544
- // - `BindingElement: BindingPattern Initializer?`
46545
- // - https://tc39.es/ecma262/#sec-runtime-semantics-keyedbindinginitialization
46546
- // - `BindingElement: BindingPattern Initializer?`
46547
- bind(node.dotDotDotToken);
46548
- bind(node.propertyName);
46549
- bind(node.initializer);
46550
- bind(node.name);
46569
+ // When evaluating a binding pattern, the initializer is evaluated before the binding pattern, per:
46570
+ // - https://tc39.es/ecma262/#sec-destructuring-binding-patterns-runtime-semantics-iteratorbindinginitialization
46571
+ // - `BindingElement: BindingPattern Initializer?`
46572
+ // - https://tc39.es/ecma262/#sec-runtime-semantics-keyedbindinginitialization
46573
+ // - `BindingElement: BindingPattern Initializer?`
46574
+ bind(node.dotDotDotToken);
46575
+ bind(node.propertyName);
46576
+ bindInitializer(node.initializer);
46577
+ bind(node.name);
46578
+ }
46579
+ function bindParameterFlow(node) {
46580
+ bindEach(node.modifiers);
46581
+ bind(node.dotDotDotToken);
46582
+ bind(node.questionToken);
46583
+ bind(node.type);
46584
+ bindInitializer(node.initializer);
46585
+ bind(node.name);
46586
+ }
46587
+ // a BindingElement/Parameter does not have side effects if initializers are not evaluated and used. (see GH#49759)
46588
+ function bindInitializer(node) {
46589
+ if (!node) {
46590
+ return;
46551
46591
  }
46552
- else {
46553
- bindEachChild(node);
46592
+ var entryFlow = currentFlow;
46593
+ bind(node);
46594
+ if (entryFlow === unreachableFlow || entryFlow === currentFlow) {
46595
+ return;
46554
46596
  }
46597
+ var exitFlow = createBranchLabel();
46598
+ addAntecedent(exitFlow, entryFlow);
46599
+ addAntecedent(exitFlow, currentFlow);
46600
+ currentFlow = finishFlowLabel(exitFlow);
46555
46601
  }
46556
46602
  function bindJSDocTypeAlias(node) {
46557
46603
  bind(node.tagName);
@@ -49722,7 +49768,7 @@ var ts;
49722
49768
  if (unidirectional === void 0) { unidirectional = false; }
49723
49769
  source.forEach(function (sourceSymbol, id) {
49724
49770
  var targetSymbol = target.get(id);
49725
- target.set(id, targetSymbol ? mergeSymbol(targetSymbol, sourceSymbol, unidirectional) : sourceSymbol);
49771
+ target.set(id, targetSymbol ? mergeSymbol(targetSymbol, sourceSymbol, unidirectional) : getMergedSymbol(sourceSymbol));
49726
49772
  });
49727
49773
  }
49728
49774
  function mergeModuleAugmentation(moduleName) {
@@ -56513,11 +56559,9 @@ var ts;
56513
56559
  return getReturnTypeOfSignature(getterSignature);
56514
56560
  }
56515
56561
  }
56516
- if (ts.isInJSFile(declaration)) {
56517
- var type_1 = getParameterTypeOfTypeTag(func, declaration);
56518
- if (type_1)
56519
- return type_1;
56520
- }
56562
+ var parameterTypeOfTypeTag = getParameterTypeOfTypeTag(func, declaration);
56563
+ if (parameterTypeOfTypeTag)
56564
+ return parameterTypeOfTypeTag;
56521
56565
  // Use contextual parameter type if one is available
56522
56566
  var type = declaration.symbol.escapedName === "this" /* This */ ? getContextualThisParameterType(func) : getContextuallyTypedParameterType(declaration);
56523
56567
  if (type) {
@@ -57093,9 +57137,9 @@ var ts;
57093
57137
  if (typeNode === undefined) {
57094
57138
  return useUnknownInCatchVariables ? unknownType : anyType;
57095
57139
  }
57096
- var type_2 = getTypeOfNode(typeNode);
57140
+ var type_1 = getTypeOfNode(typeNode);
57097
57141
  // an errorType will make `checkTryStatement` issue an error
57098
- return isTypeAny(type_2) || type_2 === unknownType ? type_2 : errorType;
57142
+ return isTypeAny(type_1) || type_1 === unknownType ? type_1 : errorType;
57099
57143
  }
57100
57144
  // Handle export default expressions
57101
57145
  if (ts.isSourceFile(declaration) && ts.isJsonSourceFile(declaration)) {
@@ -57305,11 +57349,11 @@ var ts;
57305
57349
  return errorType;
57306
57350
  }
57307
57351
  var exportEquals = getMergedSymbol(symbol.exports.get("export=" /* ExportEquals */));
57308
- var type_3 = getWidenedTypeForAssignmentDeclaration(exportEquals, exportEquals === resolvedModule ? undefined : resolvedModule);
57352
+ var type_2 = getWidenedTypeForAssignmentDeclaration(exportEquals, exportEquals === resolvedModule ? undefined : resolvedModule);
57309
57353
  if (!popTypeResolution()) {
57310
57354
  return reportCircularityError(symbol);
57311
57355
  }
57312
- return type_3;
57356
+ return type_2;
57313
57357
  }
57314
57358
  }
57315
57359
  var type = createObjectType(16 /* Anonymous */, symbol);
@@ -59532,10 +59576,10 @@ var ts;
59532
59576
  var baseTypes = [];
59533
59577
  var different = false;
59534
59578
  for (var _i = 0, types_7 = types; _i < types_7.length; _i++) {
59535
- var type_4 = types_7[_i];
59536
- var baseType = getBaseConstraint(type_4);
59579
+ var type_3 = types_7[_i];
59580
+ var baseType = getBaseConstraint(type_3);
59537
59581
  if (baseType) {
59538
- if (baseType !== type_4) {
59582
+ if (baseType !== type_3) {
59539
59583
  different = true;
59540
59584
  }
59541
59585
  baseTypes.push(baseType);
@@ -60326,7 +60370,12 @@ var ts;
60326
60370
  continue;
60327
60371
  }
60328
60372
  }
60329
- result.push(getSignatureFromDeclaration(decl));
60373
+ // If this is a function or method declaration, get the signature from the @type tag for the sake of optional parameters.
60374
+ // Exclude contextually-typed kinds because we already apply the @type tag to the context, plus applying it here to the initializer would supress checks that the two are compatible.
60375
+ result.push((!ts.isFunctionExpressionOrArrowFunction(decl) &&
60376
+ !ts.isObjectLiteralMethod(decl) &&
60377
+ getSignatureOfTypeTag(decl)) ||
60378
+ getSignatureFromDeclaration(decl));
60330
60379
  }
60331
60380
  return result;
60332
60381
  }
@@ -60357,7 +60406,7 @@ var ts;
60357
60406
  else {
60358
60407
  var type = signature.declaration && ts.getEffectiveReturnTypeNode(signature.declaration);
60359
60408
  var jsdocPredicate = void 0;
60360
- if (!type && ts.isInJSFile(signature.declaration)) {
60409
+ if (!type) {
60361
60410
  var jsdocSignature = getSignatureOfTypeTag(signature.declaration);
60362
60411
  if (jsdocSignature && signature !== jsdocSignature) {
60363
60412
  jsdocPredicate = getTypePredicateOfSignature(jsdocSignature);
@@ -64383,15 +64432,14 @@ var ts;
64383
64432
  return false;
64384
64433
  }
64385
64434
  function isContextSensitiveFunctionLikeDeclaration(node) {
64386
- return (!ts.isFunctionDeclaration(node) || ts.isInJSFile(node) && !!getTypeForDeclarationFromJSDocComment(node)) &&
64387
- (ts.hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node));
64435
+ return ts.hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node);
64388
64436
  }
64389
64437
  function hasContextSensitiveReturnExpression(node) {
64390
64438
  // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value.
64391
64439
  return !node.typeParameters && !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 235 /* Block */ && isContextSensitive(node.body);
64392
64440
  }
64393
64441
  function isContextSensitiveFunctionOrObjectLiteralMethod(func) {
64394
- return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || ts.isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) &&
64442
+ return (ts.isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) &&
64395
64443
  isContextSensitiveFunctionLikeDeclaration(func);
64396
64444
  }
64397
64445
  function getTypeWithoutSignatures(type) {
@@ -73449,9 +73497,11 @@ var ts;
73449
73497
  case 1 /* ExportsProperty */:
73450
73498
  case 6 /* Prototype */:
73451
73499
  case 3 /* PrototypeProperty */:
73452
- var valueDeclaration = (_a = binaryExpression.left.symbol) === null || _a === void 0 ? void 0 : _a.valueDeclaration;
73453
- // falls through
73454
73500
  case 2 /* ModuleExports */:
73501
+ var valueDeclaration = void 0;
73502
+ if (kind !== 2 /* ModuleExports */) {
73503
+ valueDeclaration = (_a = binaryExpression.left.symbol) === null || _a === void 0 ? void 0 : _a.valueDeclaration;
73504
+ }
73455
73505
  valueDeclaration || (valueDeclaration = (_b = binaryExpression.symbol) === null || _b === void 0 ? void 0 : _b.valueDeclaration);
73456
73506
  var annotated = valueDeclaration && ts.getEffectiveTypeAnnotationNode(valueDeclaration);
73457
73507
  return annotated ? getTypeFromTypeNode(annotated) : undefined;
@@ -73929,9 +73979,16 @@ var ts;
73929
73979
  if (!isErrorType(intrinsicClassAttribs)) {
73930
73980
  var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol);
73931
73981
  var hostClassType = getReturnTypeOfSignature(sig);
73932
- apparentAttributesType = intersectTypes(typeParams
73933
- ? createTypeReference(intrinsicClassAttribs, fillMissingTypeArguments([hostClassType], typeParams, getMinTypeArgumentCount(typeParams), ts.isInJSFile(context)))
73934
- : intrinsicClassAttribs, apparentAttributesType);
73982
+ var libraryManagedAttributeType = void 0;
73983
+ if (typeParams) {
73984
+ // apply JSX.IntrinsicClassElements<hostClassType, ...>
73985
+ var inferredArgs = fillMissingTypeArguments([hostClassType], typeParams, getMinTypeArgumentCount(typeParams), ts.isInJSFile(context));
73986
+ libraryManagedAttributeType = instantiateType(intrinsicClassAttribs, createTypeMapper(typeParams, inferredArgs));
73987
+ }
73988
+ // or JSX.IntrinsicClassElements has no generics.
73989
+ else
73990
+ libraryManagedAttributeType = intrinsicClassAttribs;
73991
+ apparentAttributesType = intersectTypes(libraryManagedAttributeType, apparentAttributesType);
73935
73992
  }
73936
73993
  var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context);
73937
73994
  if (!isErrorType(intrinsicAttribs)) {
@@ -77758,12 +77815,15 @@ var ts;
77758
77815
  return false;
77759
77816
  }
77760
77817
  var func = ts.isFunctionDeclaration(node) || ts.isFunctionExpression(node) ? node :
77761
- ts.isVariableDeclaration(node) && node.initializer && ts.isFunctionExpression(node.initializer) ? node.initializer :
77818
+ (ts.isVariableDeclaration(node) || ts.isPropertyAssignment(node)) && node.initializer && ts.isFunctionExpression(node.initializer) ? node.initializer :
77762
77819
  undefined;
77763
77820
  if (func) {
77764
- // If the node has a @class tag, treat it like a constructor.
77821
+ // If the node has a @class or @constructor tag, treat it like a constructor.
77765
77822
  if (ts.getJSDocClassTag(node))
77766
77823
  return true;
77824
+ // If the node is a property of an object literal.
77825
+ if (ts.isPropertyAssignment(ts.walkUpParenthesizedExpressions(func.parent)))
77826
+ return false;
77767
77827
  // If the symbol of the node has members, treat it like a constructor.
77768
77828
  var symbol = getSymbolOfNode(func);
77769
77829
  return !!((_a = symbol === null || symbol === void 0 ? void 0 : symbol.members) === null || _a === void 0 ? void 0 : _a.size);
@@ -78011,8 +78071,8 @@ var ts;
78011
78071
  if (hasDefaultOnly && type && !isErrorType(type)) {
78012
78072
  var synthType = type;
78013
78073
  if (!synthType.defaultOnlyType) {
78014
- var type_5 = createDefaultPropertyWrapperForModule(symbol, originalSymbol);
78015
- synthType.defaultOnlyType = type_5;
78074
+ var type_4 = createDefaultPropertyWrapperForModule(symbol, originalSymbol);
78075
+ synthType.defaultOnlyType = type_4;
78016
78076
  }
78017
78077
  return synthType.defaultOnlyType;
78018
78078
  }
@@ -87349,6 +87409,12 @@ var ts;
87349
87409
  return resolveJSDocMemberName(name, /*ignoreErrors*/ false, getSymbolOfNode(container));
87350
87410
  }
87351
87411
  }
87412
+ if (result && isJSDoc_1) {
87413
+ var container = ts.getJSDocHost(name);
87414
+ if (container && ts.isEnumMember(container) && container === result.valueDeclaration) {
87415
+ return resolveEntityName(name, meaning, /*ignoreErrors*/ true, /* dontResolveAlias */ true, ts.getSourceFileOfNode(container)) || result;
87416
+ }
87417
+ }
87352
87418
  return result;
87353
87419
  }
87354
87420
  else if (ts.isPrivateIdentifier(name)) {
@@ -107510,6 +107576,13 @@ var ts;
107510
107576
  ts.Debug.assert(importVariableName !== undefined);
107511
107577
  // save import into the local
107512
107578
  statements.push(factory.createExpressionStatement(factory.createAssignment(importVariableName, parameterName)));
107579
+ if (ts.hasSyntacticModifier(entry, 1 /* Export */)) {
107580
+ statements.push(factory.createExpressionStatement(factory.createCallExpression(exportFunction,
107581
+ /*typeArguments*/ undefined, [
107582
+ factory.createStringLiteral(ts.idText(importVariableName)),
107583
+ parameterName,
107584
+ ])));
107585
+ }
107513
107586
  break;
107514
107587
  case 272 /* ExportDeclaration */:
107515
107588
  ts.Debug.assert(importVariableName !== undefined);
@@ -110352,8 +110425,12 @@ var ts;
110352
110425
  }
110353
110426
  var previousNeedsDeclare = needsDeclare;
110354
110427
  switch (input.kind) {
110355
- case 259 /* TypeAliasDeclaration */: // Type aliases get `declare`d if need be (for legacy support), but that's all
110356
- return cleanup(factory.updateTypeAliasDeclaration(input, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode)));
110428
+ case 259 /* TypeAliasDeclaration */: {
110429
+ needsDeclare = false;
110430
+ var clean = cleanup(factory.updateTypeAliasDeclaration(input, ensureModifiers(input), input.name, ts.visitNodes(input.typeParameters, visitDeclarationSubtree, ts.isTypeParameterDeclaration), ts.visitNode(input.type, visitDeclarationSubtree, ts.isTypeNode)));
110431
+ needsDeclare = previousNeedsDeclare;
110432
+ return clean;
110433
+ }
110357
110434
  case 258 /* InterfaceDeclaration */: {
110358
110435
  return cleanup(factory.updateInterfaceDeclaration(input, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree)));
110359
110436
  }
@@ -111857,8 +111934,8 @@ var ts;
111857
111934
  }
111858
111935
  ts.getBuildInfoText = getBuildInfoText;
111859
111936
  /*@internal*/
111860
- function getBuildInfo(buildInfoText) {
111861
- return JSON.parse(buildInfoText);
111937
+ function getBuildInfo(buildInfoFile, buildInfoText) {
111938
+ return ts.readJsonOrUndefined(buildInfoFile, buildInfoText);
111862
111939
  }
111863
111940
  ts.getBuildInfo = getBuildInfo;
111864
111941
  /*@internal*/
@@ -111936,17 +112013,16 @@ var ts;
111936
112013
  var buildInfo;
111937
112014
  if (host.getBuildInfo) {
111938
112015
  // If host directly provides buildinfo we can get it directly. This allows host to cache the buildinfo
111939
- var hostBuildInfo = host.getBuildInfo(buildInfoPath, config.options.configFilePath);
111940
- if (!hostBuildInfo)
111941
- return buildInfoPath;
111942
- buildInfo = hostBuildInfo;
112016
+ buildInfo = host.getBuildInfo(buildInfoPath, config.options.configFilePath);
111943
112017
  }
111944
112018
  else {
111945
112019
  var buildInfoText = host.readFile(buildInfoPath);
111946
112020
  if (!buildInfoText)
111947
112021
  return buildInfoPath;
111948
- buildInfo = getBuildInfo(buildInfoText);
112022
+ buildInfo = getBuildInfo(buildInfoPath, buildInfoText);
111949
112023
  }
112024
+ if (!buildInfo)
112025
+ return buildInfoPath;
111950
112026
  if (!buildInfo.bundle || !buildInfo.bundle.js || (declarationFilePath && !buildInfo.bundle.dts))
111951
112027
  return buildInfoPath;
111952
112028
  var jsFileText = host.readFile(ts.Debug.checkDefined(jsFilePath));
@@ -116604,7 +116680,16 @@ var ts;
116604
116680
  return cachedReadDirectoryResult.get(ts.ensureTrailingDirectorySeparator(rootDirPath));
116605
116681
  }
116606
116682
  function getCachedFileSystemEntriesForBaseDir(path) {
116607
- return getCachedFileSystemEntries(ts.getDirectoryPath(path));
116683
+ var entries = getCachedFileSystemEntries(ts.getDirectoryPath(path));
116684
+ if (!entries) {
116685
+ return entries;
116686
+ }
116687
+ // If we're looking for the base directory, we're definitely going to search the entries
116688
+ if (!entries.sortedAndCanonicalizedFiles) {
116689
+ entries.sortedAndCanonicalizedFiles = entries.files.map(getCanonicalFileName).sort();
116690
+ entries.sortedAndCanonicalizedDirectories = entries.directories.map(getCanonicalFileName).sort();
116691
+ }
116692
+ return entries;
116608
116693
  }
116609
116694
  function getBaseNameOfFileName(fileName) {
116610
116695
  return ts.getBaseFileName(ts.normalizePath(fileName));
@@ -116647,21 +116732,10 @@ var ts;
116647
116732
  return undefined;
116648
116733
  }
116649
116734
  }
116650
- function fileNameEqual(name1, name2) {
116651
- return getCanonicalFileName(name1) === getCanonicalFileName(name2);
116652
- }
116653
116735
  function hasEntry(entries, name) {
116654
- return ts.some(entries, function (file) { return fileNameEqual(file, name); });
116655
- }
116656
- function updateFileSystemEntry(entries, baseName, isValid) {
116657
- if (hasEntry(entries, baseName)) {
116658
- if (!isValid) {
116659
- return ts.filterMutate(entries, function (entry) { return !fileNameEqual(entry, baseName); });
116660
- }
116661
- }
116662
- else if (isValid) {
116663
- return entries.push(baseName);
116664
- }
116736
+ // Case-sensitive comparison since already canonicalized
116737
+ var index = ts.binarySearch(entries, name, ts.identity, ts.compareStringsCaseSensitive);
116738
+ return index >= 0;
116665
116739
  }
116666
116740
  function writeFile(fileName, data, writeByteOrderMark) {
116667
116741
  var path = toPath(fileName);
@@ -116674,7 +116748,7 @@ var ts;
116674
116748
  function fileExists(fileName) {
116675
116749
  var path = toPath(fileName);
116676
116750
  var result = getCachedFileSystemEntriesForBaseDir(path);
116677
- return result && hasEntry(result.files, getBaseNameOfFileName(fileName)) ||
116751
+ return result && hasEntry(result.sortedAndCanonicalizedFiles, getCanonicalFileName(getBaseNameOfFileName(fileName))) ||
116678
116752
  host.fileExists(fileName);
116679
116753
  }
116680
116754
  function directoryExists(dirPath) {
@@ -116684,9 +116758,14 @@ var ts;
116684
116758
  function createDirectory(dirPath) {
116685
116759
  var path = toPath(dirPath);
116686
116760
  var result = getCachedFileSystemEntriesForBaseDir(path);
116687
- var baseFileName = getBaseNameOfFileName(dirPath);
116688
116761
  if (result) {
116689
- updateFileSystemEntry(result.directories, baseFileName, /*isValid*/ true);
116762
+ var baseName = getBaseNameOfFileName(dirPath);
116763
+ var canonicalizedBaseName = getCanonicalFileName(baseName);
116764
+ var canonicalizedDirectories = result.sortedAndCanonicalizedDirectories;
116765
+ // Case-sensitive comparison since already canonicalized
116766
+ if (ts.insertSorted(canonicalizedDirectories, canonicalizedBaseName, ts.compareStringsCaseSensitive)) {
116767
+ result.directories.push(baseName);
116768
+ }
116690
116769
  }
116691
116770
  host.createDirectory(dirPath);
116692
116771
  }
@@ -116755,7 +116834,7 @@ var ts;
116755
116834
  fileExists: host.fileExists(fileOrDirectoryPath),
116756
116835
  directoryExists: host.directoryExists(fileOrDirectoryPath)
116757
116836
  };
116758
- if (fsQueryResult.directoryExists || hasEntry(parentResult.directories, baseName)) {
116837
+ if (fsQueryResult.directoryExists || hasEntry(parentResult.sortedAndCanonicalizedDirectories, getCanonicalFileName(baseName))) {
116759
116838
  // Folder added or removed, clear the cache instead of updating the folder and its structure
116760
116839
  clearCache();
116761
116840
  }
@@ -116775,7 +116854,23 @@ var ts;
116775
116854
  }
116776
116855
  }
116777
116856
  function updateFilesOfFileSystemEntry(parentResult, baseName, fileExists) {
116778
- updateFileSystemEntry(parentResult.files, baseName, fileExists);
116857
+ var canonicalizedFiles = parentResult.sortedAndCanonicalizedFiles;
116858
+ var canonicalizedBaseName = getCanonicalFileName(baseName);
116859
+ if (fileExists) {
116860
+ // Case-sensitive comparison since already canonicalized
116861
+ if (ts.insertSorted(canonicalizedFiles, canonicalizedBaseName, ts.compareStringsCaseSensitive)) {
116862
+ parentResult.files.push(baseName);
116863
+ }
116864
+ }
116865
+ else {
116866
+ // Case-sensitive comparison since already canonicalized
116867
+ var sortedIndex = ts.binarySearch(canonicalizedFiles, canonicalizedBaseName, ts.identity, ts.compareStringsCaseSensitive);
116868
+ if (sortedIndex >= 0) {
116869
+ canonicalizedFiles.splice(sortedIndex, 1);
116870
+ var unsortedIndex = parentResult.files.findIndex(function (entry) { return getCanonicalFileName(entry) === canonicalizedBaseName; });
116871
+ parentResult.files.splice(unsortedIndex, 1);
116872
+ }
116873
+ }
116779
116874
  }
116780
116875
  function clearCache() {
116781
116876
  cachedReadDirectoryResult.clear();
@@ -125013,18 +125108,14 @@ var ts;
125013
125108
  if (host.getBuildInfo) {
125014
125109
  // host provides buildinfo, get it from there. This allows host to cache it
125015
125110
  buildInfo = host.getBuildInfo(buildInfoPath, compilerOptions.configFilePath);
125016
- if (!buildInfo)
125017
- return undefined;
125018
125111
  }
125019
125112
  else {
125020
125113
  var content = host.readFile(buildInfoPath);
125021
125114
  if (!content)
125022
125115
  return undefined;
125023
- buildInfo = ts.getBuildInfo(content);
125116
+ buildInfo = ts.getBuildInfo(buildInfoPath, content);
125024
125117
  }
125025
- if (buildInfo.version !== ts.version)
125026
- return undefined;
125027
- if (!buildInfo.program)
125118
+ if (!buildInfo || buildInfo.version !== ts.version || !buildInfo.program)
125028
125119
  return undefined;
125029
125120
  return ts.createBuilderProgramUsingProgramBuildInfo(buildInfo.program, buildInfoPath, host);
125030
125121
  }
@@ -125246,7 +125337,8 @@ var ts;
125246
125337
  }
125247
125338
  // All resolutions are invalid if user provided resolutions
125248
125339
  var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution);
125249
- if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
125340
+ var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
125341
+ if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
125250
125342
  if (hasChangedConfigFileParsingErrors) {
125251
125343
  if (reportFileChangeDetectedOnCreateProgram) {
125252
125344
  reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
@@ -125265,6 +125357,11 @@ var ts;
125265
125357
  if (host.afterProgramCreate && program !== builderProgram) {
125266
125358
  host.afterProgramCreate(builderProgram);
125267
125359
  }
125360
+ compilerHost.readFile = originalReadFile;
125361
+ compilerHost.fileExists = originalFileExists;
125362
+ compilerHost.directoryExists = originalDirectoryExists;
125363
+ compilerHost.createDirectory = originalCreateDirectory;
125364
+ compilerHost.writeFile = originalWriteFile;
125268
125365
  return builderProgram;
125269
125366
  }
125270
125367
  function createNewProgram(hasInvalidatedResolution) {
@@ -125742,19 +125839,20 @@ var ts;
125742
125839
  */
125743
125840
  UpToDateStatusType[UpToDateStatusType["OutOfDateWithPrepend"] = 3] = "OutOfDateWithPrepend";
125744
125841
  UpToDateStatusType[UpToDateStatusType["OutputMissing"] = 4] = "OutputMissing";
125745
- UpToDateStatusType[UpToDateStatusType["OutOfDateWithSelf"] = 5] = "OutOfDateWithSelf";
125746
- UpToDateStatusType[UpToDateStatusType["OutOfDateWithUpstream"] = 6] = "OutOfDateWithUpstream";
125747
- UpToDateStatusType[UpToDateStatusType["OutOfDateBuildInfo"] = 7] = "OutOfDateBuildInfo";
125748
- UpToDateStatusType[UpToDateStatusType["UpstreamOutOfDate"] = 8] = "UpstreamOutOfDate";
125749
- UpToDateStatusType[UpToDateStatusType["UpstreamBlocked"] = 9] = "UpstreamBlocked";
125750
- UpToDateStatusType[UpToDateStatusType["ComputingUpstream"] = 10] = "ComputingUpstream";
125751
- UpToDateStatusType[UpToDateStatusType["TsVersionOutputOfDate"] = 11] = "TsVersionOutputOfDate";
125752
- UpToDateStatusType[UpToDateStatusType["UpToDateWithInputFileText"] = 12] = "UpToDateWithInputFileText";
125842
+ UpToDateStatusType[UpToDateStatusType["ErrorReadingFile"] = 5] = "ErrorReadingFile";
125843
+ UpToDateStatusType[UpToDateStatusType["OutOfDateWithSelf"] = 6] = "OutOfDateWithSelf";
125844
+ UpToDateStatusType[UpToDateStatusType["OutOfDateWithUpstream"] = 7] = "OutOfDateWithUpstream";
125845
+ UpToDateStatusType[UpToDateStatusType["OutOfDateBuildInfo"] = 8] = "OutOfDateBuildInfo";
125846
+ UpToDateStatusType[UpToDateStatusType["UpstreamOutOfDate"] = 9] = "UpstreamOutOfDate";
125847
+ UpToDateStatusType[UpToDateStatusType["UpstreamBlocked"] = 10] = "UpstreamBlocked";
125848
+ UpToDateStatusType[UpToDateStatusType["ComputingUpstream"] = 11] = "ComputingUpstream";
125849
+ UpToDateStatusType[UpToDateStatusType["TsVersionOutputOfDate"] = 12] = "TsVersionOutputOfDate";
125850
+ UpToDateStatusType[UpToDateStatusType["UpToDateWithInputFileText"] = 13] = "UpToDateWithInputFileText";
125753
125851
  /**
125754
125852
  * Projects with no outputs (i.e. "solution" files)
125755
125853
  */
125756
- UpToDateStatusType[UpToDateStatusType["ContainerOnly"] = 13] = "ContainerOnly";
125757
- UpToDateStatusType[UpToDateStatusType["ForceBuild"] = 14] = "ForceBuild";
125854
+ UpToDateStatusType[UpToDateStatusType["ContainerOnly"] = 14] = "ContainerOnly";
125855
+ UpToDateStatusType[UpToDateStatusType["ForceBuild"] = 15] = "ForceBuild";
125758
125856
  })(UpToDateStatusType = ts.UpToDateStatusType || (ts.UpToDateStatusType = {}));
125759
125857
  function resolveConfigFileProjectName(project) {
125760
125858
  if (ts.fileExtensionIs(project, ".json" /* Json */)) {
@@ -125972,6 +126070,7 @@ var ts;
125972
126070
  if (value) {
125973
126071
  return isParsedCommandLine(value) ? value : undefined;
125974
126072
  }
126073
+ ts.performance.mark("SolutionBuilder::beforeConfigFileParsing");
125975
126074
  var diagnostic;
125976
126075
  var parseConfigFileHost = state.parseConfigFileHost, baseCompilerOptions = state.baseCompilerOptions, baseWatchOptions = state.baseWatchOptions, extendedConfigCache = state.extendedConfigCache, host = state.host;
125977
126076
  var parsed;
@@ -125986,6 +126085,8 @@ var ts;
125986
126085
  parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = ts.noop;
125987
126086
  }
125988
126087
  configFileCache.set(configFilePath, parsed || diagnostic);
126088
+ ts.performance.mark("SolutionBuilder::afterConfigFileParsing");
126089
+ ts.performance.measure("SolutionBuilder::Config file parsing", "SolutionBuilder::beforeConfigFileParsing", "SolutionBuilder::afterConfigFileParsing");
125989
126090
  return parsed;
125990
126091
  }
125991
126092
  function resolveProjectName(state, name) {
@@ -126185,6 +126286,7 @@ var ts;
126185
126286
  if (updateOutputFileStampsPending) {
126186
126287
  updateOutputTimestamps(state, config, projectPath);
126187
126288
  }
126289
+ ts.performance.mark("SolutionBuilder::Timestamps only updates");
126188
126290
  return doneInvalidatedProject(state, projectPath);
126189
126291
  }
126190
126292
  };
@@ -126278,6 +126380,10 @@ var ts;
126278
126380
  };
126279
126381
  function done(cancellationToken, writeFile, customTransformers) {
126280
126382
  executeSteps(BuildStep.Done, cancellationToken, writeFile, customTransformers);
126383
+ if (kind === InvalidatedProjectKind.Build)
126384
+ ts.performance.mark("SolutionBuilder::Projects built");
126385
+ else
126386
+ ts.performance.mark("SolutionBuilder::Bundles updated");
126281
126387
  return doneInvalidatedProject(state, projectPath);
126282
126388
  }
126283
126389
  function withProgramOrUndefined(action) {
@@ -126456,13 +126562,13 @@ var ts;
126456
126562
  var emitterDiagnostics = ts.createDiagnosticCollection();
126457
126563
  var emittedOutputs = new ts.Map();
126458
126564
  var resultFlags = BuildResultFlags.DeclarationOutputUnchanged;
126459
- var existingBuildInfo = state.buildInfoCache.get(projectPath).buildInfo;
126565
+ var existingBuildInfo = state.buildInfoCache.get(projectPath).buildInfo || undefined;
126460
126566
  outputFiles.forEach(function (_a) {
126461
126567
  var _b, _c;
126462
126568
  var name = _a.name, text = _a.text, writeByteOrderMark = _a.writeByteOrderMark, buildInfo = _a.buildInfo;
126463
126569
  emittedOutputs.set(toPath(state, name), name);
126464
126570
  if (buildInfo) {
126465
- if (((_b = buildInfo.program) === null || _b === void 0 ? void 0 : _b.outSignature) !== ((_c = existingBuildInfo.program) === null || _c === void 0 ? void 0 : _c.outSignature)) {
126571
+ if (((_b = buildInfo.program) === null || _b === void 0 ? void 0 : _b.outSignature) !== ((_c = existingBuildInfo === null || existingBuildInfo === void 0 ? void 0 : existingBuildInfo.program) === null || _c === void 0 ? void 0 : _c.outSignature)) {
126466
126572
  resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;
126467
126573
  }
126468
126574
  setBuildInfo(state, buildInfo, projectPath, config.options, resultFlags);
@@ -126755,8 +126861,7 @@ var ts;
126755
126861
  return existing.buildInfo || undefined;
126756
126862
  }
126757
126863
  var value = state.readFileWithCache(buildInfoPath);
126758
- var buildInfo = value ? ts.getBuildInfo(value) : undefined;
126759
- ts.Debug.assert(modifiedTime || !buildInfo);
126864
+ var buildInfo = value ? ts.getBuildInfo(buildInfoPath, value) : undefined;
126760
126865
  state.buildInfoCache.set(resolvedConfigPath, { path: path, buildInfo: buildInfo || false, modifiedTime: modifiedTime || ts.missingFileModifiedTime });
126761
126866
  return buildInfo;
126762
126867
  }
@@ -126841,7 +126946,14 @@ var ts;
126841
126946
  missingOutputFileName: buildInfoPath
126842
126947
  };
126843
126948
  }
126844
- var buildInfo = ts.Debug.checkDefined(getBuildInfo(state, buildInfoPath, resolvedPath, buildInfoTime));
126949
+ var buildInfo = getBuildInfo(state, buildInfoPath, resolvedPath, buildInfoTime);
126950
+ if (!buildInfo) {
126951
+ // Error reading buildInfo
126952
+ return {
126953
+ type: ts.UpToDateStatusType.ErrorReadingFile,
126954
+ fileName: buildInfoPath
126955
+ };
126956
+ }
126845
126957
  if ((buildInfo.bundle || buildInfo.program) && buildInfo.version !== ts.version) {
126846
126958
  return {
126847
126959
  type: ts.UpToDateStatusType.TsVersionOutputOfDate,
@@ -127044,7 +127156,10 @@ var ts;
127044
127156
  if (prior !== undefined) {
127045
127157
  return prior;
127046
127158
  }
127159
+ ts.performance.mark("SolutionBuilder::beforeUpToDateCheck");
127047
127160
  var actual = getUpToDateStatusWorker(state, project, resolvedPath);
127161
+ ts.performance.mark("SolutionBuilder::afterUpToDateCheck");
127162
+ ts.performance.measure("SolutionBuilder::Up-to-date check", "SolutionBuilder::beforeUpToDateCheck", "SolutionBuilder::afterUpToDateCheck");
127048
127163
  state.projectStatus.set(resolvedPath, actual);
127049
127164
  return actual;
127050
127165
  }
@@ -127182,6 +127297,13 @@ var ts;
127182
127297
  }
127183
127298
  }
127184
127299
  function build(state, project, cancellationToken, writeFile, getCustomTransformers, onlyReferences) {
127300
+ ts.performance.mark("SolutionBuilder::beforeBuild");
127301
+ var result = buildWorker(state, project, cancellationToken, writeFile, getCustomTransformers, onlyReferences);
127302
+ ts.performance.mark("SolutionBuilder::afterBuild");
127303
+ ts.performance.measure("SolutionBuilder::Build", "SolutionBuilder::beforeBuild", "SolutionBuilder::afterBuild");
127304
+ return result;
127305
+ }
127306
+ function buildWorker(state, project, cancellationToken, writeFile, getCustomTransformers, onlyReferences) {
127185
127307
  var buildOrder = getBuildOrderFor(state, project, onlyReferences);
127186
127308
  if (!buildOrder)
127187
127309
  return ts.ExitStatus.InvalidProject_OutputsSkipped;
@@ -127209,6 +127331,13 @@ var ts;
127209
127331
  : ts.ExitStatus.DiagnosticsPresent_OutputsSkipped;
127210
127332
  }
127211
127333
  function clean(state, project, onlyReferences) {
127334
+ ts.performance.mark("SolutionBuilder::beforeClean");
127335
+ var result = cleanWorker(state, project, onlyReferences);
127336
+ ts.performance.mark("SolutionBuilder::afterClean");
127337
+ ts.performance.measure("SolutionBuilder::Clean", "SolutionBuilder::beforeClean", "SolutionBuilder::afterClean");
127338
+ return result;
127339
+ }
127340
+ function cleanWorker(state, project, onlyReferences) {
127212
127341
  var buildOrder = getBuildOrderFor(state, project, onlyReferences);
127213
127342
  if (!buildOrder)
127214
127343
  return ts.ExitStatus.InvalidProject_OutputsSkipped;
@@ -127282,6 +127411,14 @@ var ts;
127282
127411
  state.timerToBuildInvalidatedProject = hostWithWatch.setTimeout(buildNextInvalidatedProject, time, state, changeDetected);
127283
127412
  }
127284
127413
  function buildNextInvalidatedProject(state, changeDetected) {
127414
+ ts.performance.mark("SolutionBuilder::beforeBuild");
127415
+ var buildOrder = buildNextInvalidatedProjectWorker(state, changeDetected);
127416
+ ts.performance.mark("SolutionBuilder::afterBuild");
127417
+ ts.performance.measure("SolutionBuilder::Build", "SolutionBuilder::beforeBuild", "SolutionBuilder::afterBuild");
127418
+ if (buildOrder)
127419
+ reportErrorSummary(state, buildOrder);
127420
+ }
127421
+ function buildNextInvalidatedProjectWorker(state, changeDetected) {
127285
127422
  state.timerToBuildInvalidatedProject = undefined;
127286
127423
  if (state.reportFileChangeDetected) {
127287
127424
  state.reportFileChangeDetected = false;
@@ -127314,7 +127451,7 @@ var ts;
127314
127451
  }
127315
127452
  }
127316
127453
  disableCache(state);
127317
- reportErrorSummary(state, buildOrder);
127454
+ return buildOrder;
127318
127455
  }
127319
127456
  function watchConfigFile(state, resolved, resolvedPath, parsed) {
127320
127457
  if (!state.watch || state.allWatchedConfigFiles.has(resolvedPath))
@@ -127369,6 +127506,7 @@ var ts;
127369
127506
  function startWatching(state, buildOrder) {
127370
127507
  if (!state.watchAllProjectsPending)
127371
127508
  return;
127509
+ ts.performance.mark("SolutionBuilder::beforeWatcherCreation");
127372
127510
  state.watchAllProjectsPending = false;
127373
127511
  for (var _i = 0, _a = getBuildOrderFromAnyBuildOrder(buildOrder); _i < _a.length; _i++) {
127374
127512
  var resolved = _a[_i];
@@ -127386,6 +127524,8 @@ var ts;
127386
127524
  watchPackageJsonFiles(state, resolved, resolvedPath, cfg);
127387
127525
  }
127388
127526
  }
127527
+ ts.performance.mark("SolutionBuilder::afterWatcherCreation");
127528
+ ts.performance.measure("SolutionBuilder::Watcher creation", "SolutionBuilder::beforeWatcherCreation", "SolutionBuilder::afterWatcherCreation");
127389
127529
  }
127390
127530
  function stopWatching(state) {
127391
127531
  ts.clearMap(state.allWatchedConfigFiles, ts.closeFileWatcher);
@@ -127499,6 +127639,8 @@ var ts;
127499
127639
  return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_output_1_is_older_than_input_2, relName(state, configFileName), relName(state, status.outOfDateOutputFileName), relName(state, status.newerProjectName));
127500
127640
  case ts.UpToDateStatusType.OutputMissing:
127501
127641
  return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist, relName(state, configFileName), relName(state, status.missingOutputFileName));
127642
+ case ts.UpToDateStatusType.ErrorReadingFile:
127643
+ return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_there_was_error_reading_file_1, relName(state, configFileName), relName(state, status.fileName));
127502
127644
  case ts.UpToDateStatusType.OutOfDateBuildInfo:
127503
127645
  return reportStatus(state, ts.Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted, relName(state, configFileName), relName(state, status.buildInfoFile));
127504
127646
  case ts.UpToDateStatusType.UpToDate: