@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/tsc.js CHANGED
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.9";
72
- ts.version = "".concat(ts.versionMajorMinor, ".0-insiders.20220922");
72
+ ts.version = "".concat(ts.versionMajorMinor, ".0-insiders.20220929");
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -2744,7 +2744,9 @@ var ts;
2744
2744
  (function (ts) {
2745
2745
  var versionRegExp = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i;
2746
2746
  var prereleaseRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i;
2747
+ var prereleasePartRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i;
2747
2748
  var buildRegExp = /^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i;
2749
+ var buildPartRegExp = /^[a-z0-9-]+$/i;
2748
2750
  var numericIdentifierRegExp = /^(0|[1-9]\d*)$/;
2749
2751
  var Version = (function () {
2750
2752
  function Version(major, minor, patch, prerelease, build) {
@@ -2759,13 +2761,15 @@ var ts;
2759
2761
  ts.Debug.assert(major >= 0, "Invalid argument: major");
2760
2762
  ts.Debug.assert(minor >= 0, "Invalid argument: minor");
2761
2763
  ts.Debug.assert(patch >= 0, "Invalid argument: patch");
2762
- ts.Debug.assert(!prerelease || prereleaseRegExp.test(prerelease), "Invalid argument: prerelease");
2763
- ts.Debug.assert(!build || buildRegExp.test(build), "Invalid argument: build");
2764
+ var prereleaseArray = prerelease ? ts.isArray(prerelease) ? prerelease : prerelease.split(".") : ts.emptyArray;
2765
+ var buildArray = build ? ts.isArray(build) ? build : build.split(".") : ts.emptyArray;
2766
+ ts.Debug.assert(ts.every(prereleaseArray, function (s) { return prereleasePartRegExp.test(s); }), "Invalid argument: prerelease");
2767
+ ts.Debug.assert(ts.every(buildArray, function (s) { return buildPartRegExp.test(s); }), "Invalid argument: build");
2764
2768
  this.major = major;
2765
2769
  this.minor = minor;
2766
2770
  this.patch = patch;
2767
- this.prerelease = prerelease ? prerelease.split(".") : ts.emptyArray;
2768
- this.build = build ? build.split(".") : ts.emptyArray;
2771
+ this.prerelease = prereleaseArray;
2772
+ this.build = buildArray;
2769
2773
  }
2770
2774
  Version.tryParse = function (text) {
2771
2775
  var result = tryParseComponents(text);
@@ -2792,6 +2796,10 @@ var ts;
2792
2796
  default: return ts.Debug.assertNever(field);
2793
2797
  }
2794
2798
  };
2799
+ Version.prototype.with = function (fields) {
2800
+ 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;
2801
+ return new Version(major, minor, patch, prerelease, build);
2802
+ };
2795
2803
  Version.prototype.toString = function () {
2796
2804
  var result = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
2797
2805
  if (ts.some(this.prerelease))
@@ -2800,7 +2808,7 @@ var ts;
2800
2808
  result += "+".concat(this.build.join("."));
2801
2809
  return result;
2802
2810
  };
2803
- Version.zero = new Version(0, 0, 0);
2811
+ Version.zero = new Version(0, 0, 0, ["0"]);
2804
2812
  return Version;
2805
2813
  }());
2806
2814
  ts.Version = Version;
@@ -2950,19 +2958,20 @@ var ts;
2950
2958
  break;
2951
2959
  case "<":
2952
2960
  case ">=":
2953
- comparators.push(createComparator(operator, version));
2961
+ comparators.push(isWildcard(minor) || isWildcard(patch) ? createComparator(operator, version.with({ prerelease: "0" })) :
2962
+ createComparator(operator, version));
2954
2963
  break;
2955
2964
  case "<=":
2956
2965
  case ">":
2957
- comparators.push(isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("major")) :
2958
- isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("minor")) :
2966
+ comparators.push(isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("major").with({ prerelease: "0" })) :
2967
+ isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("minor").with({ prerelease: "0" })) :
2959
2968
  createComparator(operator, version));
2960
2969
  break;
2961
2970
  case "=":
2962
2971
  case undefined:
2963
2972
  if (isWildcard(minor) || isWildcard(patch)) {
2964
- comparators.push(createComparator(">=", version));
2965
- comparators.push(createComparator("<", version.increment(isWildcard(minor) ? "major" : "minor")));
2973
+ comparators.push(createComparator(">=", version.with({ prerelease: "0" })));
2974
+ comparators.push(createComparator("<", version.increment(isWildcard(minor) ? "major" : "minor").with({ prerelease: "0" })));
2966
2975
  }
2967
2976
  else {
2968
2977
  comparators.push(createComparator("=", version));
@@ -47659,13 +47668,27 @@ var ts;
47659
47668
  return getTypeFromTypeNode(typeNode);
47660
47669
  }
47661
47670
  }
47671
+ function isParameterOfContextSensitiveSignature(symbol) {
47672
+ var decl = symbol.valueDeclaration;
47673
+ if (!decl) {
47674
+ return false;
47675
+ }
47676
+ if (ts.isBindingElement(decl)) {
47677
+ decl = ts.walkUpBindingElementsAndPatterns(decl);
47678
+ }
47679
+ if (ts.isParameter(decl)) {
47680
+ return isContextSensitiveFunctionOrObjectLiteralMethod(decl.parent);
47681
+ }
47682
+ return false;
47683
+ }
47662
47684
  function getTypeOfVariableOrParameterOrProperty(symbol) {
47663
47685
  var links = getSymbolLinks(symbol);
47664
47686
  if (!links.type) {
47665
47687
  var type = getTypeOfVariableOrParameterOrPropertyWorker(symbol);
47666
- if (!links.type) {
47688
+ if (!links.type && !isParameterOfContextSensitiveSignature(symbol)) {
47667
47689
  links.type = type;
47668
47690
  }
47691
+ return type;
47669
47692
  }
47670
47693
  return links.type;
47671
47694
  }
@@ -52722,7 +52745,15 @@ var ts;
52722
52745
  return accessFlags & 1 ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
52723
52746
  }
52724
52747
  errorIfWritingToReadonlyIndex(indexInfo);
52725
- return accessFlags & 1 ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
52748
+ if ((accessFlags & 1) &&
52749
+ !(objectType.symbol &&
52750
+ objectType.symbol.flags & (256 | 128) &&
52751
+ (indexType.symbol &&
52752
+ indexType.flags & 1024 &&
52753
+ getParentOfSymbol(indexType.symbol) === objectType.symbol))) {
52754
+ return getUnionType([indexInfo.type, undefinedType]);
52755
+ }
52756
+ return indexInfo.type;
52726
52757
  }
52727
52758
  if (indexType.flags & 131072) {
52728
52759
  return neverType;
@@ -55934,7 +55965,7 @@ var ts;
55934
55965
  if (relation === comparableRelation && sourceFlags & 262144) {
55935
55966
  var constraint = getConstraintOfTypeParameter(source);
55936
55967
  if (constraint && hasNonCircularBaseConstraint(source)) {
55937
- while (constraint && constraint.flags & 262144) {
55968
+ while (constraint && someType(constraint, function (c) { return !!(c.flags & 262144); })) {
55938
55969
  if (result = isRelatedTo(constraint, target, 1, false)) {
55939
55970
  return result;
55940
55971
  }
@@ -59126,7 +59157,7 @@ var ts;
59126
59157
  }
59127
59158
  if (ts.isEntityNameExpression(node.argumentExpression)) {
59128
59159
  var symbol = resolveEntityName(node.argumentExpression, 111551, true);
59129
- if (!symbol || !isConstVariable(symbol))
59160
+ if (!symbol || !(isConstVariable(symbol) || (symbol.flags & 8)))
59130
59161
  return undefined;
59131
59162
  var declaration = symbol.valueDeclaration;
59132
59163
  if (declaration === undefined)
@@ -59140,7 +59171,12 @@ var ts;
59140
59171
  }
59141
59172
  if (ts.hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node.argumentExpression)) {
59142
59173
  var initializer = ts.getEffectiveInitializer(declaration);
59143
- return initializer && tryGetNameFromType(getTypeOfExpression(initializer));
59174
+ if (initializer) {
59175
+ return tryGetNameFromType(getTypeOfExpression(initializer));
59176
+ }
59177
+ if (ts.isEnumMember(declaration)) {
59178
+ return ts.getTextOfPropertyName(declaration.name);
59179
+ }
59144
59180
  }
59145
59181
  }
59146
59182
  return undefined;
@@ -98346,7 +98382,7 @@ var ts;
98346
98382
  return { file: file, pos: pos, end: end, packageId: packageId };
98347
98383
  }
98348
98384
  ts.getReferencedFileLocation = getReferencedFileLocation;
98349
- function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences) {
98385
+ function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion, fileExists, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences) {
98350
98386
  if (!program || (hasChangedAutomaticTypeDirectiveNames === null || hasChangedAutomaticTypeDirectiveNames === void 0 ? void 0 : hasChangedAutomaticTypeDirectiveNames()))
98351
98387
  return false;
98352
98388
  if (!ts.arrayIsEqualTo(program.getRootFileNames(), rootFileNames))
@@ -98366,7 +98402,7 @@ var ts;
98366
98402
  return true;
98367
98403
  function sourceFileNotUptoDate(sourceFile) {
98368
98404
  return !sourceFileVersionUptoDate(sourceFile) ||
98369
- hasInvalidatedResolution(sourceFile.path);
98405
+ hasInvalidatedResolutions(sourceFile.path);
98370
98406
  }
98371
98407
  function sourceFileVersionUptoDate(sourceFile) {
98372
98408
  return sourceFile.version === getSourceVersion(sourceFile.resolvedPath, sourceFile.fileName);
@@ -98574,7 +98610,7 @@ var ts;
98574
98610
  var moduleResolutionCache;
98575
98611
  var typeReferenceDirectiveResolutionCache;
98576
98612
  var actualResolveModuleNamesWorker;
98577
- var hasInvalidatedResolution = host.hasInvalidatedResolution || ts.returnFalse;
98613
+ var hasInvalidatedResolutions = host.hasInvalidatedResolutions || ts.returnFalse;
98578
98614
  if (host.resolveModuleNames) {
98579
98615
  actualResolveModuleNamesWorker = function (moduleNames, containingFile, containingFileName, reusedNames, redirectedReference) { return host.resolveModuleNames(ts.Debug.checkEachDefined(moduleNames), containingFileName, reusedNames, redirectedReference, options, containingFile).map(function (resolved) {
98580
98616
  if (!resolved || resolved.extension !== undefined) {
@@ -98949,7 +98985,7 @@ var ts;
98949
98985
  var predictedToResolveToAmbientModuleMarker = {};
98950
98986
  for (var i = 0; i < moduleNames.length; i++) {
98951
98987
  var moduleName = moduleNames[i];
98952
- if (file === oldSourceFile && !hasInvalidatedResolution(oldSourceFile.path)) {
98988
+ if (file === oldSourceFile && !hasInvalidatedResolutions(oldSourceFile.path)) {
98953
98989
  var oldResolvedModule = ts.getResolvedModule(oldSourceFile, moduleName, getModeForResolutionAtIndex(oldSourceFile, i));
98954
98990
  if (oldResolvedModule) {
98955
98991
  if (ts.isTraceEnabled(options, host)) {
@@ -99134,7 +99170,7 @@ var ts;
99134
99170
  }
99135
99171
  modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile });
99136
99172
  }
99137
- else if (hasInvalidatedResolution(oldSourceFile.path)) {
99173
+ else if (hasInvalidatedResolutions(oldSourceFile.path)) {
99138
99174
  structureIsReused = 1;
99139
99175
  modifiedSourceFiles.push({ oldFile: oldSourceFile, newFile: newSourceFile });
99140
99176
  }
@@ -101566,7 +101602,7 @@ var ts;
101566
101602
  var canCopyEmitSignatures = compilerOptions.composite &&
101567
101603
  (oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) &&
101568
101604
  !outFilePath &&
101569
- !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldCompilerOptions);
101605
+ !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldState.compilerOptions);
101570
101606
  if (useOldState) {
101571
101607
  (_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
101572
101608
  if (!outFilePath && oldState.affectedFilesPendingEmit) {
@@ -102655,7 +102691,7 @@ var ts;
102655
102691
  invalidateResolutionOfFile: invalidateResolutionOfFile,
102656
102692
  invalidateResolutionsOfFailedLookupLocations: invalidateResolutionsOfFailedLookupLocations,
102657
102693
  setFilesWithInvalidatedNonRelativeUnresolvedImports: setFilesWithInvalidatedNonRelativeUnresolvedImports,
102658
- createHasInvalidatedResolution: createHasInvalidatedResolution,
102694
+ createHasInvalidatedResolutions: createHasInvalidatedResolutions,
102659
102695
  isFileWithInvalidatedNonRelativeUnresolvedImports: isFileWithInvalidatedNonRelativeUnresolvedImports,
102660
102696
  updateTypeRootsWatch: updateTypeRootsWatch,
102661
102697
  closeTypeRootsWatch: closeTypeRootsWatch,
@@ -102709,11 +102745,11 @@ var ts;
102709
102745
  var value = filesWithInvalidatedNonRelativeUnresolvedImports.get(path);
102710
102746
  return !!value && !!value.length;
102711
102747
  }
102712
- function createHasInvalidatedResolution(userProvidedHasInvalidatedResolution) {
102748
+ function createHasInvalidatedResolutions(customHasInvalidatedResolutions) {
102713
102749
  invalidateResolutionsOfFailedLookupLocations();
102714
102750
  var collected = filesWithInvalidatedResolutions;
102715
102751
  filesWithInvalidatedResolutions = undefined;
102716
- return function (path) { return (userProvidedHasInvalidatedResolution === null || userProvidedHasInvalidatedResolution === void 0 ? void 0 : userProvidedHasInvalidatedResolution(path)) ||
102752
+ return function (path) { return customHasInvalidatedResolutions(path) ||
102717
102753
  !!(collected === null || collected === void 0 ? void 0 : collected.has(path)) ||
102718
102754
  isFileWithInvalidatedNonRelativeUnresolvedImports(path); };
102719
102755
  }
@@ -104804,7 +104840,9 @@ var ts;
104804
104840
  ts.maybeBind(host, host.getModuleResolutionCache) :
104805
104841
  (function () { return resolutionCache.getModuleResolutionCache(); });
104806
104842
  var userProvidedResolution = !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives;
104807
- var userProvidedHasInvalidatedResolution = ts.maybeBind(host, host.hasInvalidatedResolution) || ts.returnTrue;
104843
+ var customHasInvalidatedResolutions = userProvidedResolution ?
104844
+ ts.maybeBind(host, host.hasInvalidatedResolutions) || ts.returnTrue :
104845
+ ts.returnFalse;
104808
104846
  builderProgram = readBuilderProgram(compilerOptions, compilerHost);
104809
104847
  synchronizeProgram();
104810
104848
  watchConfigFileWildCardDirectories();
@@ -104868,9 +104906,9 @@ var ts;
104868
104906
  resolutionCache.clear();
104869
104907
  }
104870
104908
  }
104871
- var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution ? userProvidedHasInvalidatedResolution : undefined);
104909
+ var hasInvalidatedResolutions = resolutionCache.createHasInvalidatedResolutions(customHasInvalidatedResolutions);
104872
104910
  var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
104873
- if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
104911
+ if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolutions, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
104874
104912
  if (hasChangedConfigFileParsingErrors) {
104875
104913
  if (reportFileChangeDetectedOnCreateProgram) {
104876
104914
  reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
@@ -104883,7 +104921,7 @@ var ts;
104883
104921
  if (reportFileChangeDetectedOnCreateProgram) {
104884
104922
  reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
104885
104923
  }
104886
- createNewProgram(hasInvalidatedResolution);
104924
+ createNewProgram(hasInvalidatedResolutions);
104887
104925
  }
104888
104926
  reportFileChangeDetectedOnCreateProgram = false;
104889
104927
  if (host.afterProgramCreate && program !== builderProgram) {
@@ -104896,7 +104934,7 @@ var ts;
104896
104934
  compilerHost.writeFile = originalWriteFile;
104897
104935
  return builderProgram;
104898
104936
  }
104899
- function createNewProgram(hasInvalidatedResolution) {
104937
+ function createNewProgram(hasInvalidatedResolutions) {
104900
104938
  writeLog("CreatingProgramWith::");
104901
104939
  writeLog(" roots: ".concat(JSON.stringify(rootFileNames)));
104902
104940
  writeLog(" options: ".concat(JSON.stringify(compilerOptions)));
@@ -104906,7 +104944,7 @@ var ts;
104906
104944
  hasChangedCompilerOptions = false;
104907
104945
  hasChangedConfigFileParsingErrors = false;
104908
104946
  resolutionCache.startCachingPerDirectoryResolution();
104909
- compilerHost.hasInvalidatedResolution = hasInvalidatedResolution;
104947
+ compilerHost.hasInvalidatedResolutions = hasInvalidatedResolutions;
104910
104948
  compilerHost.hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames;
104911
104949
  var oldProgram = getCurrentProgram();
104912
104950
  builderProgram = createProgram(rootFileNames, compilerOptions, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences);
@@ -106378,7 +106416,9 @@ var ts;
106378
106416
  }
106379
106417
  if (buildInfo.program) {
106380
106418
  if (((_a = buildInfo.program.changeFileSet) === null || _a === void 0 ? void 0 : _a.length) ||
106381
- (!project.options.noEmit && ((_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length))) {
106419
+ (!project.options.noEmit ?
106420
+ (_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length :
106421
+ ts.some(buildInfo.program.semanticDiagnosticsPerFile, ts.isArray))) {
106382
106422
  return {
106383
106423
  type: ts.UpToDateStatusType.OutOfDateBuildInfo,
106384
106424
  buildInfoFile: buildInfoPath