typescript 4.9.0-dev.20221031 → 5.0.0-dev.20221101

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
@@ -68,8 +68,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
68
68
  };
69
69
  var ts;
70
70
  (function (ts) {
71
- ts.versionMajorMinor = "4.9";
72
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221031");
71
+ ts.versionMajorMinor = "5.0";
72
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221101");
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -32769,9 +32769,6 @@ var ts;
32769
32769
  name: "listFilesOnly",
32770
32770
  type: "boolean",
32771
32771
  category: ts.Diagnostics.Command_line_Options,
32772
- affectsSemanticDiagnostics: true,
32773
- affectsEmit: true,
32774
- affectsMultiFileEmitBuildInfo: true,
32775
32772
  isCommandLineOnly: true,
32776
32773
  description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
32777
32774
  defaultValueDescription: false,
@@ -34395,6 +34392,7 @@ var ts;
34395
34392
  return (__assign(__assign({}, prev), (_a = {}, _a[cur[0]] = cur[1], _a)));
34396
34393
  }, {}));
34397
34394
  }
34395
+ ts.optionMapToObject = optionMapToObject;
34398
34396
  function filterSameAsDefaultInclude(specs) {
34399
34397
  if (!ts.length(specs))
34400
34398
  return undefined;
@@ -34443,6 +34441,7 @@ var ts;
34443
34441
  function serializeCompilerOptions(options, pathOptions) {
34444
34442
  return serializeOptionBaseObject(options, getOptionsNameMap(), pathOptions);
34445
34443
  }
34444
+ ts.serializeCompilerOptions = serializeCompilerOptions;
34446
34445
  function serializeWatchOptions(options) {
34447
34446
  return serializeOptionBaseObject(options, getWatchOptionsNameMap());
34448
34447
  }
@@ -47764,13 +47763,27 @@ var ts;
47764
47763
  return getTypeFromTypeNode(typeNode);
47765
47764
  }
47766
47765
  }
47766
+ function isParameterOfContextSensitiveSignature(symbol) {
47767
+ var decl = symbol.valueDeclaration;
47768
+ if (!decl) {
47769
+ return false;
47770
+ }
47771
+ if (ts.isBindingElement(decl)) {
47772
+ decl = ts.walkUpBindingElementsAndPatterns(decl);
47773
+ }
47774
+ if (ts.isParameter(decl)) {
47775
+ return isContextSensitiveFunctionOrObjectLiteralMethod(decl.parent);
47776
+ }
47777
+ return false;
47778
+ }
47767
47779
  function getTypeOfVariableOrParameterOrProperty(symbol) {
47768
47780
  var links = getSymbolLinks(symbol);
47769
47781
  if (!links.type) {
47770
47782
  var type = getTypeOfVariableOrParameterOrPropertyWorker(symbol);
47771
- if (!links.type) {
47783
+ if (!links.type && !isParameterOfContextSensitiveSignature(symbol)) {
47772
47784
  links.type = type;
47773
47785
  }
47786
+ return type;
47774
47787
  }
47775
47788
  return links.type;
47776
47789
  }
@@ -98124,14 +98137,16 @@ var ts;
98124
98137
  }
98125
98138
  return setReadFileCache(key, fileName);
98126
98139
  };
98127
- var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersion, onError, shouldCreateNewSourceFile) {
98140
+ var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile) {
98128
98141
  var key = toPath(fileName);
98129
- var value = sourceFileCache.get(key);
98142
+ var impliedNodeFormat = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions.impliedNodeFormat : undefined;
98143
+ var forImpliedNodeFormat = sourceFileCache.get(impliedNodeFormat);
98144
+ var value = forImpliedNodeFormat === null || forImpliedNodeFormat === void 0 ? void 0 : forImpliedNodeFormat.get(key);
98130
98145
  if (value)
98131
98146
  return value;
98132
- var sourceFile = getSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile);
98147
+ var sourceFile = getSourceFile(fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile);
98133
98148
  if (sourceFile && (ts.isDeclarationFileName(fileName) || ts.fileExtensionIs(fileName, ".json"))) {
98134
- sourceFileCache.set(key, sourceFile);
98149
+ sourceFileCache.set(impliedNodeFormat, (forImpliedNodeFormat || new ts.Map()).set(key, sourceFile));
98135
98150
  }
98136
98151
  return sourceFile;
98137
98152
  } : undefined;
@@ -98155,13 +98170,15 @@ var ts;
98155
98170
  var value = readFileCache.get(key);
98156
98171
  if (value !== undefined && value !== data) {
98157
98172
  readFileCache.delete(key);
98158
- sourceFileCache.delete(key);
98173
+ sourceFileCache.forEach(function (map) { return map.delete(key); });
98159
98174
  }
98160
98175
  else if (getSourceFileWithCache) {
98161
- var sourceFile = sourceFileCache.get(key);
98162
- if (sourceFile && sourceFile.text !== data) {
98163
- sourceFileCache.delete(key);
98164
- }
98176
+ sourceFileCache.forEach(function (map) {
98177
+ var sourceFile = map.get(key);
98178
+ if (sourceFile && sourceFile.text !== data) {
98179
+ map.delete(key);
98180
+ }
98181
+ });
98165
98182
  }
98166
98183
  originalWriteFile.call.apply(originalWriteFile, __spreadArray([host, fileName, data], rest, false));
98167
98184
  };
@@ -102214,7 +102231,8 @@ var ts;
102214
102231
  for (var _b = 0, _c = state.affectedFilesPendingEmit.slice(state.affectedFilesPendingEmitIndex).sort(ts.compareStringsCaseSensitive); _b < _c.length; _b++) {
102215
102232
  var path = _c[_b];
102216
102233
  if (ts.tryAddToSet(seenFiles, path)) {
102217
- (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push([toFileId(path), state.affectedFilesPendingEmitKind.get(path)]);
102234
+ var fileId = toFileId(path), emitKind = state.affectedFilesPendingEmitKind.get(path);
102235
+ (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push(emitKind === 1 ? fileId : [fileId]);
102218
102236
  }
102219
102237
  }
102220
102238
  }
@@ -102619,6 +102637,10 @@ var ts;
102619
102637
  { version: fileInfo.version, signature: fileInfo.signature === false ? undefined : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat };
102620
102638
  }
102621
102639
  ts.toBuilderStateFileInfo = toBuilderStateFileInfo;
102640
+ function toBuilderFileEmit(value) {
102641
+ return ts.isNumber(value) ? 1 : 0;
102642
+ }
102643
+ ts.toBuilderFileEmit = toBuilderFileEmit;
102622
102644
  function createBuilderProgramUsingProgramBuildInfo(program, buildInfoPath, host) {
102623
102645
  var _a, _b, _c, _d;
102624
102646
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
@@ -102660,8 +102682,8 @@ var ts;
102660
102682
  exportedModulesMap: toManyToManyPathMap(program.exportedModulesMap),
102661
102683
  semanticDiagnosticsPerFile: program.semanticDiagnosticsPerFile && ts.arrayToMap(program.semanticDiagnosticsPerFile, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }, function (value) { return ts.isNumber(value) ? ts.emptyArray : value[1]; }),
102662
102684
  hasReusableDiagnostic: true,
102663
- affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }),
102664
- affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }, function (value) { return value[1]; }),
102685
+ affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }),
102686
+ affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }, toBuilderFileEmit),
102665
102687
  affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
102666
102688
  changedFilesSet: new ts.Set(ts.map(program.changeFileSet, toFilePath)),
102667
102689
  latestChangedDtsFile: latestChangedDtsFile,
package/lib/tsserver.js CHANGED
@@ -105,11 +105,11 @@ var ts;
105
105
  (function (ts) {
106
106
  // WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values.
107
107
  // If changing the text in this section, be sure to test `configurePrerelease` too.
108
- ts.versionMajorMinor = "4.9";
108
+ ts.versionMajorMinor = "5.0";
109
109
  // The following is baselined as a literal template type without intervention
110
110
  /** The version of the TypeScript compiler release */
111
111
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
112
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221031");
112
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221101");
113
113
  /* @internal */
114
114
  var Comparison;
115
115
  (function (Comparison) {
@@ -40383,9 +40383,6 @@ var ts;
40383
40383
  name: "listFilesOnly",
40384
40384
  type: "boolean",
40385
40385
  category: ts.Diagnostics.Command_line_Options,
40386
- affectsSemanticDiagnostics: true,
40387
- affectsEmit: true,
40388
- affectsMultiFileEmitBuildInfo: true,
40389
40386
  isCommandLineOnly: true,
40390
40387
  description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
40391
40388
  defaultValueDescription: false,
@@ -42113,12 +42110,14 @@ var ts;
42113
42110
  return config;
42114
42111
  }
42115
42112
  ts.convertToTSConfig = convertToTSConfig;
42113
+ /*@internal*/
42116
42114
  function optionMapToObject(optionMap) {
42117
42115
  return __assign({}, ts.arrayFrom(optionMap.entries()).reduce(function (prev, cur) {
42118
42116
  var _a;
42119
42117
  return (__assign(__assign({}, prev), (_a = {}, _a[cur[0]] = cur[1], _a)));
42120
42118
  }, {}));
42121
42119
  }
42120
+ ts.optionMapToObject = optionMapToObject;
42122
42121
  function filterSameAsDefaultInclude(specs) {
42123
42122
  if (!ts.length(specs))
42124
42123
  return undefined;
@@ -42167,9 +42166,11 @@ var ts;
42167
42166
  });
42168
42167
  }
42169
42168
  ts.getNameOfCompilerOptionValue = getNameOfCompilerOptionValue;
42169
+ /* @internal */
42170
42170
  function serializeCompilerOptions(options, pathOptions) {
42171
42171
  return serializeOptionBaseObject(options, getOptionsNameMap(), pathOptions);
42172
42172
  }
42173
+ ts.serializeCompilerOptions = serializeCompilerOptions;
42173
42174
  function serializeWatchOptions(options) {
42174
42175
  return serializeOptionBaseObject(options, getWatchOptionsNameMap());
42175
42176
  }
@@ -57732,16 +57733,32 @@ var ts;
57732
57733
  return getTypeFromTypeNode(typeNode);
57733
57734
  }
57734
57735
  }
57736
+ function isParameterOfContextSensitiveSignature(symbol) {
57737
+ var decl = symbol.valueDeclaration;
57738
+ if (!decl) {
57739
+ return false;
57740
+ }
57741
+ if (ts.isBindingElement(decl)) {
57742
+ decl = ts.walkUpBindingElementsAndPatterns(decl);
57743
+ }
57744
+ if (ts.isParameter(decl)) {
57745
+ return isContextSensitiveFunctionOrObjectLiteralMethod(decl.parent);
57746
+ }
57747
+ return false;
57748
+ }
57735
57749
  function getTypeOfVariableOrParameterOrProperty(symbol) {
57736
57750
  var links = getSymbolLinks(symbol);
57737
57751
  if (!links.type) {
57738
57752
  var type = getTypeOfVariableOrParameterOrPropertyWorker(symbol);
57739
57753
  // For a contextually typed parameter it is possible that a type has already
57740
57754
  // been assigned (in assignTypeToParameterAndFixTypeParameters), and we want
57741
- // to preserve this type.
57742
- if (!links.type) {
57755
+ // to preserve this type. In fact, we need to _prefer_ that type, but it won't
57756
+ // be assigned until contextual typing is complete, so we need to defer in
57757
+ // cases where contextual typing may take place.
57758
+ if (!links.type && !isParameterOfContextSensitiveSignature(symbol)) {
57743
57759
  links.type = type;
57744
57760
  }
57761
+ return type;
57745
57762
  }
57746
57763
  return links.type;
57747
57764
  }
@@ -118604,14 +118621,16 @@ var ts;
118604
118621
  }
118605
118622
  return setReadFileCache(key, fileName);
118606
118623
  };
118607
- var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersion, onError, shouldCreateNewSourceFile) {
118624
+ var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile) {
118608
118625
  var key = toPath(fileName);
118609
- var value = sourceFileCache.get(key);
118626
+ var impliedNodeFormat = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions.impliedNodeFormat : undefined;
118627
+ var forImpliedNodeFormat = sourceFileCache.get(impliedNodeFormat);
118628
+ var value = forImpliedNodeFormat === null || forImpliedNodeFormat === void 0 ? void 0 : forImpliedNodeFormat.get(key);
118610
118629
  if (value)
118611
118630
  return value;
118612
- var sourceFile = getSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile);
118631
+ var sourceFile = getSourceFile(fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile);
118613
118632
  if (sourceFile && (ts.isDeclarationFileName(fileName) || ts.fileExtensionIs(fileName, ".json" /* Extension.Json */))) {
118614
- sourceFileCache.set(key, sourceFile);
118633
+ sourceFileCache.set(impliedNodeFormat, (forImpliedNodeFormat || new ts.Map()).set(key, sourceFile));
118615
118634
  }
118616
118635
  return sourceFile;
118617
118636
  } : undefined;
@@ -118636,13 +118655,15 @@ var ts;
118636
118655
  var value = readFileCache.get(key);
118637
118656
  if (value !== undefined && value !== data) {
118638
118657
  readFileCache.delete(key);
118639
- sourceFileCache.delete(key);
118658
+ sourceFileCache.forEach(function (map) { return map.delete(key); });
118640
118659
  }
118641
118660
  else if (getSourceFileWithCache) {
118642
- var sourceFile = sourceFileCache.get(key);
118643
- if (sourceFile && sourceFile.text !== data) {
118644
- sourceFileCache.delete(key);
118645
- }
118661
+ sourceFileCache.forEach(function (map) {
118662
+ var sourceFile = map.get(key);
118663
+ if (sourceFile && sourceFile.text !== data) {
118664
+ map.delete(key);
118665
+ }
118666
+ });
118646
118667
  }
118647
118668
  originalWriteFile.call.apply(originalWriteFile, __spreadArray([host, fileName, data], rest, false));
118648
118669
  };
@@ -123339,7 +123360,8 @@ var ts;
123339
123360
  for (var _b = 0, _c = state.affectedFilesPendingEmit.slice(state.affectedFilesPendingEmitIndex).sort(ts.compareStringsCaseSensitive); _b < _c.length; _b++) {
123340
123361
  var path = _c[_b];
123341
123362
  if (ts.tryAddToSet(seenFiles, path)) {
123342
- (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push([toFileId(path), state.affectedFilesPendingEmitKind.get(path)]);
123363
+ var fileId = toFileId(path), emitKind = state.affectedFilesPendingEmitKind.get(path);
123364
+ (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push(emitKind === 1 /* BuilderFileEmit.Full */ ? fileId : [fileId]);
123343
123365
  }
123344
123366
  }
123345
123367
  }
@@ -123818,6 +123840,10 @@ var ts;
123818
123840
  { version: fileInfo.version, signature: fileInfo.signature === false ? undefined : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat };
123819
123841
  }
123820
123842
  ts.toBuilderStateFileInfo = toBuilderStateFileInfo;
123843
+ function toBuilderFileEmit(value) {
123844
+ return ts.isNumber(value) ? 1 /* BuilderFileEmit.Full */ : 0 /* BuilderFileEmit.DtsOnly */;
123845
+ }
123846
+ ts.toBuilderFileEmit = toBuilderFileEmit;
123821
123847
  function createBuilderProgramUsingProgramBuildInfo(program, buildInfoPath, host) {
123822
123848
  var _a, _b, _c, _d;
123823
123849
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
@@ -123859,8 +123885,8 @@ var ts;
123859
123885
  exportedModulesMap: toManyToManyPathMap(program.exportedModulesMap),
123860
123886
  semanticDiagnosticsPerFile: program.semanticDiagnosticsPerFile && ts.arrayToMap(program.semanticDiagnosticsPerFile, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }, function (value) { return ts.isNumber(value) ? ts.emptyArray : value[1]; }),
123861
123887
  hasReusableDiagnostic: true,
123862
- affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }),
123863
- affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }, function (value) { return value[1]; }),
123888
+ affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }),
123889
+ affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }, toBuilderFileEmit),
123864
123890
  affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
123865
123891
  changedFilesSet: new ts.Set(ts.map(program.changeFileSet, toFilePath)),
123866
123892
  latestChangedDtsFile: latestChangedDtsFile,
@@ -14,7 +14,7 @@ and limitations under the License.
14
14
  ***************************************************************************** */
15
15
 
16
16
  declare namespace ts {
17
- const versionMajorMinor = "4.9";
17
+ const versionMajorMinor = "5.0";
18
18
  /** The version of the TypeScript compiler release */
19
19
  const version: string;
20
20
  /**
@@ -104,11 +104,11 @@ var ts;
104
104
  (function (ts) {
105
105
  // WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values.
106
106
  // If changing the text in this section, be sure to test `configurePrerelease` too.
107
- ts.versionMajorMinor = "4.9";
107
+ ts.versionMajorMinor = "5.0";
108
108
  // The following is baselined as a literal template type without intervention
109
109
  /** The version of the TypeScript compiler release */
110
110
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
111
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221031");
111
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221101");
112
112
  /* @internal */
113
113
  var Comparison;
114
114
  (function (Comparison) {
@@ -40382,9 +40382,6 @@ var ts;
40382
40382
  name: "listFilesOnly",
40383
40383
  type: "boolean",
40384
40384
  category: ts.Diagnostics.Command_line_Options,
40385
- affectsSemanticDiagnostics: true,
40386
- affectsEmit: true,
40387
- affectsMultiFileEmitBuildInfo: true,
40388
40385
  isCommandLineOnly: true,
40389
40386
  description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
40390
40387
  defaultValueDescription: false,
@@ -42112,12 +42109,14 @@ var ts;
42112
42109
  return config;
42113
42110
  }
42114
42111
  ts.convertToTSConfig = convertToTSConfig;
42112
+ /*@internal*/
42115
42113
  function optionMapToObject(optionMap) {
42116
42114
  return __assign({}, ts.arrayFrom(optionMap.entries()).reduce(function (prev, cur) {
42117
42115
  var _a;
42118
42116
  return (__assign(__assign({}, prev), (_a = {}, _a[cur[0]] = cur[1], _a)));
42119
42117
  }, {}));
42120
42118
  }
42119
+ ts.optionMapToObject = optionMapToObject;
42121
42120
  function filterSameAsDefaultInclude(specs) {
42122
42121
  if (!ts.length(specs))
42123
42122
  return undefined;
@@ -42166,9 +42165,11 @@ var ts;
42166
42165
  });
42167
42166
  }
42168
42167
  ts.getNameOfCompilerOptionValue = getNameOfCompilerOptionValue;
42168
+ /* @internal */
42169
42169
  function serializeCompilerOptions(options, pathOptions) {
42170
42170
  return serializeOptionBaseObject(options, getOptionsNameMap(), pathOptions);
42171
42171
  }
42172
+ ts.serializeCompilerOptions = serializeCompilerOptions;
42172
42173
  function serializeWatchOptions(options) {
42173
42174
  return serializeOptionBaseObject(options, getWatchOptionsNameMap());
42174
42175
  }
@@ -57731,16 +57732,32 @@ var ts;
57731
57732
  return getTypeFromTypeNode(typeNode);
57732
57733
  }
57733
57734
  }
57735
+ function isParameterOfContextSensitiveSignature(symbol) {
57736
+ var decl = symbol.valueDeclaration;
57737
+ if (!decl) {
57738
+ return false;
57739
+ }
57740
+ if (ts.isBindingElement(decl)) {
57741
+ decl = ts.walkUpBindingElementsAndPatterns(decl);
57742
+ }
57743
+ if (ts.isParameter(decl)) {
57744
+ return isContextSensitiveFunctionOrObjectLiteralMethod(decl.parent);
57745
+ }
57746
+ return false;
57747
+ }
57734
57748
  function getTypeOfVariableOrParameterOrProperty(symbol) {
57735
57749
  var links = getSymbolLinks(symbol);
57736
57750
  if (!links.type) {
57737
57751
  var type = getTypeOfVariableOrParameterOrPropertyWorker(symbol);
57738
57752
  // For a contextually typed parameter it is possible that a type has already
57739
57753
  // been assigned (in assignTypeToParameterAndFixTypeParameters), and we want
57740
- // to preserve this type.
57741
- if (!links.type) {
57754
+ // to preserve this type. In fact, we need to _prefer_ that type, but it won't
57755
+ // be assigned until contextual typing is complete, so we need to defer in
57756
+ // cases where contextual typing may take place.
57757
+ if (!links.type && !isParameterOfContextSensitiveSignature(symbol)) {
57742
57758
  links.type = type;
57743
57759
  }
57760
+ return type;
57744
57761
  }
57745
57762
  return links.type;
57746
57763
  }
@@ -118603,14 +118620,16 @@ var ts;
118603
118620
  }
118604
118621
  return setReadFileCache(key, fileName);
118605
118622
  };
118606
- var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersion, onError, shouldCreateNewSourceFile) {
118623
+ var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile) {
118607
118624
  var key = toPath(fileName);
118608
- var value = sourceFileCache.get(key);
118625
+ var impliedNodeFormat = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions.impliedNodeFormat : undefined;
118626
+ var forImpliedNodeFormat = sourceFileCache.get(impliedNodeFormat);
118627
+ var value = forImpliedNodeFormat === null || forImpliedNodeFormat === void 0 ? void 0 : forImpliedNodeFormat.get(key);
118609
118628
  if (value)
118610
118629
  return value;
118611
- var sourceFile = getSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile);
118630
+ var sourceFile = getSourceFile(fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile);
118612
118631
  if (sourceFile && (ts.isDeclarationFileName(fileName) || ts.fileExtensionIs(fileName, ".json" /* Extension.Json */))) {
118613
- sourceFileCache.set(key, sourceFile);
118632
+ sourceFileCache.set(impliedNodeFormat, (forImpliedNodeFormat || new ts.Map()).set(key, sourceFile));
118614
118633
  }
118615
118634
  return sourceFile;
118616
118635
  } : undefined;
@@ -118635,13 +118654,15 @@ var ts;
118635
118654
  var value = readFileCache.get(key);
118636
118655
  if (value !== undefined && value !== data) {
118637
118656
  readFileCache.delete(key);
118638
- sourceFileCache.delete(key);
118657
+ sourceFileCache.forEach(function (map) { return map.delete(key); });
118639
118658
  }
118640
118659
  else if (getSourceFileWithCache) {
118641
- var sourceFile = sourceFileCache.get(key);
118642
- if (sourceFile && sourceFile.text !== data) {
118643
- sourceFileCache.delete(key);
118644
- }
118660
+ sourceFileCache.forEach(function (map) {
118661
+ var sourceFile = map.get(key);
118662
+ if (sourceFile && sourceFile.text !== data) {
118663
+ map.delete(key);
118664
+ }
118665
+ });
118645
118666
  }
118646
118667
  originalWriteFile.call.apply(originalWriteFile, __spreadArray([host, fileName, data], rest, false));
118647
118668
  };
@@ -123338,7 +123359,8 @@ var ts;
123338
123359
  for (var _b = 0, _c = state.affectedFilesPendingEmit.slice(state.affectedFilesPendingEmitIndex).sort(ts.compareStringsCaseSensitive); _b < _c.length; _b++) {
123339
123360
  var path = _c[_b];
123340
123361
  if (ts.tryAddToSet(seenFiles, path)) {
123341
- (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push([toFileId(path), state.affectedFilesPendingEmitKind.get(path)]);
123362
+ var fileId = toFileId(path), emitKind = state.affectedFilesPendingEmitKind.get(path);
123363
+ (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push(emitKind === 1 /* BuilderFileEmit.Full */ ? fileId : [fileId]);
123342
123364
  }
123343
123365
  }
123344
123366
  }
@@ -123817,6 +123839,10 @@ var ts;
123817
123839
  { version: fileInfo.version, signature: fileInfo.signature === false ? undefined : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat };
123818
123840
  }
123819
123841
  ts.toBuilderStateFileInfo = toBuilderStateFileInfo;
123842
+ function toBuilderFileEmit(value) {
123843
+ return ts.isNumber(value) ? 1 /* BuilderFileEmit.Full */ : 0 /* BuilderFileEmit.DtsOnly */;
123844
+ }
123845
+ ts.toBuilderFileEmit = toBuilderFileEmit;
123820
123846
  function createBuilderProgramUsingProgramBuildInfo(program, buildInfoPath, host) {
123821
123847
  var _a, _b, _c, _d;
123822
123848
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
@@ -123858,8 +123884,8 @@ var ts;
123858
123884
  exportedModulesMap: toManyToManyPathMap(program.exportedModulesMap),
123859
123885
  semanticDiagnosticsPerFile: program.semanticDiagnosticsPerFile && ts.arrayToMap(program.semanticDiagnosticsPerFile, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }, function (value) { return ts.isNumber(value) ? ts.emptyArray : value[1]; }),
123860
123886
  hasReusableDiagnostic: true,
123861
- affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }),
123862
- affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }, function (value) { return value[1]; }),
123887
+ affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }),
123888
+ affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }, toBuilderFileEmit),
123863
123889
  affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
123864
123890
  changedFilesSet: new ts.Set(ts.map(program.changeFileSet, toFilePath)),
123865
123891
  latestChangedDtsFile: latestChangedDtsFile,
@@ -14,7 +14,7 @@ and limitations under the License.
14
14
  ***************************************************************************** */
15
15
 
16
16
  declare namespace ts {
17
- const versionMajorMinor = "4.9";
17
+ const versionMajorMinor = "5.0";
18
18
  /** The version of the TypeScript compiler release */
19
19
  const version: string;
20
20
  /**
package/lib/typescript.js CHANGED
@@ -95,11 +95,11 @@ var ts;
95
95
  (function (ts) {
96
96
  // WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values.
97
97
  // If changing the text in this section, be sure to test `configurePrerelease` too.
98
- ts.versionMajorMinor = "4.9";
98
+ ts.versionMajorMinor = "5.0";
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-dev.20221031");
102
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221101");
103
103
  /* @internal */
104
104
  var Comparison;
105
105
  (function (Comparison) {
@@ -40373,9 +40373,6 @@ var ts;
40373
40373
  name: "listFilesOnly",
40374
40374
  type: "boolean",
40375
40375
  category: ts.Diagnostics.Command_line_Options,
40376
- affectsSemanticDiagnostics: true,
40377
- affectsEmit: true,
40378
- affectsMultiFileEmitBuildInfo: true,
40379
40376
  isCommandLineOnly: true,
40380
40377
  description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
40381
40378
  defaultValueDescription: false,
@@ -42103,12 +42100,14 @@ var ts;
42103
42100
  return config;
42104
42101
  }
42105
42102
  ts.convertToTSConfig = convertToTSConfig;
42103
+ /*@internal*/
42106
42104
  function optionMapToObject(optionMap) {
42107
42105
  return __assign({}, ts.arrayFrom(optionMap.entries()).reduce(function (prev, cur) {
42108
42106
  var _a;
42109
42107
  return (__assign(__assign({}, prev), (_a = {}, _a[cur[0]] = cur[1], _a)));
42110
42108
  }, {}));
42111
42109
  }
42110
+ ts.optionMapToObject = optionMapToObject;
42112
42111
  function filterSameAsDefaultInclude(specs) {
42113
42112
  if (!ts.length(specs))
42114
42113
  return undefined;
@@ -42157,9 +42156,11 @@ var ts;
42157
42156
  });
42158
42157
  }
42159
42158
  ts.getNameOfCompilerOptionValue = getNameOfCompilerOptionValue;
42159
+ /* @internal */
42160
42160
  function serializeCompilerOptions(options, pathOptions) {
42161
42161
  return serializeOptionBaseObject(options, getOptionsNameMap(), pathOptions);
42162
42162
  }
42163
+ ts.serializeCompilerOptions = serializeCompilerOptions;
42163
42164
  function serializeWatchOptions(options) {
42164
42165
  return serializeOptionBaseObject(options, getWatchOptionsNameMap());
42165
42166
  }
@@ -57722,16 +57723,32 @@ var ts;
57722
57723
  return getTypeFromTypeNode(typeNode);
57723
57724
  }
57724
57725
  }
57726
+ function isParameterOfContextSensitiveSignature(symbol) {
57727
+ var decl = symbol.valueDeclaration;
57728
+ if (!decl) {
57729
+ return false;
57730
+ }
57731
+ if (ts.isBindingElement(decl)) {
57732
+ decl = ts.walkUpBindingElementsAndPatterns(decl);
57733
+ }
57734
+ if (ts.isParameter(decl)) {
57735
+ return isContextSensitiveFunctionOrObjectLiteralMethod(decl.parent);
57736
+ }
57737
+ return false;
57738
+ }
57725
57739
  function getTypeOfVariableOrParameterOrProperty(symbol) {
57726
57740
  var links = getSymbolLinks(symbol);
57727
57741
  if (!links.type) {
57728
57742
  var type = getTypeOfVariableOrParameterOrPropertyWorker(symbol);
57729
57743
  // For a contextually typed parameter it is possible that a type has already
57730
57744
  // been assigned (in assignTypeToParameterAndFixTypeParameters), and we want
57731
- // to preserve this type.
57732
- if (!links.type) {
57745
+ // to preserve this type. In fact, we need to _prefer_ that type, but it won't
57746
+ // be assigned until contextual typing is complete, so we need to defer in
57747
+ // cases where contextual typing may take place.
57748
+ if (!links.type && !isParameterOfContextSensitiveSignature(symbol)) {
57733
57749
  links.type = type;
57734
57750
  }
57751
+ return type;
57735
57752
  }
57736
57753
  return links.type;
57737
57754
  }
@@ -118594,14 +118611,16 @@ var ts;
118594
118611
  }
118595
118612
  return setReadFileCache(key, fileName);
118596
118613
  };
118597
- var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersion, onError, shouldCreateNewSourceFile) {
118614
+ var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile) {
118598
118615
  var key = toPath(fileName);
118599
- var value = sourceFileCache.get(key);
118616
+ var impliedNodeFormat = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions.impliedNodeFormat : undefined;
118617
+ var forImpliedNodeFormat = sourceFileCache.get(impliedNodeFormat);
118618
+ var value = forImpliedNodeFormat === null || forImpliedNodeFormat === void 0 ? void 0 : forImpliedNodeFormat.get(key);
118600
118619
  if (value)
118601
118620
  return value;
118602
- var sourceFile = getSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile);
118621
+ var sourceFile = getSourceFile(fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile);
118603
118622
  if (sourceFile && (ts.isDeclarationFileName(fileName) || ts.fileExtensionIs(fileName, ".json" /* Extension.Json */))) {
118604
- sourceFileCache.set(key, sourceFile);
118623
+ sourceFileCache.set(impliedNodeFormat, (forImpliedNodeFormat || new ts.Map()).set(key, sourceFile));
118605
118624
  }
118606
118625
  return sourceFile;
118607
118626
  } : undefined;
@@ -118626,13 +118645,15 @@ var ts;
118626
118645
  var value = readFileCache.get(key);
118627
118646
  if (value !== undefined && value !== data) {
118628
118647
  readFileCache.delete(key);
118629
- sourceFileCache.delete(key);
118648
+ sourceFileCache.forEach(function (map) { return map.delete(key); });
118630
118649
  }
118631
118650
  else if (getSourceFileWithCache) {
118632
- var sourceFile = sourceFileCache.get(key);
118633
- if (sourceFile && sourceFile.text !== data) {
118634
- sourceFileCache.delete(key);
118635
- }
118651
+ sourceFileCache.forEach(function (map) {
118652
+ var sourceFile = map.get(key);
118653
+ if (sourceFile && sourceFile.text !== data) {
118654
+ map.delete(key);
118655
+ }
118656
+ });
118636
118657
  }
118637
118658
  originalWriteFile.call.apply(originalWriteFile, __spreadArray([host, fileName, data], rest, false));
118638
118659
  };
@@ -123329,7 +123350,8 @@ var ts;
123329
123350
  for (var _b = 0, _c = state.affectedFilesPendingEmit.slice(state.affectedFilesPendingEmitIndex).sort(ts.compareStringsCaseSensitive); _b < _c.length; _b++) {
123330
123351
  var path = _c[_b];
123331
123352
  if (ts.tryAddToSet(seenFiles, path)) {
123332
- (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push([toFileId(path), state.affectedFilesPendingEmitKind.get(path)]);
123353
+ var fileId = toFileId(path), emitKind = state.affectedFilesPendingEmitKind.get(path);
123354
+ (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push(emitKind === 1 /* BuilderFileEmit.Full */ ? fileId : [fileId]);
123333
123355
  }
123334
123356
  }
123335
123357
  }
@@ -123808,6 +123830,10 @@ var ts;
123808
123830
  { version: fileInfo.version, signature: fileInfo.signature === false ? undefined : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat };
123809
123831
  }
123810
123832
  ts.toBuilderStateFileInfo = toBuilderStateFileInfo;
123833
+ function toBuilderFileEmit(value) {
123834
+ return ts.isNumber(value) ? 1 /* BuilderFileEmit.Full */ : 0 /* BuilderFileEmit.DtsOnly */;
123835
+ }
123836
+ ts.toBuilderFileEmit = toBuilderFileEmit;
123811
123837
  function createBuilderProgramUsingProgramBuildInfo(program, buildInfoPath, host) {
123812
123838
  var _a, _b, _c, _d;
123813
123839
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
@@ -123849,8 +123875,8 @@ var ts;
123849
123875
  exportedModulesMap: toManyToManyPathMap(program.exportedModulesMap),
123850
123876
  semanticDiagnosticsPerFile: program.semanticDiagnosticsPerFile && ts.arrayToMap(program.semanticDiagnosticsPerFile, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }, function (value) { return ts.isNumber(value) ? ts.emptyArray : value[1]; }),
123851
123877
  hasReusableDiagnostic: true,
123852
- affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }),
123853
- affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }, function (value) { return value[1]; }),
123878
+ affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }),
123879
+ affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }, toBuilderFileEmit),
123854
123880
  affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
123855
123881
  changedFilesSet: new ts.Set(ts.map(program.changeFileSet, toFilePath)),
123856
123882
  latestChangedDtsFile: latestChangedDtsFile,
@@ -14,7 +14,7 @@ and limitations under the License.
14
14
  ***************************************************************************** */
15
15
 
16
16
  declare namespace ts {
17
- const versionMajorMinor = "4.9";
17
+ const versionMajorMinor = "5.0";
18
18
  /** The version of the TypeScript compiler release */
19
19
  const version: string;
20
20
  /**
@@ -95,11 +95,11 @@ var ts;
95
95
  (function (ts) {
96
96
  // WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values.
97
97
  // If changing the text in this section, be sure to test `configurePrerelease` too.
98
- ts.versionMajorMinor = "4.9";
98
+ ts.versionMajorMinor = "5.0";
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-dev.20221031");
102
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221101");
103
103
  /* @internal */
104
104
  var Comparison;
105
105
  (function (Comparison) {
@@ -40373,9 +40373,6 @@ var ts;
40373
40373
  name: "listFilesOnly",
40374
40374
  type: "boolean",
40375
40375
  category: ts.Diagnostics.Command_line_Options,
40376
- affectsSemanticDiagnostics: true,
40377
- affectsEmit: true,
40378
- affectsMultiFileEmitBuildInfo: true,
40379
40376
  isCommandLineOnly: true,
40380
40377
  description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
40381
40378
  defaultValueDescription: false,
@@ -42103,12 +42100,14 @@ var ts;
42103
42100
  return config;
42104
42101
  }
42105
42102
  ts.convertToTSConfig = convertToTSConfig;
42103
+ /*@internal*/
42106
42104
  function optionMapToObject(optionMap) {
42107
42105
  return __assign({}, ts.arrayFrom(optionMap.entries()).reduce(function (prev, cur) {
42108
42106
  var _a;
42109
42107
  return (__assign(__assign({}, prev), (_a = {}, _a[cur[0]] = cur[1], _a)));
42110
42108
  }, {}));
42111
42109
  }
42110
+ ts.optionMapToObject = optionMapToObject;
42112
42111
  function filterSameAsDefaultInclude(specs) {
42113
42112
  if (!ts.length(specs))
42114
42113
  return undefined;
@@ -42157,9 +42156,11 @@ var ts;
42157
42156
  });
42158
42157
  }
42159
42158
  ts.getNameOfCompilerOptionValue = getNameOfCompilerOptionValue;
42159
+ /* @internal */
42160
42160
  function serializeCompilerOptions(options, pathOptions) {
42161
42161
  return serializeOptionBaseObject(options, getOptionsNameMap(), pathOptions);
42162
42162
  }
42163
+ ts.serializeCompilerOptions = serializeCompilerOptions;
42163
42164
  function serializeWatchOptions(options) {
42164
42165
  return serializeOptionBaseObject(options, getWatchOptionsNameMap());
42165
42166
  }
@@ -57722,16 +57723,32 @@ var ts;
57722
57723
  return getTypeFromTypeNode(typeNode);
57723
57724
  }
57724
57725
  }
57726
+ function isParameterOfContextSensitiveSignature(symbol) {
57727
+ var decl = symbol.valueDeclaration;
57728
+ if (!decl) {
57729
+ return false;
57730
+ }
57731
+ if (ts.isBindingElement(decl)) {
57732
+ decl = ts.walkUpBindingElementsAndPatterns(decl);
57733
+ }
57734
+ if (ts.isParameter(decl)) {
57735
+ return isContextSensitiveFunctionOrObjectLiteralMethod(decl.parent);
57736
+ }
57737
+ return false;
57738
+ }
57725
57739
  function getTypeOfVariableOrParameterOrProperty(symbol) {
57726
57740
  var links = getSymbolLinks(symbol);
57727
57741
  if (!links.type) {
57728
57742
  var type = getTypeOfVariableOrParameterOrPropertyWorker(symbol);
57729
57743
  // For a contextually typed parameter it is possible that a type has already
57730
57744
  // been assigned (in assignTypeToParameterAndFixTypeParameters), and we want
57731
- // to preserve this type.
57732
- if (!links.type) {
57745
+ // to preserve this type. In fact, we need to _prefer_ that type, but it won't
57746
+ // be assigned until contextual typing is complete, so we need to defer in
57747
+ // cases where contextual typing may take place.
57748
+ if (!links.type && !isParameterOfContextSensitiveSignature(symbol)) {
57733
57749
  links.type = type;
57734
57750
  }
57751
+ return type;
57735
57752
  }
57736
57753
  return links.type;
57737
57754
  }
@@ -118594,14 +118611,16 @@ var ts;
118594
118611
  }
118595
118612
  return setReadFileCache(key, fileName);
118596
118613
  };
118597
- var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersion, onError, shouldCreateNewSourceFile) {
118614
+ var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile) {
118598
118615
  var key = toPath(fileName);
118599
- var value = sourceFileCache.get(key);
118616
+ var impliedNodeFormat = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions.impliedNodeFormat : undefined;
118617
+ var forImpliedNodeFormat = sourceFileCache.get(impliedNodeFormat);
118618
+ var value = forImpliedNodeFormat === null || forImpliedNodeFormat === void 0 ? void 0 : forImpliedNodeFormat.get(key);
118600
118619
  if (value)
118601
118620
  return value;
118602
- var sourceFile = getSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile);
118621
+ var sourceFile = getSourceFile(fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile);
118603
118622
  if (sourceFile && (ts.isDeclarationFileName(fileName) || ts.fileExtensionIs(fileName, ".json" /* Extension.Json */))) {
118604
- sourceFileCache.set(key, sourceFile);
118623
+ sourceFileCache.set(impliedNodeFormat, (forImpliedNodeFormat || new ts.Map()).set(key, sourceFile));
118605
118624
  }
118606
118625
  return sourceFile;
118607
118626
  } : undefined;
@@ -118626,13 +118645,15 @@ var ts;
118626
118645
  var value = readFileCache.get(key);
118627
118646
  if (value !== undefined && value !== data) {
118628
118647
  readFileCache.delete(key);
118629
- sourceFileCache.delete(key);
118648
+ sourceFileCache.forEach(function (map) { return map.delete(key); });
118630
118649
  }
118631
118650
  else if (getSourceFileWithCache) {
118632
- var sourceFile = sourceFileCache.get(key);
118633
- if (sourceFile && sourceFile.text !== data) {
118634
- sourceFileCache.delete(key);
118635
- }
118651
+ sourceFileCache.forEach(function (map) {
118652
+ var sourceFile = map.get(key);
118653
+ if (sourceFile && sourceFile.text !== data) {
118654
+ map.delete(key);
118655
+ }
118656
+ });
118636
118657
  }
118637
118658
  originalWriteFile.call.apply(originalWriteFile, __spreadArray([host, fileName, data], rest, false));
118638
118659
  };
@@ -123329,7 +123350,8 @@ var ts;
123329
123350
  for (var _b = 0, _c = state.affectedFilesPendingEmit.slice(state.affectedFilesPendingEmitIndex).sort(ts.compareStringsCaseSensitive); _b < _c.length; _b++) {
123330
123351
  var path = _c[_b];
123331
123352
  if (ts.tryAddToSet(seenFiles, path)) {
123332
- (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push([toFileId(path), state.affectedFilesPendingEmitKind.get(path)]);
123353
+ var fileId = toFileId(path), emitKind = state.affectedFilesPendingEmitKind.get(path);
123354
+ (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push(emitKind === 1 /* BuilderFileEmit.Full */ ? fileId : [fileId]);
123333
123355
  }
123334
123356
  }
123335
123357
  }
@@ -123808,6 +123830,10 @@ var ts;
123808
123830
  { version: fileInfo.version, signature: fileInfo.signature === false ? undefined : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat };
123809
123831
  }
123810
123832
  ts.toBuilderStateFileInfo = toBuilderStateFileInfo;
123833
+ function toBuilderFileEmit(value) {
123834
+ return ts.isNumber(value) ? 1 /* BuilderFileEmit.Full */ : 0 /* BuilderFileEmit.DtsOnly */;
123835
+ }
123836
+ ts.toBuilderFileEmit = toBuilderFileEmit;
123811
123837
  function createBuilderProgramUsingProgramBuildInfo(program, buildInfoPath, host) {
123812
123838
  var _a, _b, _c, _d;
123813
123839
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
@@ -123849,8 +123875,8 @@ var ts;
123849
123875
  exportedModulesMap: toManyToManyPathMap(program.exportedModulesMap),
123850
123876
  semanticDiagnosticsPerFile: program.semanticDiagnosticsPerFile && ts.arrayToMap(program.semanticDiagnosticsPerFile, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }, function (value) { return ts.isNumber(value) ? ts.emptyArray : value[1]; }),
123851
123877
  hasReusableDiagnostic: true,
123852
- affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }),
123853
- affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }, function (value) { return value[1]; }),
123878
+ affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }),
123879
+ affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }, toBuilderFileEmit),
123854
123880
  affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
123855
123881
  changedFilesSet: new ts.Set(ts.map(program.changeFileSet, toFilePath)),
123856
123882
  latestChangedDtsFile: latestChangedDtsFile,
@@ -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.9";
88
+ ts.versionMajorMinor = "5.0";
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 = "".concat(ts.versionMajorMinor, ".0-dev.20221031");
92
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221101");
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -40363,9 +40363,6 @@ var ts;
40363
40363
  name: "listFilesOnly",
40364
40364
  type: "boolean",
40365
40365
  category: ts.Diagnostics.Command_line_Options,
40366
- affectsSemanticDiagnostics: true,
40367
- affectsEmit: true,
40368
- affectsMultiFileEmitBuildInfo: true,
40369
40366
  isCommandLineOnly: true,
40370
40367
  description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
40371
40368
  defaultValueDescription: false,
@@ -42093,12 +42090,14 @@ var ts;
42093
42090
  return config;
42094
42091
  }
42095
42092
  ts.convertToTSConfig = convertToTSConfig;
42093
+ /*@internal*/
42096
42094
  function optionMapToObject(optionMap) {
42097
42095
  return __assign({}, ts.arrayFrom(optionMap.entries()).reduce(function (prev, cur) {
42098
42096
  var _a;
42099
42097
  return (__assign(__assign({}, prev), (_a = {}, _a[cur[0]] = cur[1], _a)));
42100
42098
  }, {}));
42101
42099
  }
42100
+ ts.optionMapToObject = optionMapToObject;
42102
42101
  function filterSameAsDefaultInclude(specs) {
42103
42102
  if (!ts.length(specs))
42104
42103
  return undefined;
@@ -42147,9 +42146,11 @@ var ts;
42147
42146
  });
42148
42147
  }
42149
42148
  ts.getNameOfCompilerOptionValue = getNameOfCompilerOptionValue;
42149
+ /* @internal */
42150
42150
  function serializeCompilerOptions(options, pathOptions) {
42151
42151
  return serializeOptionBaseObject(options, getOptionsNameMap(), pathOptions);
42152
42152
  }
42153
+ ts.serializeCompilerOptions = serializeCompilerOptions;
42153
42154
  function serializeWatchOptions(options) {
42154
42155
  return serializeOptionBaseObject(options, getWatchOptionsNameMap());
42155
42156
  }
@@ -57712,16 +57713,32 @@ var ts;
57712
57713
  return getTypeFromTypeNode(typeNode);
57713
57714
  }
57714
57715
  }
57716
+ function isParameterOfContextSensitiveSignature(symbol) {
57717
+ var decl = symbol.valueDeclaration;
57718
+ if (!decl) {
57719
+ return false;
57720
+ }
57721
+ if (ts.isBindingElement(decl)) {
57722
+ decl = ts.walkUpBindingElementsAndPatterns(decl);
57723
+ }
57724
+ if (ts.isParameter(decl)) {
57725
+ return isContextSensitiveFunctionOrObjectLiteralMethod(decl.parent);
57726
+ }
57727
+ return false;
57728
+ }
57715
57729
  function getTypeOfVariableOrParameterOrProperty(symbol) {
57716
57730
  var links = getSymbolLinks(symbol);
57717
57731
  if (!links.type) {
57718
57732
  var type = getTypeOfVariableOrParameterOrPropertyWorker(symbol);
57719
57733
  // For a contextually typed parameter it is possible that a type has already
57720
57734
  // been assigned (in assignTypeToParameterAndFixTypeParameters), and we want
57721
- // to preserve this type.
57722
- if (!links.type) {
57735
+ // to preserve this type. In fact, we need to _prefer_ that type, but it won't
57736
+ // be assigned until contextual typing is complete, so we need to defer in
57737
+ // cases where contextual typing may take place.
57738
+ if (!links.type && !isParameterOfContextSensitiveSignature(symbol)) {
57723
57739
  links.type = type;
57724
57740
  }
57741
+ return type;
57725
57742
  }
57726
57743
  return links.type;
57727
57744
  }
@@ -118584,14 +118601,16 @@ var ts;
118584
118601
  }
118585
118602
  return setReadFileCache(key, fileName);
118586
118603
  };
118587
- var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersion, onError, shouldCreateNewSourceFile) {
118604
+ var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile) {
118588
118605
  var key = toPath(fileName);
118589
- var value = sourceFileCache.get(key);
118606
+ var impliedNodeFormat = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions.impliedNodeFormat : undefined;
118607
+ var forImpliedNodeFormat = sourceFileCache.get(impliedNodeFormat);
118608
+ var value = forImpliedNodeFormat === null || forImpliedNodeFormat === void 0 ? void 0 : forImpliedNodeFormat.get(key);
118590
118609
  if (value)
118591
118610
  return value;
118592
- var sourceFile = getSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile);
118611
+ var sourceFile = getSourceFile(fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile);
118593
118612
  if (sourceFile && (ts.isDeclarationFileName(fileName) || ts.fileExtensionIs(fileName, ".json" /* Extension.Json */))) {
118594
- sourceFileCache.set(key, sourceFile);
118613
+ sourceFileCache.set(impliedNodeFormat, (forImpliedNodeFormat || new ts.Map()).set(key, sourceFile));
118595
118614
  }
118596
118615
  return sourceFile;
118597
118616
  } : undefined;
@@ -118616,13 +118635,15 @@ var ts;
118616
118635
  var value = readFileCache.get(key);
118617
118636
  if (value !== undefined && value !== data) {
118618
118637
  readFileCache.delete(key);
118619
- sourceFileCache.delete(key);
118638
+ sourceFileCache.forEach(function (map) { return map.delete(key); });
118620
118639
  }
118621
118640
  else if (getSourceFileWithCache) {
118622
- var sourceFile = sourceFileCache.get(key);
118623
- if (sourceFile && sourceFile.text !== data) {
118624
- sourceFileCache.delete(key);
118625
- }
118641
+ sourceFileCache.forEach(function (map) {
118642
+ var sourceFile = map.get(key);
118643
+ if (sourceFile && sourceFile.text !== data) {
118644
+ map.delete(key);
118645
+ }
118646
+ });
118626
118647
  }
118627
118648
  originalWriteFile.call.apply(originalWriteFile, __spreadArray([host, fileName, data], rest, false));
118628
118649
  };
@@ -123319,7 +123340,8 @@ var ts;
123319
123340
  for (var _b = 0, _c = state.affectedFilesPendingEmit.slice(state.affectedFilesPendingEmitIndex).sort(ts.compareStringsCaseSensitive); _b < _c.length; _b++) {
123320
123341
  var path = _c[_b];
123321
123342
  if (ts.tryAddToSet(seenFiles, path)) {
123322
- (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push([toFileId(path), state.affectedFilesPendingEmitKind.get(path)]);
123343
+ var fileId = toFileId(path), emitKind = state.affectedFilesPendingEmitKind.get(path);
123344
+ (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push(emitKind === 1 /* BuilderFileEmit.Full */ ? fileId : [fileId]);
123323
123345
  }
123324
123346
  }
123325
123347
  }
@@ -123798,6 +123820,10 @@ var ts;
123798
123820
  { version: fileInfo.version, signature: fileInfo.signature === false ? undefined : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat };
123799
123821
  }
123800
123822
  ts.toBuilderStateFileInfo = toBuilderStateFileInfo;
123823
+ function toBuilderFileEmit(value) {
123824
+ return ts.isNumber(value) ? 1 /* BuilderFileEmit.Full */ : 0 /* BuilderFileEmit.DtsOnly */;
123825
+ }
123826
+ ts.toBuilderFileEmit = toBuilderFileEmit;
123801
123827
  function createBuilderProgramUsingProgramBuildInfo(program, buildInfoPath, host) {
123802
123828
  var _a, _b, _c, _d;
123803
123829
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
@@ -123839,8 +123865,8 @@ var ts;
123839
123865
  exportedModulesMap: toManyToManyPathMap(program.exportedModulesMap),
123840
123866
  semanticDiagnosticsPerFile: program.semanticDiagnosticsPerFile && ts.arrayToMap(program.semanticDiagnosticsPerFile, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }, function (value) { return ts.isNumber(value) ? ts.emptyArray : value[1]; }),
123841
123867
  hasReusableDiagnostic: true,
123842
- affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }),
123843
- affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }, function (value) { return value[1]; }),
123868
+ affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }),
123869
+ affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }, toBuilderFileEmit),
123844
123870
  affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
123845
123871
  changedFilesSet: new ts.Set(ts.map(program.changeFileSet, toFilePath)),
123846
123872
  latestChangedDtsFile: latestChangedDtsFile,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "4.9.0-dev.20221031",
5
+ "version": "5.0.0-dev.20221101",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [