@typescript-deploys/pr-build 4.9.0-pr-50776-2 → 4.9.0-pr-50976-13

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/typescript.js CHANGED
@@ -99,7 +99,7 @@ var ts;
99
99
  // The following is baselined as a literal template type without intervention
100
100
  /** The version of the TypeScript compiler release */
101
101
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
102
- ts.version = "".concat(ts.versionMajorMinor, ".0-insiders.20220922");
102
+ ts.version = "".concat(ts.versionMajorMinor, ".0-insiders.20220929");
103
103
  /* @internal */
104
104
  var Comparison;
105
105
  (function (Comparison) {
@@ -3205,11 +3205,13 @@ var ts;
3205
3205
  // > alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty. Numeric identifiers
3206
3206
  // > MUST NOT include leading zeroes.
3207
3207
  var prereleaseRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i;
3208
+ var prereleasePartRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i;
3208
3209
  // https://semver.org/#spec-item-10
3209
3210
  // > Build metadata MAY be denoted by appending a plus sign and a series of dot separated
3210
3211
  // > identifiers immediately following the patch or pre-release version. Identifiers MUST
3211
3212
  // > comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty.
3212
3213
  var buildRegExp = /^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i;
3214
+ var buildPartRegExp = /^[a-z0-9-]+$/i;
3213
3215
  // https://semver.org/#spec-item-9
3214
3216
  // > Numeric identifiers MUST NOT include leading zeroes.
3215
3217
  var numericIdentifierRegExp = /^(0|[1-9]\d*)$/;
@@ -3229,13 +3231,15 @@ var ts;
3229
3231
  ts.Debug.assert(major >= 0, "Invalid argument: major");
3230
3232
  ts.Debug.assert(minor >= 0, "Invalid argument: minor");
3231
3233
  ts.Debug.assert(patch >= 0, "Invalid argument: patch");
3232
- ts.Debug.assert(!prerelease || prereleaseRegExp.test(prerelease), "Invalid argument: prerelease");
3233
- ts.Debug.assert(!build || buildRegExp.test(build), "Invalid argument: build");
3234
+ var prereleaseArray = prerelease ? ts.isArray(prerelease) ? prerelease : prerelease.split(".") : ts.emptyArray;
3235
+ var buildArray = build ? ts.isArray(build) ? build : build.split(".") : ts.emptyArray;
3236
+ ts.Debug.assert(ts.every(prereleaseArray, function (s) { return prereleasePartRegExp.test(s); }), "Invalid argument: prerelease");
3237
+ ts.Debug.assert(ts.every(buildArray, function (s) { return buildPartRegExp.test(s); }), "Invalid argument: build");
3234
3238
  this.major = major;
3235
3239
  this.minor = minor;
3236
3240
  this.patch = patch;
3237
- this.prerelease = prerelease ? prerelease.split(".") : ts.emptyArray;
3238
- this.build = build ? build.split(".") : ts.emptyArray;
3241
+ this.prerelease = prereleaseArray;
3242
+ this.build = buildArray;
3239
3243
  }
3240
3244
  Version.tryParse = function (text) {
3241
3245
  var result = tryParseComponents(text);
@@ -3274,6 +3278,10 @@ var ts;
3274
3278
  default: return ts.Debug.assertNever(field);
3275
3279
  }
3276
3280
  };
3281
+ Version.prototype.with = function (fields) {
3282
+ var _a = fields.major, major = _a === void 0 ? this.major : _a, _b = fields.minor, minor = _b === void 0 ? this.minor : _b, _c = fields.patch, patch = _c === void 0 ? this.patch : _c, _d = fields.prerelease, prerelease = _d === void 0 ? this.prerelease : _d, _e = fields.build, build = _e === void 0 ? this.build : _e;
3283
+ return new Version(major, minor, patch, prerelease, build);
3284
+ };
3277
3285
  Version.prototype.toString = function () {
3278
3286
  var result = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
3279
3287
  if (ts.some(this.prerelease))
@@ -3282,7 +3290,7 @@ var ts;
3282
3290
  result += "+".concat(this.build.join("."));
3283
3291
  return result;
3284
3292
  };
3285
- Version.zero = new Version(0, 0, 0);
3293
+ Version.zero = new Version(0, 0, 0, ["0"]);
3286
3294
  return Version;
3287
3295
  }());
3288
3296
  ts.Version = Version;
@@ -3365,6 +3373,10 @@ var ts;
3365
3373
  }
3366
3374
  return undefined;
3367
3375
  };
3376
+ /**
3377
+ * Tests whether a version matches the range. This is equivalent to `satisfies(version, range, { includePrerelease: true })`.
3378
+ * in `node-semver`.
3379
+ */
3368
3380
  VersionRange.prototype.test = function (version) {
3369
3381
  if (typeof version === "string")
3370
3382
  version = new Version(version);
@@ -3475,19 +3487,20 @@ var ts;
3475
3487
  break;
3476
3488
  case "<":
3477
3489
  case ">=":
3478
- comparators.push(createComparator(operator, version));
3490
+ comparators.push(isWildcard(minor) || isWildcard(patch) ? createComparator(operator, version.with({ prerelease: "0" })) :
3491
+ createComparator(operator, version));
3479
3492
  break;
3480
3493
  case "<=":
3481
3494
  case ">":
3482
- comparators.push(isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("major")) :
3483
- isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("minor")) :
3495
+ comparators.push(isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("major").with({ prerelease: "0" })) :
3496
+ isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("minor").with({ prerelease: "0" })) :
3484
3497
  createComparator(operator, version));
3485
3498
  break;
3486
3499
  case "=":
3487
3500
  case undefined:
3488
3501
  if (isWildcard(minor) || isWildcard(patch)) {
3489
- comparators.push(createComparator(">=", version));
3490
- comparators.push(createComparator("<", version.increment(isWildcard(minor) ? "major" : "minor")));
3502
+ comparators.push(createComparator(">=", version.with({ prerelease: "0" })));
3503
+ comparators.push(createComparator("<", version.increment(isWildcard(minor) ? "major" : "minor").with({ prerelease: "0" })));
3491
3504
  }
3492
3505
  else {
3493
3506
  comparators.push(createComparator("=", version));
@@ -57597,16 +57610,32 @@ var ts;
57597
57610
  return getTypeFromTypeNode(typeNode);
57598
57611
  }
57599
57612
  }
57613
+ function isParameterOfContextSensitiveSignature(symbol) {
57614
+ var decl = symbol.valueDeclaration;
57615
+ if (!decl) {
57616
+ return false;
57617
+ }
57618
+ if (ts.isBindingElement(decl)) {
57619
+ decl = ts.walkUpBindingElementsAndPatterns(decl);
57620
+ }
57621
+ if (ts.isParameter(decl)) {
57622
+ return isContextSensitiveFunctionOrObjectLiteralMethod(decl.parent);
57623
+ }
57624
+ return false;
57625
+ }
57600
57626
  function getTypeOfVariableOrParameterOrProperty(symbol) {
57601
57627
  var links = getSymbolLinks(symbol);
57602
57628
  if (!links.type) {
57603
57629
  var type = getTypeOfVariableOrParameterOrPropertyWorker(symbol);
57604
57630
  // For a contextually typed parameter it is possible that a type has already
57605
57631
  // been assigned (in assignTypeToParameterAndFixTypeParameters), and we want
57606
- // to preserve this type.
57607
- if (!links.type) {
57632
+ // to preserve this type. In fact, we need to _prefer_ that type, but it won't
57633
+ // be assigned until contextual typing is complete, so we need to defer in
57634
+ // cases where contextual typing may take place.
57635
+ if (!links.type && !isParameterOfContextSensitiveSignature(symbol)) {
57608
57636
  links.type = type;
57609
57637
  }
57638
+ return type;
57610
57639
  }
57611
57640
  return links.type;
57612
57641
  }
@@ -63333,7 +63362,18 @@ var ts;
63333
63362
  return accessFlags & 1 /* AccessFlags.IncludeUndefined */ ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
63334
63363
  }
63335
63364
  errorIfWritingToReadonlyIndex(indexInfo);
63336
- return accessFlags & 1 /* AccessFlags.IncludeUndefined */ ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
63365
+ // When accessing an enum object with its own type,
63366
+ // e.g. E[E.A] for enum E { A }, undefined shouldn't
63367
+ // be included in the result type
63368
+ if ((accessFlags & 1 /* AccessFlags.IncludeUndefined */) &&
63369
+ !(objectType.symbol &&
63370
+ objectType.symbol.flags & (256 /* SymbolFlags.RegularEnum */ | 128 /* SymbolFlags.ConstEnum */) &&
63371
+ (indexType.symbol &&
63372
+ indexType.flags & 1024 /* TypeFlags.EnumLiteral */ &&
63373
+ getParentOfSymbol(indexType.symbol) === objectType.symbol))) {
63374
+ return getUnionType([indexInfo.type, undefinedType]);
63375
+ }
63376
+ return indexInfo.type;
63337
63377
  }
63338
63378
  if (indexType.flags & 131072 /* TypeFlags.Never */) {
63339
63379
  return neverType;
@@ -66990,7 +67030,7 @@ var ts;
66990
67030
  // with another type parameter unless one extends the other. (Remember: comparability is mostly bidirectional!)
66991
67031
  var constraint = getConstraintOfTypeParameter(source);
66992
67032
  if (constraint && hasNonCircularBaseConstraint(source)) {
66993
- while (constraint && constraint.flags & 262144 /* TypeFlags.TypeParameter */) {
67033
+ while (constraint && someType(constraint, function (c) { return !!(c.flags & 262144 /* TypeFlags.TypeParameter */); })) {
66994
67034
  if (result = isRelatedTo(constraint, target, 1 /* RecursionFlags.Source */, /*reportErrors*/ false)) {
66995
67035
  return result;
66996
67036
  }
@@ -70752,7 +70792,7 @@ var ts;
70752
70792
  }
70753
70793
  if (ts.isEntityNameExpression(node.argumentExpression)) {
70754
70794
  var symbol = resolveEntityName(node.argumentExpression, 111551 /* SymbolFlags.Value */, /*ignoreErrors*/ true);
70755
- if (!symbol || !isConstVariable(symbol))
70795
+ if (!symbol || !(isConstVariable(symbol) || (symbol.flags & 8 /* SymbolFlags.EnumMember */)))
70756
70796
  return undefined;
70757
70797
  var declaration = symbol.valueDeclaration;
70758
70798
  if (declaration === undefined)
@@ -70766,7 +70806,12 @@ var ts;
70766
70806
  }
70767
70807
  if (ts.hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node.argumentExpression)) {
70768
70808
  var initializer = ts.getEffectiveInitializer(declaration);
70769
- return initializer && tryGetNameFromType(getTypeOfExpression(initializer));
70809
+ if (initializer) {
70810
+ return tryGetNameFromType(getTypeOfExpression(initializer));
70811
+ }
70812
+ if (ts.isEnumMember(declaration)) {
70813
+ return ts.getTextOfPropertyName(declaration.name);
70814
+ }
70770
70815
  }
70771
70816
  }
70772
70817
  return undefined;
@@ -118830,7 +118875,7 @@ var ts;
118830
118875
  * Determines if program structure is upto date or needs to be recreated
118831
118876
  */
118832
118877
  /* @internal */
118833
- function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences) {
118878
+ function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion, fileExists, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences) {
118834
118879
  // If we haven't created a program yet or have changed automatic type directives, then it is not up-to-date
118835
118880
  if (!program || (hasChangedAutomaticTypeDirectiveNames === null || hasChangedAutomaticTypeDirectiveNames === void 0 ? void 0 : hasChangedAutomaticTypeDirectiveNames()))
118836
118881
  return false;
@@ -118858,7 +118903,7 @@ var ts;
118858
118903
  return true;
118859
118904
  function sourceFileNotUptoDate(sourceFile) {
118860
118905
  return !sourceFileVersionUptoDate(sourceFile) ||
118861
- hasInvalidatedResolution(sourceFile.path);
118906
+ hasInvalidatedResolutions(sourceFile.path);
118862
118907
  }
118863
118908
  function sourceFileVersionUptoDate(sourceFile) {
118864
118909
  return sourceFile.version === getSourceVersion(sourceFile.resolvedPath, sourceFile.fileName);
@@ -119104,7 +119149,7 @@ var ts;
119104
119149
  var moduleResolutionCache;
119105
119150
  var typeReferenceDirectiveResolutionCache;
119106
119151
  var actualResolveModuleNamesWorker;
119107
- var hasInvalidatedResolution = host.hasInvalidatedResolution || ts.returnFalse;
119152
+ var hasInvalidatedResolutions = host.hasInvalidatedResolutions || ts.returnFalse;
119108
119153
  if (host.resolveModuleNames) {
119109
119154
  actualResolveModuleNamesWorker = function (moduleNames, containingFile, containingFileName, reusedNames, redirectedReference) { return host.resolveModuleNames(ts.Debug.checkEachDefined(moduleNames), containingFileName, reusedNames, redirectedReference, options, containingFile).map(function (resolved) {
119110
119155
  // An older host may have omitted extension, in which case we should infer it from the file extension of resolvedFileName.
@@ -119551,7 +119596,7 @@ var ts;
119551
119596
  for (var i = 0; i < moduleNames.length; i++) {
119552
119597
  var moduleName = moduleNames[i];
119553
119598
  // If the source file is unchanged and doesnt have invalidated resolution, reuse the module resolutions
119554
- if (file === oldSourceFile && !hasInvalidatedResolution(oldSourceFile.path)) {
119599
+ if (file === oldSourceFile && !hasInvalidatedResolutions(oldSourceFile.path)) {
119555
119600
  var oldResolvedModule = ts.getResolvedModule(oldSourceFile, moduleName, getModeForResolutionAtIndex(oldSourceFile, i));
119556
119601
  if (oldResolvedModule) {
119557
119602
  if (ts.isTraceEnabled(options, host)) {
@@ -119787,7 +119832,7 @@ var ts;
119787
119832
  // tentatively approve the file
119788
119833
  modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile });
119789
119834
  }
119790
- else if (hasInvalidatedResolution(oldSourceFile.path)) {
119835
+ else if (hasInvalidatedResolutions(oldSourceFile.path)) {
119791
119836
  // 'module/types' references could have changed
119792
119837
  structureIsReused = 1 /* StructureIsReused.SafeModules */;
119793
119838
  // add file to the modified list so that we will resolve it later
@@ -122531,10 +122576,16 @@ var ts;
122531
122576
  var oldCompilerOptions = useOldState ? oldState.compilerOptions : undefined;
122532
122577
  var canCopySemanticDiagnostics = useOldState && oldState.semanticDiagnosticsPerFile && !!state.semanticDiagnosticsPerFile &&
122533
122578
  !ts.compilerOptionsAffectSemanticDiagnostics(compilerOptions, oldCompilerOptions);
122579
+ // We can only reuse emit signatures (i.e. .d.ts signatures) if the .d.ts file is unchanged,
122580
+ // which will eg be depedent on change in options like declarationDir and outDir options are unchanged.
122581
+ // We need to look in oldState.compilerOptions, rather than oldCompilerOptions (i.e.we need to disregard useOldState) because
122582
+ // oldCompilerOptions can be undefined if there was change in say module from None to some other option
122583
+ // which would make useOldState as false since we can now use reference maps that are needed to track what to emit, what to check etc
122584
+ // but that option change does not affect d.ts file name so emitSignatures should still be reused.
122534
122585
  var canCopyEmitSignatures = compilerOptions.composite &&
122535
122586
  (oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) &&
122536
122587
  !outFilePath &&
122537
- !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldCompilerOptions);
122588
+ !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldState.compilerOptions);
122538
122589
  if (useOldState) {
122539
122590
  // Copy old state's changed files set
122540
122591
  (_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
@@ -123833,7 +123884,7 @@ var ts;
123833
123884
  invalidateResolutionOfFile: invalidateResolutionOfFile,
123834
123885
  invalidateResolutionsOfFailedLookupLocations: invalidateResolutionsOfFailedLookupLocations,
123835
123886
  setFilesWithInvalidatedNonRelativeUnresolvedImports: setFilesWithInvalidatedNonRelativeUnresolvedImports,
123836
- createHasInvalidatedResolution: createHasInvalidatedResolution,
123887
+ createHasInvalidatedResolutions: createHasInvalidatedResolutions,
123837
123888
  isFileWithInvalidatedNonRelativeUnresolvedImports: isFileWithInvalidatedNonRelativeUnresolvedImports,
123838
123889
  updateTypeRootsWatch: updateTypeRootsWatch,
123839
123890
  closeTypeRootsWatch: closeTypeRootsWatch,
@@ -123888,12 +123939,12 @@ var ts;
123888
123939
  var value = filesWithInvalidatedNonRelativeUnresolvedImports.get(path);
123889
123940
  return !!value && !!value.length;
123890
123941
  }
123891
- function createHasInvalidatedResolution(userProvidedHasInvalidatedResolution) {
123942
+ function createHasInvalidatedResolutions(customHasInvalidatedResolutions) {
123892
123943
  // Ensure pending resolutions are applied
123893
123944
  invalidateResolutionsOfFailedLookupLocations();
123894
123945
  var collected = filesWithInvalidatedResolutions;
123895
123946
  filesWithInvalidatedResolutions = undefined;
123896
- return function (path) { return (userProvidedHasInvalidatedResolution === null || userProvidedHasInvalidatedResolution === void 0 ? void 0 : userProvidedHasInvalidatedResolution(path)) ||
123947
+ return function (path) { return customHasInvalidatedResolutions(path) ||
123897
123948
  !!(collected === null || collected === void 0 ? void 0 : collected.has(path)) ||
123898
123949
  isFileWithInvalidatedNonRelativeUnresolvedImports(path); };
123899
123950
  }
@@ -126274,7 +126325,10 @@ var ts;
126274
126325
  ts.maybeBind(host, host.getModuleResolutionCache) :
126275
126326
  (function () { return resolutionCache.getModuleResolutionCache(); });
126276
126327
  var userProvidedResolution = !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives;
126277
- var userProvidedHasInvalidatedResolution = ts.maybeBind(host, host.hasInvalidatedResolution) || ts.returnTrue;
126328
+ // All resolutions are invalid if user provided resolutions and didnt supply hasInvalidatedResolutions
126329
+ var customHasInvalidatedResolutions = userProvidedResolution ?
126330
+ ts.maybeBind(host, host.hasInvalidatedResolutions) || ts.returnTrue :
126331
+ ts.returnFalse;
126278
126332
  builderProgram = readBuilderProgram(compilerOptions, compilerHost);
126279
126333
  synchronizeProgram();
126280
126334
  // Update the wild card directory watch
@@ -126340,10 +126394,9 @@ var ts;
126340
126394
  resolutionCache.clear();
126341
126395
  }
126342
126396
  }
126343
- // All resolutions are invalid if user provided resolutions
126344
- var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution ? userProvidedHasInvalidatedResolution : undefined);
126397
+ var hasInvalidatedResolutions = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions);
126345
126398
  var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
126346
- if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
126399
+ if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
126347
126400
  if (hasChangedConfigFileParsingErrors) {
126348
126401
  if (reportFileChangeDetectedOnCreateProgram) {
126349
126402
  reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
@@ -126356,7 +126409,7 @@ var ts;
126356
126409
  if (reportFileChangeDetectedOnCreateProgram) {
126357
126410
  reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
126358
126411
  }
126359
- createNewProgram(hasInvalidatedResolution);
126412
+ createNewProgram(hasInvalidatedResolutions);
126360
126413
  }
126361
126414
  reportFileChangeDetectedOnCreateProgram = false;
126362
126415
  if (host.afterProgramCreate && program !== builderProgram) {
@@ -126369,7 +126422,7 @@ var ts;
126369
126422
  compilerHost.writeFile = originalWriteFile;
126370
126423
  return builderProgram;
126371
126424
  }
126372
- function createNewProgram(hasInvalidatedResolution) {
126425
+ function createNewProgram(hasInvalidatedResolutions) {
126373
126426
  // Compile the program
126374
126427
  writeLog("CreatingProgramWith::");
126375
126428
  writeLog(" roots: ".concat(JSON.stringify(rootFileNames)));
@@ -126380,7 +126433,7 @@ var ts;
126380
126433
  hasChangedCompilerOptions = false;
126381
126434
  hasChangedConfigFileParsingErrors = false;
126382
126435
  resolutionCache.startCachingPerDirectoryResolution();
126383
- compilerHost.hasInvalidatedResolution = hasInvalidatedResolution;
126436
+ compilerHost.hasInvalidatedResolutions = hasInvalidatedResolutions;
126384
126437
  compilerHost.hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames;
126385
126438
  var oldProgram = getCurrentProgram();
126386
126439
  builderProgram = createProgram(rootFileNames, compilerOptions, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences);
@@ -127967,8 +128020,15 @@ var ts;
127967
128020
  }
127968
128021
  if (buildInfo.program) {
127969
128022
  // If there are pending changes that are not emitted, project is out of date
128023
+ // When there are syntax errors, changeFileSet will have list of files changed (irrespective of noEmit)
128024
+ // But in case of semantic error we need special treatment.
128025
+ // Checking presence of affectedFilesPendingEmit list is fast and good way to tell if there were semantic errors and file emit was blocked
128026
+ // But if noEmit is true, affectedFilesPendingEmit will have file list even if there are no semantic errors to preserve list of files to be emitted when running with noEmit false
128027
+ // So with noEmit set to true, check on semantic diagnostics needs to be explicit as oppose to when it is false when only files pending emit is sufficient
127970
128028
  if (((_a = buildInfo.program.changeFileSet) === null || _a === void 0 ? void 0 : _a.length) ||
127971
- (!project.options.noEmit && ((_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length))) {
128029
+ (!project.options.noEmit ?
128030
+ (_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length :
128031
+ ts.some(buildInfo.program.semanticDiagnosticsPerFile, ts.isArray))) {
127972
128032
  return {
127973
128033
  type: ts.UpToDateStatusType.OutOfDateBuildInfo,
127974
128034
  buildInfoFile: buildInfoPath
@@ -139583,7 +139643,7 @@ var ts;
139583
139643
  break;
139584
139644
  case 202 /* SyntaxKind.ImportType */:
139585
139645
  // Only check for typeof import('xyz')
139586
- if (direct.isTypeOf && !direct.qualifier && isExported(direct)) {
139646
+ if (!isAvailableThroughGlobal && direct.isTypeOf && !direct.qualifier && isExported(direct)) {
139587
139647
  addIndirectUser(direct.getSourceFile(), /** addTransitiveDependencies */ true);
139588
139648
  }
139589
139649
  directImports.push(direct);
@@ -168745,7 +168805,7 @@ var ts;
168745
168805
  var rootFileNames = host.getScriptFileNames().slice();
168746
168806
  // Get a fresh cache of the host information
168747
168807
  var newSettings = host.getCompilationSettings() || getDefaultCompilerOptions();
168748
- var hasInvalidatedResolution = host.hasInvalidatedResolution || ts.returnFalse;
168808
+ var hasInvalidatedResolutions = host.hasInvalidatedResolutions || ts.returnFalse;
168749
168809
  var hasChangedAutomaticTypeDirectiveNames = ts.maybeBind(host, host.hasChangedAutomaticTypeDirectiveNames);
168750
168810
  var projectReferences = (_b = host.getProjectReferences) === null || _b === void 0 ? void 0 : _b.call(host);
168751
168811
  var parsedCommandLines;
@@ -168776,7 +168836,7 @@ var ts;
168776
168836
  },
168777
168837
  onReleaseOldSourceFile: onReleaseOldSourceFile,
168778
168838
  onReleaseParsedCommandLine: onReleaseParsedCommandLine,
168779
- hasInvalidatedResolution: hasInvalidatedResolution,
168839
+ hasInvalidatedResolutions: hasInvalidatedResolutions,
168780
168840
  hasChangedAutomaticTypeDirectiveNames: hasChangedAutomaticTypeDirectiveNames,
168781
168841
  trace: ts.maybeBind(host, host.trace),
168782
168842
  resolveModuleNames: ts.maybeBind(host, host.resolveModuleNames),
@@ -168816,7 +168876,7 @@ var ts;
168816
168876
  // as a const variable without downleveling, doesn't crash).
168817
168877
  var documentRegistryBucketKey = documentRegistry.getKeyForCompilationSettings(newSettings);
168818
168878
  // If the program is already up-to-date, we can reuse it
168819
- if (ts.isProgramUptoDate(program, rootFileNames, newSettings, function (_path, fileName) { return host.getScriptVersion(fileName); }, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
168879
+ if (ts.isProgramUptoDate(program, rootFileNames, newSettings, function (_path, fileName) { return host.getScriptVersion(fileName); }, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
168820
168880
  return;
168821
168881
  }
168822
168882
  // IMPORTANT - It is critical from this moment onward that we do not check
@@ -3320,7 +3320,8 @@ declare namespace ts {
3320
3320
  */
3321
3321
  resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
3322
3322
  getEnvironmentVariable?(name: string): string | undefined;
3323
- hasInvalidatedResolution?(filePath: Path): boolean;
3323
+ /** If provided along with custom resolveModuleNames or resolveTypeReferenceDirectives, used to determine if unchanged file path needs to re-resolve modules/type reference directives */
3324
+ hasInvalidatedResolutions?(filePath: Path): boolean;
3324
3325
  createHash?(data: string): string;
3325
3326
  getParsedCommandLine?(fileName: string): ParsedCommandLine | undefined;
3326
3327
  }
@@ -5444,7 +5445,7 @@ declare namespace ts {
5444
5445
  /** If provided, used to resolve type reference directives, otherwise typescript's default resolution */
5445
5446
  resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
5446
5447
  /** If provided along with custom resolveModuleNames or resolveTypeReferenceDirectives, used to determine if unchanged file path needs to re-resolve modules/type reference directives */
5447
- hasInvalidatedResolution?(filePath: Path): boolean;
5448
+ hasInvalidatedResolutions?(filePath: Path): boolean;
5448
5449
  /**
5449
5450
  * Returns the module resolution cache used by a provided `resolveModuleNames` implementation so that any non-name module resolution operations (eg, package.json lookup) can reuse it
5450
5451
  */