typescript 4.6.0-dev.20220117 → 4.6.0-dev.20220121

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.6";
72
- ts.version = ts.versionMajorMinor + ".0-dev.20220117";
72
+ ts.version = ts.versionMajorMinor + ".0-dev.20220121";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  function tryGetNativeMap() {
@@ -4171,9 +4171,13 @@ var ts;
4171
4171
  }
4172
4172
  ts.getFileWatcherEventKind = getFileWatcherEventKind;
4173
4173
  ts.ignoredPaths = ["/node_modules/.", "/.git", "/.#"];
4174
- ts.sysLog = ts.noop;
4174
+ var curSysLog = ts.noop;
4175
+ function sysLog(s) {
4176
+ return curSysLog(s);
4177
+ }
4178
+ ts.sysLog = sysLog;
4175
4179
  function setSysLog(logger) {
4176
- ts.sysLog = logger;
4180
+ curSysLog = logger;
4177
4181
  }
4178
4182
  ts.setSysLog = setSysLog;
4179
4183
  function createDirectoryWatcherSupportingRecursive(_a) {
@@ -4293,7 +4297,7 @@ var ts;
4293
4297
  }
4294
4298
  function onTimerToUpdateChildWatches() {
4295
4299
  timerToUpdateChildWatches = undefined;
4296
- ts.sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size);
4300
+ sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size);
4297
4301
  var start = ts.timestamp();
4298
4302
  var invokeMap = new ts.Map();
4299
4303
  while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) {
@@ -4304,7 +4308,7 @@ var ts;
4304
4308
  var hasChanges = updateChildWatches(dirName, dirPath, options);
4305
4309
  invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames);
4306
4310
  }
4307
- ts.sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size);
4311
+ sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size);
4308
4312
  callbackCache.forEach(function (callbacks, rootDirName) {
4309
4313
  var existing = invokeMap.get(rootDirName);
4310
4314
  if (existing) {
@@ -4320,7 +4324,7 @@ var ts;
4320
4324
  }
4321
4325
  });
4322
4326
  var elapsed = ts.timestamp() - start;
4323
- ts.sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches);
4327
+ sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches);
4324
4328
  }
4325
4329
  function removeChildWatches(parentWatcher) {
4326
4330
  if (!parentWatcher)
@@ -4822,7 +4826,7 @@ var ts;
4822
4826
  }
4823
4827
  };
4824
4828
  function invokeCallbackAndUpdateWatcher(createWatcher) {
4825
- ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
4829
+ sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
4826
4830
  callback("rename", "");
4827
4831
  if (watcher) {
4828
4832
  watcher.close();
@@ -4839,7 +4843,7 @@ var ts;
4839
4843
  }
4840
4844
  }
4841
4845
  if (hitSystemWatcherLimit) {
4842
- ts.sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
4846
+ sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
4843
4847
  return watchPresentFileSystemEntryWithFsWatchFile();
4844
4848
  }
4845
4849
  try {
@@ -4851,7 +4855,7 @@ var ts;
4851
4855
  }
4852
4856
  catch (e) {
4853
4857
  hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
4854
- ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
4858
+ sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
4855
4859
  return watchPresentFileSystemEntryWithFsWatchFile();
4856
4860
  }
4857
4861
  }
@@ -5419,6 +5423,7 @@ var ts;
5419
5423
  Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, ts.DiagnosticCategory.Error, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),
5420
5424
  The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),
5421
5425
  Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead: diag(1471, ts.DiagnosticCategory.Error, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead."),
5426
+ catch_or_finally_expected: diag(1472, ts.DiagnosticCategory.Error, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
5422
5427
  The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
5423
5428
  The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
5424
5429
  Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", undefined, true),
@@ -5906,6 +5911,7 @@ var ts;
5906
5911
  Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, ts.DiagnosticCategory.Error, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path."),
5907
5912
  Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0: diag(2835, ts.DiagnosticCategory.Error, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean '{0}'?"),
5908
5913
  Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls: diag(2836, ts.DiagnosticCategory.Error, "Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls_2836", "Import assertions are not allowed on statements that transpile to commonjs 'require' calls."),
5914
+ Import_assertion_values_must_be_string_literal_expressions: diag(2837, ts.DiagnosticCategory.Error, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."),
5909
5915
  Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
5910
5916
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
5911
5917
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -6299,7 +6305,7 @@ var ts;
6299
6305
  Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
6300
6306
  _0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, ts.DiagnosticCategory.Error, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"),
6301
6307
  Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
6302
- Found_0_errors_in_1_file: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_file_6260", "Found {0} errors in 1 file."),
6308
+ Found_0_errors_in_the_same_file_starting_at_Colon_1: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_the_same_file_starting_at_Colon_1_6260", "Found {0} errors in the same file, starting at: {1}"),
6303
6309
  Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
6304
6310
  Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, ts.DiagnosticCategory.Message, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."),
6305
6311
  Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, ts.DiagnosticCategory.Message, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."),
@@ -12277,7 +12283,7 @@ var ts;
12277
12283
  }
12278
12284
  ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression;
12279
12285
  function getExternalModuleRequireArgument(node) {
12280
- return isRequireVariableDeclaration(node) && getLeftmostAccessExpression(node.initializer).arguments[0];
12286
+ return isVariableDeclarationInitializedToBareOrAccessedRequire(node) && getLeftmostAccessExpression(node.initializer).arguments[0];
12281
12287
  }
12282
12288
  ts.getExternalModuleRequireArgument = getExternalModuleRequireArgument;
12283
12289
  function isInternalModuleImportEqualsDeclaration(node) {
@@ -12331,17 +12337,26 @@ var ts;
12331
12337
  return !requireStringLiteralLikeArgument || ts.isStringLiteralLike(arg);
12332
12338
  }
12333
12339
  ts.isRequireCall = isRequireCall;
12334
- function isRequireVariableDeclaration(node) {
12340
+ function isVariableDeclarationInitializedToRequire(node) {
12341
+ return isVariableDeclarationInitializedWithRequireHelper(node, false);
12342
+ }
12343
+ ts.isVariableDeclarationInitializedToRequire = isVariableDeclarationInitializedToRequire;
12344
+ function isVariableDeclarationInitializedToBareOrAccessedRequire(node) {
12345
+ return isVariableDeclarationInitializedWithRequireHelper(node, true);
12346
+ }
12347
+ ts.isVariableDeclarationInitializedToBareOrAccessedRequire = isVariableDeclarationInitializedToBareOrAccessedRequire;
12348
+ function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) {
12335
12349
  if (node.kind === 202) {
12336
12350
  node = node.parent.parent;
12337
12351
  }
12338
- return ts.isVariableDeclaration(node) && !!node.initializer && isRequireCall(getLeftmostAccessExpression(node.initializer), true);
12352
+ return ts.isVariableDeclaration(node) &&
12353
+ !!node.initializer &&
12354
+ isRequireCall(allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer, true);
12339
12355
  }
12340
- ts.isRequireVariableDeclaration = isRequireVariableDeclaration;
12341
12356
  function isRequireVariableStatement(node) {
12342
12357
  return ts.isVariableStatement(node)
12343
12358
  && node.declarationList.declarations.length > 0
12344
- && ts.every(node.declarationList.declarations, function (decl) { return isRequireVariableDeclaration(decl); });
12359
+ && ts.every(node.declarationList.declarations, function (decl) { return isVariableDeclarationInitializedToRequire(decl); });
12345
12360
  }
12346
12361
  ts.isRequireVariableStatement = isRequireVariableStatement;
12347
12362
  function isSingleOrDoubleQuote(charCode) {
@@ -15301,7 +15316,7 @@ var ts;
15301
15316
  getSourceMapSourceConstructor: function () { return SourceMapSource; },
15302
15317
  };
15303
15318
  function setObjectAllocator(alloc) {
15304
- ts.objectAllocator = alloc;
15319
+ Object.assign(ts.objectAllocator, alloc);
15305
15320
  }
15306
15321
  ts.setObjectAllocator = setObjectAllocator;
15307
15322
  function formatStringFromArgs(text, args, baseIndex) {
@@ -15309,12 +15324,19 @@ var ts;
15309
15324
  return text.replace(/{(\d+)}/g, function (_match, index) { return "" + ts.Debug.checkDefined(args[+index + baseIndex]); });
15310
15325
  }
15311
15326
  ts.formatStringFromArgs = formatStringFromArgs;
15327
+ var localizedDiagnosticMessages;
15312
15328
  function setLocalizedDiagnosticMessages(messages) {
15313
- ts.localizedDiagnosticMessages = messages;
15329
+ localizedDiagnosticMessages = messages;
15314
15330
  }
15315
15331
  ts.setLocalizedDiagnosticMessages = setLocalizedDiagnosticMessages;
15332
+ function maybeSetLocalizedDiagnosticMessages(getMessages) {
15333
+ if (!localizedDiagnosticMessages && getMessages) {
15334
+ localizedDiagnosticMessages = getMessages();
15335
+ }
15336
+ }
15337
+ ts.maybeSetLocalizedDiagnosticMessages = maybeSetLocalizedDiagnosticMessages;
15316
15338
  function getLocaleSpecificMessage(message) {
15317
- return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message.key] || message.message;
15339
+ return localizedDiagnosticMessages && localizedDiagnosticMessages[message.key] || message.message;
15318
15340
  }
15319
15341
  ts.getLocaleSpecificMessage = getLocaleSpecificMessage;
15320
15342
  function createDetachedDiagnostic(fileName, start, length, message) {
@@ -28164,7 +28186,7 @@ var ts;
28164
28186
  var catchClause = token() === 83 ? parseCatchClause() : undefined;
28165
28187
  var finallyBlock;
28166
28188
  if (!catchClause || token() === 96) {
28167
- parseExpected(96);
28189
+ parseExpected(96, ts.Diagnostics.catch_or_finally_expected);
28168
28190
  finallyBlock = parseBlock(false);
28169
28191
  }
28170
28192
  return withJSDoc(finishNode(factory.createTryStatement(tryBlock, catchClause, finallyBlock), pos), hasJSDoc);
@@ -29088,7 +29110,7 @@ var ts;
29088
29110
  var pos = getNodePos();
29089
29111
  var name = ts.tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(10);
29090
29112
  parseExpected(58);
29091
- var value = parseLiteralLikeNode(10);
29113
+ var value = parseAssignmentExpressionOrHigher();
29092
29114
  return finishNode(factory.createAssertEntry(name, value), pos);
29093
29115
  }
29094
29116
  function parseAssertClause() {
@@ -36576,22 +36598,27 @@ var ts;
36576
36598
  }
36577
36599
  return state;
36578
36600
  }
36579
- function onLeft(left, state, _node) {
36601
+ function onLeft(left, state, node) {
36580
36602
  if (!state.skip) {
36581
- return maybeBind(left);
36603
+ var maybeBound = maybeBind(left);
36604
+ if (node.operatorToken.kind === 27) {
36605
+ maybeBindExpressionFlowIfCall(left);
36606
+ }
36607
+ return maybeBound;
36582
36608
  }
36583
36609
  }
36584
- function onOperator(operatorToken, state, node) {
36610
+ function onOperator(operatorToken, state, _node) {
36585
36611
  if (!state.skip) {
36586
- if (operatorToken.kind === 27) {
36587
- maybeBindExpressionFlowIfCall(node.left);
36588
- }
36589
36612
  bind(operatorToken);
36590
36613
  }
36591
36614
  }
36592
- function onRight(right, state, _node) {
36615
+ function onRight(right, state, node) {
36593
36616
  if (!state.skip) {
36594
- return maybeBind(right);
36617
+ var maybeBound = maybeBind(right);
36618
+ if (node.operatorToken.kind === 27) {
36619
+ maybeBindExpressionFlowIfCall(right);
36620
+ }
36621
+ return maybeBound;
36595
36622
  }
36596
36623
  }
36597
36624
  function onExit(node, state) {
@@ -37222,6 +37249,8 @@ var ts;
37222
37249
  return;
37223
37250
  }
37224
37251
  ts.setParent(node, parent);
37252
+ if (ts.tracing)
37253
+ node.tracingPath = file.path;
37225
37254
  var saveInStrictMode = inStrictMode;
37226
37255
  bindWorker(node);
37227
37256
  if (node.kind > 159) {
@@ -37927,7 +37956,7 @@ var ts;
37927
37956
  checkStrictModeEvalOrArguments(node, node.name);
37928
37957
  }
37929
37958
  if (!ts.isBindingPattern(node.name)) {
37930
- if (ts.isInJSFile(node) && ts.isRequireVariableDeclaration(node) && !ts.getJSDocTypeTag(node)) {
37959
+ if (ts.isInJSFile(node) && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node) && !ts.getJSDocTypeTag(node)) {
37931
37960
  declareSymbolAndAddToSymbolTable(node, 2097152, 2097152);
37932
37961
  }
37933
37962
  else if (ts.isBlockOrCatchScoped(node)) {
@@ -40205,7 +40234,7 @@ var ts;
40205
40234
  && isAliasableOrJsExpression(node.parent.right)
40206
40235
  || node.kind === 295
40207
40236
  || node.kind === 294 && isAliasableOrJsExpression(node.initializer)
40208
- || ts.isRequireVariableDeclaration(node);
40237
+ || ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node);
40209
40238
  }
40210
40239
  function isAliasableOrJsExpression(e) {
40211
40240
  return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e);
@@ -40897,8 +40926,13 @@ var ts;
40897
40926
  var mode = contextSpecifier && ts.isStringLiteralLike(contextSpecifier) ? ts.getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
40898
40927
  var resolvedModule = ts.getResolvedModule(currentSourceFile, moduleReference, mode);
40899
40928
  var resolutionDiagnostic = resolvedModule && ts.getResolutionDiagnostic(compilerOptions, resolvedModule);
40900
- var sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName);
40929
+ var sourceFile = resolvedModule
40930
+ && (!resolutionDiagnostic || resolutionDiagnostic === ts.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set)
40931
+ && host.getSourceFile(resolvedModule.resolvedFileName);
40901
40932
  if (sourceFile) {
40933
+ if (resolutionDiagnostic) {
40934
+ error(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName);
40935
+ }
40902
40936
  if (sourceFile.symbol) {
40903
40937
  if (resolvedModule.isExternalLibraryImport && !ts.resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
40904
40938
  errorOnImplicitAnyModule(false, errorNode, resolvedModule, moduleReference);
@@ -41901,6 +41935,7 @@ var ts;
41901
41935
  getCommonSourceDirectory: !!host.getCommonSourceDirectory ? function () { return host.getCommonSourceDirectory(); } : function () { return ""; },
41902
41936
  getCurrentDirectory: function () { return host.getCurrentDirectory(); },
41903
41937
  getSymlinkCache: ts.maybeBind(host, host.getSymlinkCache),
41938
+ getPackageJsonInfoCache: function () { var _a; return (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host); },
41904
41939
  useCaseSensitiveFileNames: ts.maybeBind(host, host.useCaseSensitiveFileNames),
41905
41940
  redirectTargetsMap: host.redirectTargetsMap,
41906
41941
  getProjectReferenceRedirect: function (fileName) { return host.getProjectReferenceRedirect(fileName); },
@@ -65251,7 +65286,7 @@ var ts;
65251
65286
  }
65252
65287
  }
65253
65288
  function checkExpression(node, checkMode, forceTuple) {
65254
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkExpression", { kind: node.kind, pos: node.pos, end: node.end });
65289
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkExpression", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
65255
65290
  var saveCurrentNode = currentNode;
65256
65291
  currentNode = node;
65257
65292
  instantiationCount = 0;
@@ -67508,7 +67543,7 @@ var ts;
67508
67543
  return;
67509
67544
  }
67510
67545
  var symbol = getSymbolOfNode(node);
67511
- if (symbol.flags & 2097152 && ts.isRequireVariableDeclaration(node)) {
67546
+ if (symbol.flags & 2097152 && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node)) {
67512
67547
  checkAliasSymbol(node);
67513
67548
  return;
67514
67549
  }
@@ -67580,7 +67615,7 @@ var ts;
67580
67615
  return ts.getSelectedEffectiveModifierFlags(left, interestingFlags) === ts.getSelectedEffectiveModifierFlags(right, interestingFlags);
67581
67616
  }
67582
67617
  function checkVariableDeclaration(node) {
67583
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end });
67618
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
67584
67619
  checkGrammarVariableDeclaration(node);
67585
67620
  checkVariableLikeDeclaration(node);
67586
67621
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
@@ -69569,6 +69604,17 @@ var ts;
69569
69604
  return false;
69570
69605
  }
69571
69606
  }
69607
+ if (!ts.isImportEqualsDeclaration(node) && node.assertClause) {
69608
+ var hasError = false;
69609
+ for (var _i = 0, _a = node.assertClause.elements; _i < _a.length; _i++) {
69610
+ var clause = _a[_i];
69611
+ if (!ts.isStringLiteral(clause.value)) {
69612
+ hasError = true;
69613
+ error(clause.value, ts.Diagnostics.Import_assertion_values_must_be_string_literal_expressions);
69614
+ }
69615
+ }
69616
+ return !hasError;
69617
+ }
69572
69618
  return true;
69573
69619
  }
69574
69620
  function checkAliasSymbol(node) {
@@ -70204,7 +70250,7 @@ var ts;
70204
70250
  }
70205
70251
  }
70206
70252
  function checkDeferredNode(node) {
70207
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkDeferredNode", { kind: node.kind, pos: node.pos, end: node.end });
70253
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkDeferredNode", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
70208
70254
  var saveCurrentNode = currentNode;
70209
70255
  currentNode = node;
70210
70256
  instantiationCount = 0;
@@ -73784,7 +73830,7 @@ var ts;
73784
73830
  return factory.updateAssertClause(node, nodesVisitor(node.elements, visitor, ts.isAssertEntry), node.multiLine);
73785
73831
  case 293:
73786
73832
  ts.Debug.type(node);
73787
- return factory.updateAssertEntry(node, nodeVisitor(node.name, visitor, ts.isAssertionKey), nodeVisitor(node.value, visitor, ts.isStringLiteral));
73833
+ return factory.updateAssertEntry(node, nodeVisitor(node.name, visitor, ts.isAssertionKey), nodeVisitor(node.value, visitor, ts.isExpressionNode));
73788
73834
  case 266:
73789
73835
  ts.Debug.type(node);
73790
73836
  return factory.updateImportClause(node, node.isTypeOnly, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.namedBindings, visitor, ts.isNamedImportBindings));
@@ -79784,10 +79830,16 @@ var ts;
79784
79830
  var _a;
79785
79831
  var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
79786
79832
  var isStaticChildren = ts.length(nonWhitespaceChildren) > 1 || !!((_a = nonWhitespaceChildren[0]) === null || _a === void 0 ? void 0 : _a.dotDotDotToken);
79787
- var args = [tagName, objectProperties, !keyAttr ? factory.createVoidZero() : transformJsxAttributeInitializer(keyAttr.initializer)];
79833
+ var args = [tagName, objectProperties];
79834
+ if (keyAttr) {
79835
+ args.push(transformJsxAttributeInitializer(keyAttr.initializer));
79836
+ }
79788
79837
  if (compilerOptions.jsx === 5) {
79789
79838
  var originalFile = ts.getOriginalNode(currentSourceFile);
79790
79839
  if (originalFile && ts.isSourceFile(originalFile)) {
79840
+ if (keyAttr === undefined) {
79841
+ args.push(factory.createVoidZero());
79842
+ }
79791
79843
  args.push(isStaticChildren ? factory.createTrue() : factory.createFalse());
79792
79844
  var lineCol = ts.getLineAndCharacterOfPosition(originalFile, location.pos);
79793
79845
  args.push(factory.createObjectLiteralExpression([
@@ -98634,11 +98686,12 @@ var ts;
98634
98686
  };
98635
98687
  }
98636
98688
  function isFormatRequiringExtensions(compilerOptions, importingSourceFileName, host) {
98689
+ var _a;
98637
98690
  if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node12
98638
98691
  && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
98639
98692
  return false;
98640
98693
  }
98641
- return ts.getImpliedNodeFormatForFile(importingSourceFileName, undefined, getModuleResolutionHost(host), compilerOptions) !== ts.ModuleKind.CommonJS;
98694
+ return ts.getImpliedNodeFormatForFile(importingSourceFileName, (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host), getModuleResolutionHost(host), compilerOptions) !== ts.ModuleKind.CommonJS;
98642
98695
  }
98643
98696
  function getModuleResolutionHost(host) {
98644
98697
  var _a;
@@ -99111,11 +99164,13 @@ var ts;
99111
99164
  var packageName = ts.getPackageNameFromTypesPackageName(nodeModulesDirectoryName);
99112
99165
  return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Classic && packageName === nodeModulesDirectoryName ? undefined : packageName;
99113
99166
  function tryDirectoryWithPackageJson(packageRootIndex) {
99167
+ var _a, _b;
99114
99168
  var packageRootPath = path.substring(0, packageRootIndex);
99115
99169
  var packageJsonPath = ts.combinePaths(packageRootPath, "package.json");
99116
99170
  var moduleFileToTry = path;
99117
- if (host.fileExists(packageJsonPath)) {
99118
- var packageJsonContent = JSON.parse(host.readFile(packageJsonPath));
99171
+ var cachedPackageJson = (_b = (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host)) === null || _b === void 0 ? void 0 : _b.getPackageJsonInfo(packageJsonPath);
99172
+ if (typeof cachedPackageJson === "object" || cachedPackageJson === undefined && host.fileExists(packageJsonPath)) {
99173
+ var packageJsonContent = (cachedPackageJson === null || cachedPackageJson === void 0 ? void 0 : cachedPackageJson.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath));
99119
99174
  if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
99120
99175
  var conditions = ["node", importingSourceFile.impliedNodeFormat === ts.ModuleKind.ESNext ? "import" : "require", "types"];
99121
99176
  var fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string"
@@ -99382,22 +99437,31 @@ var ts;
99382
99437
  ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
99383
99438
  }
99384
99439
  ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
99440
+ function prettyPathForFileError(error, cwd) {
99441
+ var line = ts.formatColorAndReset(":" + error.line, ts.ForegroundColorEscapeSequences.Grey);
99442
+ if (ts.pathIsAbsolute(error.fileName) && ts.pathIsAbsolute(cwd)) {
99443
+ return ts.getRelativePathFromDirectory(cwd, error.fileName, false) + line;
99444
+ }
99445
+ return error.fileName + line;
99446
+ }
99385
99447
  function getErrorSummaryText(errorCount, filesInError, newLine, host) {
99386
99448
  if (errorCount === 0)
99387
99449
  return "";
99388
99450
  var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
99389
99451
  var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
99390
99452
  .filter(function (value, index, self) { return self.indexOf(value) === index; });
99453
+ var firstFileReference = nonNilFiles[0] && prettyPathForFileError(nonNilFiles[0], host.getCurrentDirectory());
99391
99454
  var d = errorCount === 1 ?
99392
99455
  ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
99393
99456
  ts.Diagnostics.Found_1_error_in_1 :
99394
- ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
99457
+ ts.Diagnostics.Found_1_error, errorCount, firstFileReference) :
99395
99458
  ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
99396
99459
  ts.Diagnostics.Found_0_errors :
99397
99460
  distinctFileNamesWithLines.length === 1 ?
99398
- ts.Diagnostics.Found_0_errors_in_1_file :
99399
- ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
99400
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : "");
99461
+ ts.Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1 :
99462
+ ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length === 1 ? firstFileReference : distinctFileNamesWithLines.length);
99463
+ var suffix = distinctFileNamesWithLines.length > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : "";
99464
+ return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + suffix;
99401
99465
  }
99402
99466
  ts.getErrorSummaryText = getErrorSummaryText;
99403
99467
  function createTabularErrorsDisplay(filesInError, host) {
@@ -99419,8 +99483,8 @@ var ts;
99419
99483
  var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
99420
99484
  " ".repeat(leftPaddingGoal - errorCountDigitsLength)
99421
99485
  : "";
99422
- var relativePath = ts.getRelativePathFromDirectory(host.getCurrentDirectory(), file.fileName, false);
99423
- tabularData += "" + leftPadding + errorCount + " " + relativePath + ":" + file.line + "\n";
99486
+ var fileRef = prettyPathForFileError(file, host.getCurrentDirectory());
99487
+ tabularData += "" + leftPadding + errorCount + " " + fileRef + "\n";
99424
99488
  });
99425
99489
  return tabularData;
99426
99490
  }
@@ -99885,6 +99949,7 @@ var ts;
99885
99949
  var sharedExtendedConfigFileWatchers;
99886
99950
  var extendedConfigCache = host.extendedConfigCache;
99887
99951
  var changesAffectResolution = false;
99952
+ var reportFileChangeDetectedOnCreateProgram = false;
99888
99953
  var sourceFilesCache = new ts.Map();
99889
99954
  var missingFilePathsRequestedForRelease;
99890
99955
  var hasChangedCompilerOptions = false;
@@ -100038,14 +100103,21 @@ var ts;
100038
100103
  var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution || changesAffectResolution);
100039
100104
  if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
100040
100105
  if (hasChangedConfigFileParsingErrors) {
100106
+ if (reportFileChangeDetectedOnCreateProgram) {
100107
+ reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
100108
+ }
100041
100109
  builderProgram = createProgram(undefined, undefined, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences);
100042
100110
  hasChangedConfigFileParsingErrors = false;
100043
100111
  }
100044
100112
  }
100045
100113
  else {
100114
+ if (reportFileChangeDetectedOnCreateProgram) {
100115
+ reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
100116
+ }
100046
100117
  createNewProgram(hasInvalidatedResolution);
100047
100118
  }
100048
100119
  changesAffectResolution = false;
100120
+ reportFileChangeDetectedOnCreateProgram = false;
100049
100121
  if (host.afterProgramCreate && program !== builderProgram) {
100050
100122
  host.afterProgramCreate(builderProgram);
100051
100123
  }
@@ -100224,7 +100296,7 @@ var ts;
100224
100296
  }
100225
100297
  function updateProgramWithWatchStatus() {
100226
100298
  timerToUpdateProgram = undefined;
100227
- reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
100299
+ reportFileChangeDetectedOnCreateProgram = true;
100228
100300
  updateProgram();
100229
100301
  }
100230
100302
  function updateProgram() {