typescript 4.2.0-dev.20210208 → 4.2.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
@@ -65,7 +65,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
65
65
  var ts;
66
66
  (function (ts) {
67
67
  ts.versionMajorMinor = "4.2";
68
- ts.version = ts.versionMajorMinor + ".0-dev.20210208";
68
+ ts.version = "4.2.2";
69
69
  var NativeCollections;
70
70
  (function (NativeCollections) {
71
71
  function tryGetNativeMap() {
@@ -2902,28 +2902,27 @@ var ts;
2902
2902
  })(ts || (ts = {}));
2903
2903
  var ts;
2904
2904
  (function (ts) {
2905
- var tracing;
2906
- (function (tracing) {
2905
+ })(ts || (ts = {}));
2906
+ (function (ts) {
2907
+ var tracingEnabled;
2908
+ (function (tracingEnabled) {
2907
2909
  var fs;
2908
2910
  var traceCount = 0;
2909
- var traceFd;
2911
+ var traceFd = 0;
2910
2912
  var mode;
2911
2913
  var legendPath;
2912
2914
  var legend = [];
2913
2915
  ;
2914
2916
  function startTracing(tracingMode, traceDir, configFilePath) {
2915
- ts.Debug.assert(!traceFd, "Tracing already started");
2917
+ ts.Debug.assert(!ts.tracing, "Tracing already started");
2916
2918
  if (fs === undefined) {
2917
2919
  try {
2918
2920
  fs = require("fs");
2919
2921
  }
2920
- catch (_a) {
2921
- fs = false;
2922
+ catch (e) {
2923
+ throw new Error("tracing requires having fs\n(original error: " + (e.message || e) + ")");
2922
2924
  }
2923
2925
  }
2924
- if (!fs) {
2925
- return;
2926
- }
2927
2926
  mode = tracingMode;
2928
2927
  if (legendPath === undefined) {
2929
2928
  legendPath = ts.combinePaths(traceDir, "legend.json");
@@ -2931,9 +2930,9 @@ var ts;
2931
2930
  if (!fs.existsSync(traceDir)) {
2932
2931
  fs.mkdirSync(traceDir, { recursive: true });
2933
2932
  }
2934
- var countPart = mode === 1 ? "." + process.pid + "-" + ++traceCount :
2935
- mode === 2 ? "." + process.pid :
2936
- "";
2933
+ var countPart = mode === 1 ? "." + process.pid + "-" + ++traceCount
2934
+ : mode === 2 ? "." + process.pid
2935
+ : "";
2937
2936
  var tracePath = ts.combinePaths(traceDir, "trace" + countPart + ".json");
2938
2937
  var typesPath = ts.combinePaths(traceDir, "types" + countPart + ".json");
2939
2938
  legend.push({
@@ -2942,22 +2941,19 @@ var ts;
2942
2941
  typesPath: typesPath,
2943
2942
  });
2944
2943
  traceFd = fs.openSync(tracePath, "w");
2944
+ ts.tracing = tracingEnabled;
2945
2945
  var meta = { cat: "__metadata", ph: "M", ts: 1000 * ts.timestamp(), pid: 1, tid: 1 };
2946
2946
  fs.writeSync(traceFd, "[\n"
2947
2947
  + [__assign({ name: "process_name", args: { name: "tsc" } }, meta), __assign({ name: "thread_name", args: { name: "Main" } }, meta), __assign(__assign({ name: "TracingStartedInBrowser" }, meta), { cat: "disabled-by-default-devtools.timeline" })]
2948
2948
  .map(function (v) { return JSON.stringify(v); }).join(",\n"));
2949
2949
  }
2950
- tracing.startTracing = startTracing;
2950
+ tracingEnabled.startTracing = startTracing;
2951
2951
  function stopTracing(typeCatalog) {
2952
- if (!traceFd) {
2953
- ts.Debug.assert(!fs, "Tracing is not in progress");
2954
- return;
2955
- }
2956
- ts.Debug.assert(fs);
2952
+ ts.Debug.assert(ts.tracing, "Tracing is not in progress");
2957
2953
  ts.Debug.assert(!!typeCatalog === (mode !== 2));
2958
2954
  fs.writeSync(traceFd, "\n]\n");
2959
2955
  fs.closeSync(traceFd);
2960
- traceFd = undefined;
2956
+ ts.tracing = undefined;
2961
2957
  if (typeCatalog) {
2962
2958
  dumpTypes(typeCatalog);
2963
2959
  }
@@ -2965,59 +2961,46 @@ var ts;
2965
2961
  legend[legend.length - 1].typesPath = undefined;
2966
2962
  }
2967
2963
  }
2968
- tracing.stopTracing = stopTracing;
2969
- function isTracing() {
2970
- return !!traceFd;
2971
- }
2972
- tracing.isTracing = isTracing;
2964
+ tracingEnabled.stopTracing = stopTracing;
2973
2965
  function instant(phase, name, args) {
2974
- if (!traceFd)
2975
- return;
2976
2966
  writeEvent("I", phase, name, args, "\"s\":\"g\"");
2977
2967
  }
2978
- tracing.instant = instant;
2968
+ tracingEnabled.instant = instant;
2979
2969
  var eventStack = [];
2980
2970
  function push(phase, name, args, separateBeginAndEnd) {
2981
2971
  if (separateBeginAndEnd === void 0) { separateBeginAndEnd = false; }
2982
- if (!traceFd)
2983
- return;
2984
2972
  if (separateBeginAndEnd) {
2985
2973
  writeEvent("B", phase, name, args);
2986
2974
  }
2987
2975
  eventStack.push({ phase: phase, name: name, args: args, time: 1000 * ts.timestamp(), separateBeginAndEnd: separateBeginAndEnd });
2988
2976
  }
2989
- tracing.push = push;
2977
+ tracingEnabled.push = push;
2990
2978
  function pop() {
2991
- if (!traceFd)
2992
- return;
2993
2979
  ts.Debug.assert(eventStack.length > 0);
2994
2980
  writeStackEvent(eventStack.length - 1, 1000 * ts.timestamp());
2995
2981
  eventStack.length--;
2996
2982
  }
2997
- tracing.pop = pop;
2983
+ tracingEnabled.pop = pop;
2998
2984
  function popAll() {
2999
- if (!traceFd)
3000
- return;
3001
2985
  var endTime = 1000 * ts.timestamp();
3002
2986
  for (var i = eventStack.length - 1; i >= 0; i--) {
3003
2987
  writeStackEvent(i, endTime);
3004
2988
  }
3005
2989
  eventStack.length = 0;
3006
2990
  }
3007
- tracing.popAll = popAll;
2991
+ tracingEnabled.popAll = popAll;
2992
+ var sampleInterval = 1000 * 10;
3008
2993
  function writeStackEvent(index, endTime) {
3009
2994
  var _a = eventStack[index], phase = _a.phase, name = _a.name, args = _a.args, time = _a.time, separateBeginAndEnd = _a.separateBeginAndEnd;
3010
2995
  if (separateBeginAndEnd) {
3011
2996
  writeEvent("E", phase, name, args, undefined, endTime);
3012
2997
  }
3013
- else {
2998
+ else if (sampleInterval - (time % sampleInterval) <= endTime - time) {
3014
2999
  writeEvent("X", phase, name, args, "\"dur\":" + (endTime - time), time);
3015
3000
  }
3016
3001
  }
3017
3002
  function writeEvent(eventType, phase, name, args, extras, time) {
3018
3003
  if (time === void 0) { time = 1000 * ts.timestamp(); }
3019
- ts.Debug.assert(traceFd);
3020
- ts.Debug.assert(fs);
3021
3004
  if (mode === 2 && phase === "checkTypes")
3022
3005
  return;
3023
3006
  ts.performance.mark("beginTracing");
@@ -3038,7 +3021,6 @@ var ts;
3038
3021
  }
3039
3022
  function dumpTypes(types) {
3040
3023
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
3041
- ts.Debug.assert(fs);
3042
3024
  ts.performance.mark("beginDumpTypes");
3043
3025
  var typesPath = legend[legend.length - 1].typesPath;
3044
3026
  var typesFd = fs.openSync(typesPath, "w");
@@ -3114,11 +3096,13 @@ var ts;
3114
3096
  if (!legendPath) {
3115
3097
  return;
3116
3098
  }
3117
- ts.Debug.assert(fs);
3118
3099
  fs.writeFileSync(legendPath, JSON.stringify(legend));
3119
3100
  }
3120
- tracing.dumpLegend = dumpLegend;
3121
- })(tracing = ts.tracing || (ts.tracing = {}));
3101
+ tracingEnabled.dumpLegend = dumpLegend;
3102
+ })(tracingEnabled = ts.tracingEnabled || (ts.tracingEnabled = {}));
3103
+ })(ts || (ts = {}));
3104
+ (function (ts) {
3105
+ ts.startTracing = ts.tracingEnabled.startTracing;
3122
3106
  })(ts || (ts = {}));
3123
3107
  var ts;
3124
3108
  (function (ts) {
@@ -14617,7 +14601,7 @@ var ts;
14617
14601
  }
14618
14602
  function Type(checker, flags) {
14619
14603
  this.flags = flags;
14620
- if (ts.Debug.isDebugging || ts.tracing.isTracing()) {
14604
+ if (ts.Debug.isDebugging || ts.tracing) {
14621
14605
  this.checker = checker;
14622
14606
  }
14623
14607
  }
@@ -23096,7 +23080,7 @@ var ts;
23096
23080
  }
23097
23081
  function createSourceFile(fileName, sourceText, languageVersion, setParentNodes, scriptKind) {
23098
23082
  if (setParentNodes === void 0) { setParentNodes = false; }
23099
- ts.tracing.push("parse", "createSourceFile", { path: fileName }, true);
23083
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("parse", "createSourceFile", { path: fileName }, true);
23100
23084
  ts.performance.mark("beforeParse");
23101
23085
  var result;
23102
23086
  ts.perfLogger.logStartParseSourceFile(fileName);
@@ -23109,7 +23093,7 @@ var ts;
23109
23093
  ts.perfLogger.logStopParseSourceFile();
23110
23094
  ts.performance.mark("afterParse");
23111
23095
  ts.performance.measure("Parse", "beforeParse", "afterParse");
23112
- ts.tracing.pop();
23096
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
23113
23097
  return result;
23114
23098
  }
23115
23099
  ts.createSourceFile = createSourceFile;
@@ -32817,14 +32801,14 @@ var ts;
32817
32801
  }
32818
32802
  var binder = createBinder();
32819
32803
  function bindSourceFile(file, options) {
32820
- ts.tracing.push("bind", "bindSourceFile", { path: file.path }, true);
32804
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("bind", "bindSourceFile", { path: file.path }, true);
32821
32805
  ts.performance.mark("beforeBind");
32822
32806
  ts.perfLogger.logStartBindFile("" + file.fileName);
32823
32807
  binder(file, options);
32824
32808
  ts.perfLogger.logStopBindFile();
32825
32809
  ts.performance.mark("afterBind");
32826
32810
  ts.performance.measure("Bind", "beforeBind", "afterBind");
32827
- ts.tracing.pop();
32811
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
32828
32812
  }
32829
32813
  ts.bindSourceFile = bindSourceFile;
32830
32814
  function createBinder() {
@@ -46048,7 +46032,7 @@ var ts;
46048
46032
  if (count === 100000) {
46049
46033
  var estimatedCount = (count / (len - i)) * len;
46050
46034
  if (estimatedCount > 1000000) {
46051
- ts.tracing.instant("checkTypes", "removeSubtypes_DepthLimit", { typeIds: types.map(function (t) { return t.id; }) });
46035
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes", "removeSubtypes_DepthLimit", { typeIds: types.map(function (t) { return t.id; }) });
46052
46036
  error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent);
46053
46037
  return false;
46054
46038
  }
@@ -46066,7 +46050,7 @@ var ts;
46066
46050
  }
46067
46051
  return true;
46068
46052
  }
46069
- function removeRedundantLiteralTypes(types, includes) {
46053
+ function removeRedundantLiteralTypes(types, includes, reduceVoidUndefined) {
46070
46054
  var i = types.length;
46071
46055
  while (i > 0) {
46072
46056
  i--;
@@ -46076,7 +46060,7 @@ var ts;
46076
46060
  flags & 256 && includes & 8 ||
46077
46061
  flags & 2048 && includes & 64 ||
46078
46062
  flags & 8192 && includes & 4096 ||
46079
- flags & 32768 && includes & 16384 ||
46063
+ reduceVoidUndefined && flags & 32768 && includes & 16384 ||
46080
46064
  isFreshLiteralType(t) && containsType(types, t.regularType);
46081
46065
  if (remove) {
46082
46066
  ts.orderedRemoveItemAt(types, i);
@@ -46137,7 +46121,7 @@ var ts;
46137
46121
  }
46138
46122
  if (unionReduction & (1 | 2)) {
46139
46123
  if (includes & (2944 | 8192) || includes & 16384 && includes & 32768) {
46140
- removeRedundantLiteralTypes(typeSet, includes);
46124
+ removeRedundantLiteralTypes(typeSet, includes, !!(unionReduction & 2));
46141
46125
  }
46142
46126
  if (includes & 128 && includes & 134217728) {
46143
46127
  removeStringLiteralsMatchedByTemplateLiterals(typeSet);
@@ -46458,7 +46442,7 @@ var ts;
46458
46442
  function checkCrossProductUnion(types) {
46459
46443
  var size = getCrossProductUnionSize(types);
46460
46444
  if (size >= 100000) {
46461
- ts.tracing.instant("checkTypes", "checkCrossProductUnion_DepthLimit", { typeIds: types.map(function (t) { return t.id; }), size: size });
46445
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes", "checkCrossProductUnion_DepthLimit", { typeIds: types.map(function (t) { return t.id; }), size: size });
46462
46446
  error(currentNode, ts.Diagnostics.Expression_produces_a_union_type_that_is_too_complex_to_represent);
46463
46447
  return false;
46464
46448
  }
@@ -48058,7 +48042,7 @@ var ts;
48058
48042
  return type;
48059
48043
  }
48060
48044
  if (instantiationDepth === 50 || instantiationCount >= 5000000) {
48061
- ts.tracing.instant("checkTypes", "instantiateType_DepthLimit", { typeId: type.id, instantiationDepth: instantiationDepth, instantiationCount: instantiationCount });
48045
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes", "instantiateType_DepthLimit", { typeId: type.id, instantiationDepth: instantiationDepth, instantiationCount: instantiationCount });
48062
48046
  error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
48063
48047
  return errorType;
48064
48048
  }
@@ -48992,7 +48976,7 @@ var ts;
48992
48976
  reportIncompatibleStack();
48993
48977
  }
48994
48978
  if (overflow) {
48995
- ts.tracing.instant("checkTypes", "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: depth });
48979
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes", "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: depth });
48996
48980
  var diag = error(errorNode || currentNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target));
48997
48981
  if (errorOutputContainer) {
48998
48982
  (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag);
@@ -49356,7 +49340,7 @@ var ts;
49356
49340
  }
49357
49341
  }
49358
49342
  function traceUnionsOrIntersectionsTooLarge(source, target) {
49359
- if (!ts.tracing.isTracing()) {
49343
+ if (!ts.tracing) {
49360
49344
  return;
49361
49345
  }
49362
49346
  if ((source.flags & 3145728) && (target.flags & 3145728)) {
@@ -49670,7 +49654,7 @@ var ts;
49670
49654
  };
49671
49655
  }
49672
49656
  if (expandingFlags === 3) {
49673
- ts.tracing.instant("checkTypes", "recursiveTypeRelatedTo_DepthLimit", {
49657
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes", "recursiveTypeRelatedTo_DepthLimit", {
49674
49658
  sourceId: source.id,
49675
49659
  sourceIdStack: sourceStack.map(function (t) { return t.id; }),
49676
49660
  targetId: target.id,
@@ -49701,9 +49685,9 @@ var ts;
49701
49685
  return result;
49702
49686
  }
49703
49687
  function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) {
49704
- ts.tracing.push("checkTypes", "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
49688
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
49705
49689
  var result = structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState);
49706
- ts.tracing.pop();
49690
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
49707
49691
  return result;
49708
49692
  }
49709
49693
  function structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState) {
@@ -50102,7 +50086,7 @@ var ts;
50102
50086
  var sourceProperty = sourcePropertiesFiltered_1[_i];
50103
50087
  numCombinations *= countTypes(getTypeOfSymbol(sourceProperty));
50104
50088
  if (numCombinations > 25) {
50105
- ts.tracing.instant("checkTypes", "typeRelatedToDiscriminatedType_DepthLimit", { sourceId: source.id, targetId: target.id, numCombinations: numCombinations });
50089
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes", "typeRelatedToDiscriminatedType_DepthLimit", { sourceId: source.id, targetId: target.id, numCombinations: numCombinations });
50106
50090
  return 0;
50107
50091
  }
50108
50092
  }
@@ -50783,7 +50767,7 @@ var ts;
50783
50767
  if (typeParameters === void 0) { typeParameters = ts.emptyArray; }
50784
50768
  var variances = cache.variances;
50785
50769
  if (!variances) {
50786
- ts.tracing.push("checkTypes", "getVariancesWorker", { arity: typeParameters.length, id: (_c = (_a = cache.id) !== null && _a !== void 0 ? _a : (_b = cache.declaredType) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : -1 });
50770
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "getVariancesWorker", { arity: typeParameters.length, id: (_c = (_a = cache.id) !== null && _a !== void 0 ? _a : (_b = cache.declaredType) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : -1 });
50787
50771
  cache.variances = ts.emptyArray;
50788
50772
  variances = [];
50789
50773
  var _loop_19 = function (tp) {
@@ -50814,7 +50798,7 @@ var ts;
50814
50798
  _loop_19(tp);
50815
50799
  }
50816
50800
  cache.variances = variances;
50817
- ts.tracing.pop();
50801
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
50818
50802
  }
50819
50803
  return variances;
50820
50804
  }
@@ -53188,7 +53172,16 @@ var ts;
53188
53172
  var type = getTypeOfDottedName(node.expression, diagnostic);
53189
53173
  if (type) {
53190
53174
  var name = node.name;
53191
- var prop = getPropertyOfType(type, ts.isPrivateIdentifier(name) ? ts.getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText) : name.escapedText);
53175
+ var prop = void 0;
53176
+ if (ts.isPrivateIdentifier(name)) {
53177
+ if (!type.symbol) {
53178
+ return undefined;
53179
+ }
53180
+ prop = getPropertyOfType(type, ts.getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText));
53181
+ }
53182
+ else {
53183
+ prop = getPropertyOfType(type, name.escapedText);
53184
+ }
53192
53185
  return prop && getExplicitTypeOfSymbol(prop, diagnostic);
53193
53186
  }
53194
53187
  return undefined;
@@ -53381,7 +53374,7 @@ var ts;
53381
53374
  }
53382
53375
  function getTypeAtFlowNode(flow) {
53383
53376
  if (flowDepth === 2000) {
53384
- ts.tracing.instant("checkTypes", "getTypeAtFlowNode_DepthLimit", { flowId: flow.id });
53377
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes", "getTypeAtFlowNode_DepthLimit", { flowId: flow.id });
53385
53378
  flowAnalysisDisabled = true;
53386
53379
  reportFlowControlError(reference);
53387
53380
  return errorType;
@@ -54093,7 +54086,10 @@ var ts;
54093
54086
  return assignableType;
54094
54087
  }
54095
54088
  }
54096
- return isTypeSubtypeOf(candidate, type) ? candidate : isTypeSubtypeOf(type, candidate) ? type : getIntersectionType([type, candidate]);
54089
+ return isTypeSubtypeOf(candidate, type) ? candidate :
54090
+ isTypeAssignableTo(type, candidate) ? type :
54091
+ isTypeAssignableTo(candidate, type) ? candidate :
54092
+ getIntersectionType([type, candidate]);
54097
54093
  }
54098
54094
  function narrowTypeByCallExpression(type, callExpression, assumeTrue) {
54099
54095
  if (hasMatchingArgument(callExpression, reference)) {
@@ -60745,7 +60741,7 @@ var ts;
60745
60741
  }
60746
60742
  }
60747
60743
  function checkExpression(node, checkMode, forceTuple) {
60748
- ts.tracing.push("check", "checkExpression", { kind: node.kind, pos: node.pos, end: node.end });
60744
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkExpression", { kind: node.kind, pos: node.pos, end: node.end });
60749
60745
  var saveCurrentNode = currentNode;
60750
60746
  currentNode = node;
60751
60747
  instantiationCount = 0;
@@ -60755,7 +60751,7 @@ var ts;
60755
60751
  checkConstEnumAccess(node, type);
60756
60752
  }
60757
60753
  currentNode = saveCurrentNode;
60758
- ts.tracing.pop();
60754
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
60759
60755
  return type;
60760
60756
  }
60761
60757
  function checkConstEnumAccess(node, type) {
@@ -62884,10 +62880,10 @@ var ts;
62884
62880
  return ts.getSelectedEffectiveModifierFlags(left, interestingFlags) === ts.getSelectedEffectiveModifierFlags(right, interestingFlags);
62885
62881
  }
62886
62882
  function checkVariableDeclaration(node) {
62887
- ts.tracing.push("check", "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end });
62883
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end });
62888
62884
  checkGrammarVariableDeclaration(node);
62889
62885
  checkVariableLikeDeclaration(node);
62890
- ts.tracing.pop();
62886
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
62891
62887
  }
62892
62888
  function checkBindingElement(node) {
62893
62889
  checkGrammarBindingElement(node);
@@ -62921,7 +62917,9 @@ var ts;
62921
62917
  : ts.isPropertyAccessExpression(location) ? location.name
62922
62918
  : ts.isBinaryExpression(location) && ts.isIdentifier(location.right) ? location.right
62923
62919
  : undefined;
62924
- if (!testedNode) {
62920
+ var isPropertyExpressionCast = ts.isPropertyAccessExpression(location)
62921
+ && ts.isAssertionExpression(ts.skipParentheses(location.expression));
62922
+ if (!testedNode || isPropertyExpressionCast) {
62925
62923
  return;
62926
62924
  }
62927
62925
  var possiblyFalsy = getFalsyFlags(type);
@@ -65258,7 +65256,7 @@ var ts;
65258
65256
  }
65259
65257
  }
65260
65258
  function checkDeferredNode(node) {
65261
- ts.tracing.push("check", "checkDeferredNode", { kind: node.kind, pos: node.pos, end: node.end });
65259
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkDeferredNode", { kind: node.kind, pos: node.pos, end: node.end });
65262
65260
  var saveCurrentNode = currentNode;
65263
65261
  currentNode = node;
65264
65262
  instantiationCount = 0;
@@ -65291,15 +65289,15 @@ var ts;
65291
65289
  break;
65292
65290
  }
65293
65291
  currentNode = saveCurrentNode;
65294
- ts.tracing.pop();
65292
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
65295
65293
  }
65296
65294
  function checkSourceFile(node) {
65297
- ts.tracing.push("check", "checkSourceFile", { path: node.path }, true);
65295
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkSourceFile", { path: node.path }, true);
65298
65296
  ts.performance.mark("beforeCheck");
65299
65297
  checkSourceFileWorker(node);
65300
65298
  ts.performance.mark("afterCheck");
65301
65299
  ts.performance.measure("Check", "beforeCheck", "afterCheck");
65302
- ts.tracing.pop();
65300
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
65303
65301
  }
65304
65302
  function unusedIsError(kind, isAmbient) {
65305
65303
  if (isAmbient) {
@@ -81567,9 +81565,9 @@ var ts;
81567
81565
  var transformed = [];
81568
81566
  for (var _a = 0, nodes_3 = nodes; _a < nodes_3.length; _a++) {
81569
81567
  var node = nodes_3[_a];
81570
- ts.tracing.push("emit", "transformNodes", node.kind === 297 ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end });
81568
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("emit", "transformNodes", node.kind === 297 ? { path: node.path } : { kind: node.kind, pos: node.pos, end: node.end });
81571
81569
  transformed.push((allowDtsFiles ? transformation : transformRoot)(node));
81572
- ts.tracing.pop();
81570
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
81573
81571
  }
81574
81572
  state = 2;
81575
81573
  ts.performance.mark("afterTransform");
@@ -82075,15 +82073,15 @@ var ts;
82075
82073
  sourceFiles: sourceFileOrBundle.sourceFiles.map(function (file) { return relativeToBuildInfo(ts.getNormalizedAbsolutePath(file.fileName, host.getCurrentDirectory())); })
82076
82074
  };
82077
82075
  }
82078
- ts.tracing.push("emit", "emitJsFileOrBundle", { jsFilePath: jsFilePath });
82076
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("emit", "emitJsFileOrBundle", { jsFilePath: jsFilePath });
82079
82077
  emitJsFileOrBundle(sourceFileOrBundle, jsFilePath, sourceMapFilePath, relativeToBuildInfo);
82080
- ts.tracing.pop();
82081
- ts.tracing.push("emit", "emitDeclarationFileOrBundle", { declarationFilePath: declarationFilePath });
82078
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
82079
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("emit", "emitDeclarationFileOrBundle", { declarationFilePath: declarationFilePath });
82082
82080
  emitDeclarationFileOrBundle(sourceFileOrBundle, declarationFilePath, declarationMapPath, relativeToBuildInfo);
82083
- ts.tracing.pop();
82084
- ts.tracing.push("emit", "emitBuildInfo", { buildInfoPath: buildInfoPath });
82081
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
82082
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("emit", "emitBuildInfo", { buildInfoPath: buildInfoPath });
82085
82083
  emitBuildInfo(bundleBuildInfo, buildInfoPath);
82086
- ts.tracing.pop();
82084
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
82087
82085
  if (!emitSkipped && emittedFilesList) {
82088
82086
  if (!emitOnlyDtsFiles) {
82089
82087
  if (jsFilePath) {
@@ -87281,7 +87279,7 @@ var ts;
87281
87279
  var currentNodeModulesDepth = 0;
87282
87280
  var modulesWithElidedImports = new ts.Map();
87283
87281
  var sourceFilesFoundSearchingNodeModules = new ts.Map();
87284
- ts.tracing.push("program", "createProgram", { configFilePath: options.configFilePath, rootDir: options.rootDir }, true);
87282
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program", "createProgram", { configFilePath: options.configFilePath, rootDir: options.rootDir }, true);
87285
87283
  ts.performance.mark("beforeProgram");
87286
87284
  var host = createProgramOptions.host || createCompilerHost(options);
87287
87285
  var configParsingHost = parseConfigHostFromCompilerHostLike(host);
@@ -87341,13 +87339,13 @@ var ts;
87341
87339
  getSourceOfProjectReferenceRedirect: getSourceOfProjectReferenceRedirect,
87342
87340
  forEachResolvedProjectReference: forEachResolvedProjectReference
87343
87341
  }), onProgramCreateComplete = _d.onProgramCreateComplete, fileExists = _d.fileExists, directoryExists = _d.directoryExists;
87344
- ts.tracing.push("program", "shouldProgramCreateNewSourceFiles", { hasOldProgram: !!oldProgram });
87342
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program", "shouldProgramCreateNewSourceFiles", { hasOldProgram: !!oldProgram });
87345
87343
  var shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options);
87346
- ts.tracing.pop();
87344
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
87347
87345
  var structureIsReused;
87348
- ts.tracing.push("program", "tryReuseStructureFromOldProgram", {});
87346
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program", "tryReuseStructureFromOldProgram", {});
87349
87347
  structureIsReused = tryReuseStructureFromOldProgram();
87350
- ts.tracing.pop();
87348
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
87351
87349
  if (structureIsReused !== 2) {
87352
87350
  processingDefaultLibFiles = [];
87353
87351
  processingOtherFiles = [];
@@ -87385,19 +87383,19 @@ var ts;
87385
87383
  });
87386
87384
  }
87387
87385
  }
87388
- ts.tracing.push("program", "processRootFiles", { count: rootNames.length });
87386
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program", "processRootFiles", { count: rootNames.length });
87389
87387
  ts.forEach(rootNames, function (name, index) { return processRootFile(name, false, false, { kind: ts.FileIncludeKind.RootFile, index: index }); });
87390
- ts.tracing.pop();
87388
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
87391
87389
  var typeReferences = rootNames.length ? ts.getAutomaticTypeDirectiveNames(options, host) : ts.emptyArray;
87392
87390
  if (typeReferences.length) {
87393
- ts.tracing.push("program", "processTypeReferences", { count: typeReferences.length });
87391
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program", "processTypeReferences", { count: typeReferences.length });
87394
87392
  var containingDirectory = options.configFilePath ? ts.getDirectoryPath(options.configFilePath) : host.getCurrentDirectory();
87395
87393
  var containingFilename = ts.combinePaths(containingDirectory, ts.inferredTypesContainingFile);
87396
87394
  var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeReferences, containingFilename);
87397
87395
  for (var i = 0; i < typeReferences.length; i++) {
87398
87396
  processTypeReferenceDirective(typeReferences[i], resolutions[i], { kind: ts.FileIncludeKind.AutomaticTypeDirectiveFile, typeReference: typeReferences[i], packageId: (_b = resolutions[i]) === null || _b === void 0 ? void 0 : _b.packageId });
87399
87397
  }
87400
- ts.tracing.pop();
87398
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
87401
87399
  }
87402
87400
  if (rootNames.length && !skipDefaultLib) {
87403
87401
  var defaultLibraryFileName = getDefaultLibraryFileName();
@@ -87509,19 +87507,19 @@ var ts;
87509
87507
  verifyCompilerOptions();
87510
87508
  ts.performance.mark("afterProgram");
87511
87509
  ts.performance.measure("Program", "beforeProgram", "afterProgram");
87512
- ts.tracing.pop();
87510
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
87513
87511
  return program;
87514
87512
  function resolveModuleNamesWorker(moduleNames, containingFile, reusedNames) {
87515
87513
  if (!moduleNames.length)
87516
87514
  return ts.emptyArray;
87517
87515
  var containingFileName = ts.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory);
87518
87516
  var redirectedReference = getRedirectReferenceForResolution(containingFile);
87519
- ts.tracing.push("program", "resolveModuleNamesWorker", { containingFileName: containingFileName });
87517
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program", "resolveModuleNamesWorker", { containingFileName: containingFileName });
87520
87518
  ts.performance.mark("beforeResolveModule");
87521
87519
  var result = actualResolveModuleNamesWorker(moduleNames, containingFileName, reusedNames, redirectedReference);
87522
87520
  ts.performance.mark("afterResolveModule");
87523
87521
  ts.performance.measure("ResolveModule", "beforeResolveModule", "afterResolveModule");
87524
- ts.tracing.pop();
87522
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
87525
87523
  return result;
87526
87524
  }
87527
87525
  function resolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFile) {
@@ -87529,12 +87527,12 @@ var ts;
87529
87527
  return [];
87530
87528
  var containingFileName = !ts.isString(containingFile) ? ts.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory) : containingFile;
87531
87529
  var redirectedReference = !ts.isString(containingFile) ? getRedirectReferenceForResolution(containingFile) : undefined;
87532
- ts.tracing.push("program", "resolveTypeReferenceDirectiveNamesWorker", { containingFileName: containingFileName });
87530
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program", "resolveTypeReferenceDirectiveNamesWorker", { containingFileName: containingFileName });
87533
87531
  ts.performance.mark("beforeResolveTypeReference");
87534
87532
  var result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFileName, redirectedReference);
87535
87533
  ts.performance.mark("afterResolveTypeReference");
87536
87534
  ts.performance.measure("ResolveTypeReference", "beforeResolveTypeReference", "afterResolveTypeReference");
87537
- ts.tracing.pop();
87535
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
87538
87536
  return result;
87539
87537
  }
87540
87538
  function getRedirectReferenceForResolution(file) {
@@ -87910,12 +87908,12 @@ var ts;
87910
87908
  }
87911
87909
  function emitBuildInfo(writeFileCallback) {
87912
87910
  ts.Debug.assert(!ts.outFile(options));
87913
- ts.tracing.push("emit", "emitBuildInfo", {}, true);
87911
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("emit", "emitBuildInfo", {}, true);
87914
87912
  ts.performance.mark("beforeEmit");
87915
87913
  var emitResult = ts.emitFiles(ts.notImplementedResolver, getEmitHost(writeFileCallback), undefined, ts.noTransformers, false, true);
87916
87914
  ts.performance.mark("afterEmit");
87917
87915
  ts.performance.measure("Emit", "beforeEmit", "afterEmit");
87918
- ts.tracing.pop();
87916
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
87919
87917
  return emitResult;
87920
87918
  }
87921
87919
  function getResolvedProjectReferences() {
@@ -87959,9 +87957,9 @@ var ts;
87959
87957
  return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = ts.createTypeChecker(program, false));
87960
87958
  }
87961
87959
  function emit(sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit) {
87962
- ts.tracing.push("emit", "emit", { path: sourceFile === null || sourceFile === void 0 ? void 0 : sourceFile.path }, true);
87960
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("emit", "emit", { path: sourceFile === null || sourceFile === void 0 ? void 0 : sourceFile.path }, true);
87963
87961
  var result = runWithCancellationToken(function () { return emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, forceDtsEmit); });
87964
- ts.tracing.pop();
87962
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
87965
87963
  return result;
87966
87964
  }
87967
87965
  function isEmitBlocked(emitFileName) {
@@ -88545,13 +88543,13 @@ var ts;
88545
88543
  return redirect;
88546
88544
  }
88547
88545
  function findSourceFile(fileName, path, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
88548
- ts.tracing.push("program", "findSourceFile", {
88546
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program", "findSourceFile", {
88549
88547
  fileName: fileName,
88550
88548
  isDefaultLib: isDefaultLib || undefined,
88551
88549
  fileIncludeKind: ts.FileIncludeKind[reason.kind],
88552
88550
  });
88553
88551
  var result = findSourceFileWorker(fileName, path, isDefaultLib, ignoreNoDefaultLib, reason, packageId);
88554
- ts.tracing.pop();
88552
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
88555
88553
  return result;
88556
88554
  }
88557
88555
  function findSourceFileWorker(fileName, path, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
@@ -88776,9 +88774,9 @@ var ts;
88776
88774
  }
88777
88775
  }
88778
88776
  function processTypeReferenceDirective(typeReferenceDirective, resolvedTypeReferenceDirective, reason) {
88779
- ts.tracing.push("program", "processTypeReferenceDirective", { directive: typeReferenceDirective, hasResolved: !!resolveModuleNamesReusingOldState, refKind: reason.kind, refPath: isReferencedFile(reason) ? reason.file : undefined });
88777
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program", "processTypeReferenceDirective", { directive: typeReferenceDirective, hasResolved: !!resolveModuleNamesReusingOldState, refKind: reason.kind, refPath: isReferencedFile(reason) ? reason.file : undefined });
88780
88778
  processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, reason);
88781
- ts.tracing.pop();
88779
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
88782
88780
  }
88783
88781
  function processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, reason) {
88784
88782
  var previousResolution = resolvedTypeReferenceDirectives.get(typeReferenceDirective);
@@ -94743,7 +94741,7 @@ var ts;
94743
94741
  updateSolutionBuilderHost(sys, cb, buildHost);
94744
94742
  var builder = ts.createSolutionBuilder(buildHost, projects, buildOptions);
94745
94743
  var exitStatus = buildOptions.clean ? builder.clean() : builder.build();
94746
- ts.tracing.dumpLegend();
94744
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.dumpLegend();
94747
94745
  return sys.exit(exitStatus);
94748
94746
  }
94749
94747
  function createReportErrorSummary(sys, options) {
@@ -94857,13 +94855,13 @@ var ts;
94857
94855
  ts.performance.enable(system);
94858
94856
  }
94859
94857
  if (canTrace(system, compilerOptions)) {
94860
- ts.tracing.startTracing(isBuildMode ? 1 : 0, compilerOptions.generateTrace, compilerOptions.configFilePath);
94858
+ ts.startTracing(isBuildMode ? 1 : 0, compilerOptions.generateTrace, compilerOptions.configFilePath);
94861
94859
  }
94862
94860
  }
94863
94861
  function reportStatistics(sys, program) {
94864
94862
  var compilerOptions = program.getCompilerOptions();
94865
94863
  if (canTrace(sys, compilerOptions)) {
94866
- ts.tracing.stopTracing(program.getTypeCatalog());
94864
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.stopTracing(program.getTypeCatalog());
94867
94865
  }
94868
94866
  var statistics;
94869
94867
  if (canReportDiagnostics(sys, compilerOptions)) {