typescript 4.6.0-dev.20220118 → 4.6.0-dev.20220119

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.
@@ -89,7 +89,7 @@ var ts;
89
89
  // The following is baselined as a literal template type without intervention
90
90
  /** The version of the TypeScript compiler release */
91
91
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
92
- ts.version = ts.versionMajorMinor + ".0-dev.20220118";
92
+ ts.version = ts.versionMajorMinor + ".0-dev.20220119";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -44486,7 +44486,7 @@ var ts;
44486
44486
  maybeBindExpressionFlowIfCall(node.expression);
44487
44487
  }
44488
44488
  function maybeBindExpressionFlowIfCall(node) {
44489
- // A top level or LHS of comma expression call expression with a dotted function name and at least one argument
44489
+ // A top level or comma expression call expression with a dotted function name and at least one argument
44490
44490
  // is potentially an assertion and is therefore included in the control flow.
44491
44491
  if (node.kind === 207 /* CallExpression */) {
44492
44492
  var call = node;
@@ -44654,22 +44654,27 @@ var ts;
44654
44654
  }
44655
44655
  return state;
44656
44656
  }
44657
- function onLeft(left, state, _node) {
44657
+ function onLeft(left, state, node) {
44658
44658
  if (!state.skip) {
44659
- return maybeBind(left);
44659
+ var maybeBound = maybeBind(left);
44660
+ if (node.operatorToken.kind === 27 /* CommaToken */) {
44661
+ maybeBindExpressionFlowIfCall(left);
44662
+ }
44663
+ return maybeBound;
44660
44664
  }
44661
44665
  }
44662
- function onOperator(operatorToken, state, node) {
44666
+ function onOperator(operatorToken, state, _node) {
44663
44667
  if (!state.skip) {
44664
- if (operatorToken.kind === 27 /* CommaToken */) {
44665
- maybeBindExpressionFlowIfCall(node.left);
44666
- }
44667
44668
  bind(operatorToken);
44668
44669
  }
44669
44670
  }
44670
- function onRight(right, state, _node) {
44671
+ function onRight(right, state, node) {
44671
44672
  if (!state.skip) {
44672
- return maybeBind(right);
44673
+ var maybeBound = maybeBind(right);
44674
+ if (node.operatorToken.kind === 27 /* CommaToken */) {
44675
+ maybeBindExpressionFlowIfCall(right);
44676
+ }
44677
+ return maybeBound;
44673
44678
  }
44674
44679
  }
44675
44680
  function onExit(node, state) {
@@ -50946,6 +50951,7 @@ var ts;
50946
50951
  getCommonSourceDirectory: !!host.getCommonSourceDirectory ? function () { return host.getCommonSourceDirectory(); } : function () { return ""; },
50947
50952
  getCurrentDirectory: function () { return host.getCurrentDirectory(); },
50948
50953
  getSymlinkCache: ts.maybeBind(host, host.getSymlinkCache),
50954
+ getPackageJsonInfoCache: function () { var _a; return (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host); },
50949
50955
  useCaseSensitiveFileNames: ts.maybeBind(host, host.useCaseSensitiveFileNames),
50950
50956
  redirectTargetsMap: host.redirectTargetsMap,
50951
50957
  getProjectReferenceRedirect: function (fileName) { return host.getProjectReferenceRedirect(fileName); },
@@ -95518,10 +95524,19 @@ var ts;
95518
95524
  var _a;
95519
95525
  var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
95520
95526
  var isStaticChildren = ts.length(nonWhitespaceChildren) > 1 || !!((_a = nonWhitespaceChildren[0]) === null || _a === void 0 ? void 0 : _a.dotDotDotToken);
95521
- var args = [tagName, objectProperties, !keyAttr ? factory.createVoidZero() : transformJsxAttributeInitializer(keyAttr.initializer)];
95527
+ var args = [tagName, objectProperties];
95528
+ // function jsx(type, config, maybeKey) {}
95529
+ // "maybeKey" is optional. It is acceptable to use "_jsx" without a third argument
95530
+ if (keyAttr) {
95531
+ args.push(transformJsxAttributeInitializer(keyAttr.initializer));
95532
+ }
95522
95533
  if (compilerOptions.jsx === 5 /* ReactJSXDev */) {
95523
95534
  var originalFile = ts.getOriginalNode(currentSourceFile);
95524
95535
  if (originalFile && ts.isSourceFile(originalFile)) {
95536
+ // "maybeKey" has to be replaced with "void 0" to not break the jsxDEV signature
95537
+ if (keyAttr === undefined) {
95538
+ args.push(factory.createVoidZero());
95539
+ }
95525
95540
  // isStaticChildren development flag
95526
95541
  args.push(isStaticChildren ? factory.createTrue() : factory.createFalse());
95527
95542
  // __source development flag
@@ -119386,11 +119401,12 @@ var ts;
119386
119401
  };
119387
119402
  }
119388
119403
  function isFormatRequiringExtensions(compilerOptions, importingSourceFileName, host) {
119404
+ var _a;
119389
119405
  if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node12
119390
119406
  && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
119391
119407
  return false;
119392
119408
  }
119393
- return ts.getImpliedNodeFormatForFile(importingSourceFileName, /*packageJsonInfoCache*/ undefined, getModuleResolutionHost(host), compilerOptions) !== ts.ModuleKind.CommonJS;
119409
+ return ts.getImpliedNodeFormatForFile(importingSourceFileName, (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host), getModuleResolutionHost(host), compilerOptions) !== ts.ModuleKind.CommonJS;
119394
119410
  }
119395
119411
  function getModuleResolutionHost(host) {
119396
119412
  var _a;
@@ -119950,11 +119966,13 @@ var ts;
119950
119966
  // For classic resolution, only allow importing from node_modules/@types, not other node_modules
119951
119967
  return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Classic && packageName === nodeModulesDirectoryName ? undefined : packageName;
119952
119968
  function tryDirectoryWithPackageJson(packageRootIndex) {
119969
+ var _a, _b;
119953
119970
  var packageRootPath = path.substring(0, packageRootIndex);
119954
119971
  var packageJsonPath = ts.combinePaths(packageRootPath, "package.json");
119955
119972
  var moduleFileToTry = path;
119956
- if (host.fileExists(packageJsonPath)) {
119957
- var packageJsonContent = JSON.parse(host.readFile(packageJsonPath));
119973
+ var cachedPackageJson = (_b = (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host)) === null || _b === void 0 ? void 0 : _b.getPackageJsonInfo(packageJsonPath);
119974
+ if (typeof cachedPackageJson === "object" || cachedPackageJson === undefined && host.fileExists(packageJsonPath)) {
119975
+ var packageJsonContent = (cachedPackageJson === null || cachedPackageJson === void 0 ? void 0 : cachedPackageJson.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath));
119958
119976
  if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
119959
119977
  // `conditions` *could* be made to go against `importingSourceFile.impliedNodeFormat` if something wanted to generate
119960
119978
  // an ImportEqualsDeclaration in an ESM-implied file or an ImportCall in a CJS-implied file. But since this function is
@@ -120793,6 +120811,7 @@ var ts;
120793
120811
  var sharedExtendedConfigFileWatchers; // Map of file watchers for extended files, shared between different referenced projects
120794
120812
  var extendedConfigCache = host.extendedConfigCache; // Cache for extended config evaluation
120795
120813
  var changesAffectResolution = false; // Flag for indicating non-config changes affect module resolution
120814
+ var reportFileChangeDetectedOnCreateProgram = false; // True if synchronizeProgram should report "File change detected..." when a new program is created
120796
120815
  var sourceFilesCache = new ts.Map(); // Cache that stores the source file and version info
120797
120816
  var missingFilePathsRequestedForRelease; // These paths are held temporarily so that we can remove the entry from source file cache if the file is not tracked by missing files
120798
120817
  var hasChangedCompilerOptions = false; // True if the compiler options have changed between compilations
@@ -120955,14 +120974,21 @@ var ts;
120955
120974
  var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution || changesAffectResolution);
120956
120975
  if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
120957
120976
  if (hasChangedConfigFileParsingErrors) {
120977
+ if (reportFileChangeDetectedOnCreateProgram) {
120978
+ reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
120979
+ }
120958
120980
  builderProgram = createProgram(/*rootNames*/ undefined, /*options*/ undefined, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences);
120959
120981
  hasChangedConfigFileParsingErrors = false;
120960
120982
  }
120961
120983
  }
120962
120984
  else {
120985
+ if (reportFileChangeDetectedOnCreateProgram) {
120986
+ reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
120987
+ }
120963
120988
  createNewProgram(hasInvalidatedResolution);
120964
120989
  }
120965
120990
  changesAffectResolution = false; // reset for next sync
120991
+ reportFileChangeDetectedOnCreateProgram = false;
120966
120992
  if (host.afterProgramCreate && program !== builderProgram) {
120967
120993
  host.afterProgramCreate(builderProgram);
120968
120994
  }
@@ -121164,7 +121190,7 @@ var ts;
121164
121190
  }
121165
121191
  function updateProgramWithWatchStatus() {
121166
121192
  timerToUpdateProgram = undefined;
121167
- reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
121193
+ reportFileChangeDetectedOnCreateProgram = true;
121168
121194
  updateProgram();
121169
121195
  }
121170
121196
  function updateProgram() {
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.6.0-dev.20220118",
5
+ "version": "4.6.0-dev.20220119",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [