typescript 4.6.0-dev.20211205 → 4.6.0-dev.20211209

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.
@@ -294,7 +294,7 @@ var ts;
294
294
  // The following is baselined as a literal template type without intervention
295
295
  /** The version of the TypeScript compiler release */
296
296
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
297
- ts.version = ts.versionMajorMinor + ".0-dev.20211205";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20211209";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -8131,7 +8131,7 @@ var ts;
8131
8131
  Duplicate_label_0: diag(1114, ts.DiagnosticCategory.Error, "Duplicate_label_0_1114", "Duplicate label '{0}'."),
8132
8132
  A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: diag(1115, ts.DiagnosticCategory.Error, "A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement_1115", "A 'continue' statement can only jump to a label of an enclosing iteration statement."),
8133
8133
  A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: diag(1116, ts.DiagnosticCategory.Error, "A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement_1116", "A 'break' statement can only jump to a label of an enclosing statement."),
8134
- An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode_1117", "An object literal cannot have multiple properties with the same name in strict mode."),
8134
+ An_object_literal_cannot_have_multiple_properties_with_the_same_name: diag(1117, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_properties_with_the_same_name_1117", "An object literal cannot have multiple properties with the same name."),
8135
8135
  An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: diag(1118, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name_1118", "An object literal cannot have multiple get/set accessors with the same name."),
8136
8136
  An_object_literal_cannot_have_property_and_accessor_with_the_same_name: diag(1119, ts.DiagnosticCategory.Error, "An_object_literal_cannot_have_property_and_accessor_with_the_same_name_1119", "An object literal cannot have property and accessor with the same name."),
8137
8137
  An_export_assignment_cannot_have_modifiers: diag(1120, ts.DiagnosticCategory.Error, "An_export_assignment_cannot_have_modifiers_1120", "An export assignment cannot have modifiers."),
@@ -9083,6 +9083,7 @@ var ts;
9083
9083
  DIRECTORY: diag(6038, ts.DiagnosticCategory.Message, "DIRECTORY_6038", "DIRECTORY"),
9084
9084
  STRATEGY: diag(6039, ts.DiagnosticCategory.Message, "STRATEGY_6039", "STRATEGY"),
9085
9085
  FILE_OR_DIRECTORY: diag(6040, ts.DiagnosticCategory.Message, "FILE_OR_DIRECTORY_6040", "FILE OR DIRECTORY"),
9086
+ Errors_Files: diag(6041, ts.DiagnosticCategory.Message, "Errors_Files_6041", "Errors Files"),
9086
9087
  Generates_corresponding_map_file: diag(6043, ts.DiagnosticCategory.Message, "Generates_corresponding_map_file_6043", "Generates corresponding '.map' file."),
9087
9088
  Compiler_option_0_expects_an_argument: diag(6044, ts.DiagnosticCategory.Error, "Compiler_option_0_expects_an_argument_6044", "Compiler option '{0}' expects an argument."),
9088
9089
  Unterminated_quoted_string_in_response_file_0: diag(6045, ts.DiagnosticCategory.Error, "Unterminated_quoted_string_in_response_file_0_6045", "Unterminated quoted string in response file '{0}'."),
@@ -9276,6 +9277,9 @@ var ts;
9276
9277
  Output_Formatting: diag(6256, ts.DiagnosticCategory.Message, "Output_Formatting_6256", "Output Formatting"),
9277
9278
  Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
9278
9279
  _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"),
9280
+ Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
9281
+ Found_0_errors_in_1_file: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_file_6260", "Found {0} errors in 1 file."),
9282
+ Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
9279
9283
  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."),
9280
9284
  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}'."),
9281
9285
  Invalid_import_specifier_0_has_no_possible_resolutions: diag(6272, ts.DiagnosticCategory.Message, "Invalid_import_specifier_0_has_no_possible_resolutions_6272", "Invalid import specifier '{0}' has no possible resolutions."),
@@ -24628,7 +24632,7 @@ var ts;
24628
24632
  // @api
24629
24633
  function createAssertClause(elements, multiLine) {
24630
24634
  var node = createBaseNode(292 /* AssertClause */);
24631
- node.elements = elements;
24635
+ node.elements = createNodeArray(elements);
24632
24636
  node.multiLine = multiLine;
24633
24637
  node.transformFlags |= 4 /* ContainsESNext */;
24634
24638
  return node;
@@ -33814,10 +33818,14 @@ var ts;
33814
33818
  // - "(x,y)" is a comma expression parsed as a signature with two parameters.
33815
33819
  // - "a ? (b): c" will have "(b):" parsed as a signature with a return type annotation.
33816
33820
  // - "a ? (b): function() {}" will too, since function() is a valid JSDoc function type.
33817
- // - "a ? (b): (function() {})" as well, but inside of a parenthesized type.
33821
+ // - "a ? (b): (function() {})" as well, but inside of a parenthesized type with an arbitrary amount of nesting.
33818
33822
  //
33819
33823
  // So we need just a bit of lookahead to ensure that it can only be a signature.
33820
- var hasJSDocFunctionType = type && (ts.isJSDocFunctionType(type) || ts.isParenthesizedTypeNode(type) && ts.isJSDocFunctionType(type.type));
33824
+ var unwrappedType = type;
33825
+ while ((unwrappedType === null || unwrappedType === void 0 ? void 0 : unwrappedType.kind) === 190 /* ParenthesizedType */) {
33826
+ unwrappedType = unwrappedType.type; // Skip parens if need be
33827
+ }
33828
+ var hasJSDocFunctionType = unwrappedType && ts.isJSDocFunctionType(unwrappedType);
33821
33829
  if (!allowAmbiguity && token() !== 38 /* EqualsGreaterThanToken */ && (hasJSDocFunctionType || token() !== 18 /* OpenBraceToken */)) {
33822
33830
  // Returning undefined here will cause our caller to rewind to where we started from.
33823
33831
  return undefined;
@@ -45148,10 +45156,6 @@ var ts;
45148
45156
  seen.set(identifier.escapedText, currentKind);
45149
45157
  continue;
45150
45158
  }
45151
- if (currentKind === 1 /* Property */ && existingKind === 1 /* Property */) {
45152
- var span = ts.getErrorSpanForNode(file, identifier);
45153
- file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode));
45154
- }
45155
45159
  }
45156
45160
  }
45157
45161
  return bindAnonymousDeclaration(node, 4096 /* ObjectLiteral */, "__object" /* Object */);
@@ -45385,7 +45389,7 @@ var ts;
45385
45389
  }
45386
45390
  }
45387
45391
  function checkStrictModeNumericLiteral(node) {
45388
- if (inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
45392
+ if (languageVersion < 1 /* ES5 */ && inStrictMode && node.numericLiteralFlags & 32 /* Octal */) {
45389
45393
  file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode));
45390
45394
  }
45391
45395
  }
@@ -48990,10 +48994,12 @@ var ts;
48990
48994
  }
48991
48995
  /* Starting from 'initial' node walk up the parent chain until 'stopAt' node is reached.
48992
48996
  * If at any point current node is equal to 'parent' node - return true.
48997
+ * If current node is an IIFE, continue walking up.
48993
48998
  * Return false if 'stopAt' node is reached or isFunctionLike(current) === true.
48994
48999
  */
48995
49000
  function isSameScopeDescendentOf(initial, parent, stopAt) {
48996
- return !!parent && !!ts.findAncestor(initial, function (n) { return n === stopAt || ts.isFunctionLike(n) ? "quit" : n === parent; });
49001
+ return !!parent && !!ts.findAncestor(initial, function (n) { return n === parent
49002
+ || (n === stopAt || ts.isFunctionLike(n) && !ts.getImmediatelyInvokedFunctionExpression(n) ? "quit" : false); });
48997
49003
  }
48998
49004
  function getAnyImportSyntax(node) {
48999
49005
  switch (node.kind) {
@@ -65775,7 +65781,7 @@ var ts;
65775
65781
  }
65776
65782
  function getBaseTypeOfLiteralType(type) {
65777
65783
  return type.flags & 1024 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) :
65778
- type.flags & 128 /* StringLiteral */ ? stringType :
65784
+ type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) ? stringType :
65779
65785
  type.flags & 256 /* NumberLiteral */ ? numberType :
65780
65786
  type.flags & 2048 /* BigIntLiteral */ ? bigintType :
65781
65787
  type.flags & 512 /* BooleanLiteral */ ? booleanType :
@@ -74531,7 +74537,7 @@ var ts;
74531
74537
  typeArguments.pop();
74532
74538
  }
74533
74539
  while (typeArguments.length < typeParameters.length) {
74534
- typeArguments.push(getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
74540
+ typeArguments.push(getDefaultFromTypeParameter(typeParameters[typeArguments.length]) || getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
74535
74541
  }
74536
74542
  return typeArguments;
74537
74543
  }
@@ -75187,8 +75193,7 @@ var ts;
75187
75193
  */
75188
75194
  function checkCallExpression(node, checkMode) {
75189
75195
  var _a;
75190
- if (!checkGrammarTypeArguments(node, node.typeArguments))
75191
- checkGrammarArguments(node.arguments);
75196
+ checkGrammarTypeArguments(node, node.typeArguments);
75192
75197
  var signature = getResolvedSignature(node, /*candidatesOutArray*/ undefined, checkMode);
75193
75198
  if (signature === resolvingSignature) {
75194
75199
  // CheckMode.SkipGenericFunctions is enabled and this is a call to a generic function that
@@ -75293,8 +75298,7 @@ var ts;
75293
75298
  }
75294
75299
  function checkImportCallExpression(node) {
75295
75300
  // Check grammar of dynamic import
75296
- if (!checkGrammarArguments(node.arguments))
75297
- checkGrammarImportCallExpression(node);
75301
+ checkGrammarImportCallExpression(node);
75298
75302
  if (node.arguments.length === 0) {
75299
75303
  return createPromiseReturnType(node, anyType);
75300
75304
  }
@@ -85955,20 +85959,6 @@ var ts;
85955
85959
  }
85956
85960
  return false;
85957
85961
  }
85958
- function checkGrammarForOmittedArgument(args) {
85959
- if (args) {
85960
- for (var _i = 0, args_4 = args; _i < args_4.length; _i++) {
85961
- var arg = args_4[_i];
85962
- if (arg.kind === 226 /* OmittedExpression */) {
85963
- return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
85964
- }
85965
- }
85966
- }
85967
- return false;
85968
- }
85969
- function checkGrammarArguments(args) {
85970
- return checkGrammarForOmittedArgument(args);
85971
- }
85972
85962
  function checkGrammarHeritageClause(node) {
85973
85963
  var types = node.types;
85974
85964
  if (checkGrammarForDisallowedTrailingComma(types)) {
@@ -86143,9 +86133,12 @@ var ts;
86143
86133
  seen.set(effectiveName, currentKind);
86144
86134
  }
86145
86135
  else {
86146
- if ((currentKind & 12 /* PropertyAssignmentOrMethod */) && (existingKind & 12 /* PropertyAssignmentOrMethod */)) {
86136
+ if ((currentKind & 8 /* Method */) && (existingKind & 8 /* Method */)) {
86147
86137
  grammarErrorOnNode(name, ts.Diagnostics.Duplicate_identifier_0, ts.getTextOfNode(name));
86148
86138
  }
86139
+ else if ((currentKind & 4 /* PropertyAssignment */) && (existingKind & 4 /* PropertyAssignment */)) {
86140
+ grammarErrorOnNode(name, ts.Diagnostics.An_object_literal_cannot_have_multiple_properties_with_the_same_name, ts.getTextOfNode(name));
86141
+ }
86149
86142
  else if ((currentKind & 3 /* GetOrSetAccessor */) && (existingKind & 3 /* GetOrSetAccessor */)) {
86150
86143
  if (existingKind !== 3 /* GetOrSetAccessor */ && currentKind !== existingKind) {
86151
86144
  seen.set(effectiveName, currentKind | existingKind);
@@ -103213,7 +103206,7 @@ var ts;
103213
103206
  if (ts.isIdentifier(node.expression)) {
103214
103207
  var expression = substituteExpressionIdentifier(node.expression);
103215
103208
  noSubstitution[ts.getNodeId(expression)] = true;
103216
- if (!ts.isIdentifier(expression)) {
103209
+ if (!ts.isIdentifier(expression) && !(ts.getEmitFlags(node.expression) & 4096 /* HelperName */)) {
103217
103210
  return ts.addEmitFlags(factory.updateCallExpression(node, expression,
103218
103211
  /*typeArguments*/ undefined, node.arguments), 536870912 /* IndirectCall */);
103219
103212
  }
@@ -103224,7 +103217,7 @@ var ts;
103224
103217
  if (ts.isIdentifier(node.tag)) {
103225
103218
  var tag = substituteExpressionIdentifier(node.tag);
103226
103219
  noSubstitution[ts.getNodeId(tag)] = true;
103227
- if (!ts.isIdentifier(tag)) {
103220
+ if (!ts.isIdentifier(tag) && !(ts.getEmitFlags(node.tag) & 4096 /* HelperName */)) {
103228
103221
  return ts.addEmitFlags(factory.updateTaggedTemplateExpression(node, tag,
103229
103222
  /*typeArguments*/ undefined, node.template), 536870912 /* IndirectCall */);
103230
103223
  }
@@ -113850,6 +113843,7 @@ var ts;
113850
113843
  ts.getImpliedNodeFormatForFile = getImpliedNodeFormatForFile;
113851
113844
  /** @internal */
113852
113845
  ts.plainJSErrors = new ts.Set([
113846
+ // binder errors
113853
113847
  ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0.code,
113854
113848
  ts.Diagnostics.A_module_cannot_have_multiple_default_exports.code,
113855
113849
  ts.Diagnostics.Another_export_default_is_here.code,
@@ -113865,6 +113859,81 @@ var ts;
113865
113859
  ts.Diagnostics.A_label_is_not_allowed_here.code,
113866
113860
  ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code,
113867
113861
  ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode.code,
113862
+ // grammar errors
113863
+ ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code,
113864
+ ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code,
113865
+ ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name.code,
113866
+ ts.Diagnostics.A_class_member_cannot_have_the_0_keyword.code,
113867
+ ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name.code,
113868
+ ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code,
113869
+ ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
113870
+ ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
113871
+ ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code,
113872
+ ts.Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code,
113873
+ ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context.code,
113874
+ ts.Diagnostics.A_destructuring_declaration_must_have_an_initializer.code,
113875
+ ts.Diagnostics.A_get_accessor_cannot_have_parameters.code,
113876
+ ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern.code,
113877
+ ts.Diagnostics.A_rest_element_cannot_have_a_property_name.code,
113878
+ ts.Diagnostics.A_rest_element_cannot_have_an_initializer.code,
113879
+ ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern.code,
113880
+ ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer.code,
113881
+ ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list.code,
113882
+ ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code,
113883
+ ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body.code,
113884
+ ts.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code,
113885
+ ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter.code,
113886
+ ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code,
113887
+ ts.Diagnostics.An_export_declaration_can_only_be_used_in_a_module.code,
113888
+ ts.Diagnostics.An_export_declaration_cannot_have_modifiers.code,
113889
+ ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module.code,
113890
+ ts.Diagnostics.An_import_declaration_cannot_have_modifiers.code,
113891
+ ts.Diagnostics.An_object_member_cannot_be_declared_optional.code,
113892
+ ts.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code,
113893
+ ts.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code,
113894
+ ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause.code,
113895
+ ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer.code,
113896
+ ts.Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code,
113897
+ ts.Diagnostics.Classes_can_only_extend_a_single_class.code,
113898
+ ts.Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
113899
+ ts.Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code,
113900
+ ts.Diagnostics.Duplicate_label_0.code,
113901
+ ts.Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments.code,
113902
+ ts.Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block.code,
113903
+ ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
113904
+ ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
113905
+ ts.Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code,
113906
+ ts.Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code,
113907
+ ts.Diagnostics.Jump_target_cannot_cross_function_boundary.code,
113908
+ ts.Diagnostics.Line_terminator_not_permitted_before_arrow.code,
113909
+ ts.Diagnostics.Modifiers_cannot_appear_here.code,
113910
+ ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code,
113911
+ ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code,
113912
+ ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies.code,
113913
+ ts.Diagnostics.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.code,
113914
+ ts.Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code,
113915
+ ts.Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code,
113916
+ ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code,
113917
+ ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code,
113918
+ ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code,
113919
+ ts.Diagnostics.Trailing_comma_not_allowed.code,
113920
+ ts.Diagnostics.Variable_declaration_list_cannot_be_empty.code,
113921
+ ts.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses.code,
113922
+ ts.Diagnostics._0_expected.code,
113923
+ ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code,
113924
+ ts.Diagnostics._0_list_cannot_be_empty.code,
113925
+ ts.Diagnostics._0_modifier_already_seen.code,
113926
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration.code,
113927
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element.code,
113928
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter.code,
113929
+ ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind.code,
113930
+ ts.Diagnostics._0_modifier_cannot_be_used_here.code,
113931
+ ts.Diagnostics._0_modifier_must_precede_1_modifier.code,
113932
+ ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block.code,
113933
+ ts.Diagnostics.const_declarations_must_be_initialized.code,
113934
+ ts.Diagnostics.extends_clause_already_seen.code,
113935
+ ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block.code,
113936
+ ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code,
113868
113937
  ]);
113869
113938
  /**
113870
113939
  * Determine if source file needs to be re-created even if its text hasn't changed
@@ -114894,9 +114963,10 @@ var ts;
114894
114963
  var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 /* TS */ || sourceFile.scriptKind === 4 /* TSX */
114895
114964
  || sourceFile.scriptKind === 5 /* External */ || isPlainJs || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */);
114896
114965
  var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray;
114897
- var checkDiagnostics = includeBindAndCheckDiagnostics && !isPlainJs ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
114966
+ var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
114898
114967
  if (isPlainJs) {
114899
114968
  bindDiagnostics = ts.filter(bindDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
114969
+ checkDiagnostics = ts.filter(checkDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
114900
114970
  }
114901
114971
  // skip ts-expect-error errors in plain JS files, and skip JSDoc errors except in checked JS
114902
114972
  return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics && !isPlainJs, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined);
@@ -119914,7 +119984,7 @@ var ts;
119914
119984
  getCanonicalFileName: ts.createGetCanonicalFileName(ts.sys.useCaseSensitiveFileNames)
119915
119985
  } : undefined;
119916
119986
  /**
119917
- * Create a function that reports error by writing to the system and handles the formating of the diagnostic
119987
+ * Create a function that reports error by writing to the system and handles the formatting of the diagnostic
119918
119988
  */
119919
119989
  function createDiagnosticReporter(system, pretty) {
119920
119990
  var host = system === ts.sys && sysFormatDiagnosticsHost ? sysFormatDiagnosticsHost : {
@@ -120000,19 +120070,74 @@ var ts;
120000
120070
  return ts.countWhere(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; });
120001
120071
  }
120002
120072
  ts.getErrorCountForSummary = getErrorCountForSummary;
120073
+ function getFilesInErrorForSummary(diagnostics) {
120074
+ var filesInError = ts.filter(diagnostics, function (diagnostic) { return diagnostic.category === ts.DiagnosticCategory.Error; })
120075
+ .map(function (errorDiagnostic) {
120076
+ if (errorDiagnostic.file === undefined)
120077
+ return;
120078
+ return "" + errorDiagnostic.file.fileName;
120079
+ });
120080
+ return filesInError.map(function (fileName) {
120081
+ var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
120082
+ return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
120083
+ });
120084
+ if (diagnosticForFileName !== undefined) {
120085
+ var line = ts.getLineAndCharacterOfPosition(diagnosticForFileName.file, diagnosticForFileName.start).line;
120086
+ return {
120087
+ fileName: fileName,
120088
+ line: line + 1,
120089
+ };
120090
+ }
120091
+ });
120092
+ }
120093
+ ts.getFilesInErrorForSummary = getFilesInErrorForSummary;
120003
120094
  function getWatchErrorSummaryDiagnosticMessage(errorCount) {
120004
120095
  return errorCount === 1 ?
120005
120096
  ts.Diagnostics.Found_1_error_Watching_for_file_changes :
120006
120097
  ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
120007
120098
  }
120008
120099
  ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
120009
- function getErrorSummaryText(errorCount, newLine) {
120100
+ function getErrorSummaryText(errorCount, filesInError, newLine) {
120010
120101
  if (errorCount === 0)
120011
120102
  return "";
120012
- var d = ts.createCompilerDiagnostic(errorCount === 1 ? ts.Diagnostics.Found_1_error : ts.Diagnostics.Found_0_errors, errorCount);
120013
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine;
120103
+ var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
120104
+ var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
120105
+ .filter(function (value, index, self) { return self.indexOf(value) === index; });
120106
+ var d = errorCount === 1 ?
120107
+ ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
120108
+ ts.Diagnostics.Found_1_error_in_1 :
120109
+ ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
120110
+ ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
120111
+ ts.Diagnostics.Found_0_errors :
120112
+ distinctFileNamesWithLines.length === 1 ?
120113
+ ts.Diagnostics.Found_0_errors_in_1_file :
120114
+ ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
120115
+ return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
120014
120116
  }
120015
120117
  ts.getErrorSummaryText = getErrorSummaryText;
120118
+ function createTabularErrorsDisplay(filesInError) {
120119
+ var distinctFiles = filesInError.filter(function (value, index, self) { return index === self.findIndex(function (file) { return (file === null || file === void 0 ? void 0 : file.fileName) === (value === null || value === void 0 ? void 0 : value.fileName); }); });
120120
+ if (distinctFiles.length === 0)
120121
+ return "";
120122
+ var numberLength = function (num) { return Math.log(num) * Math.LOG10E + 1; };
120123
+ var fileToErrorCount = distinctFiles.map(function (file) { return [file, ts.countWhere(filesInError, function (fileInError) { return fileInError.fileName === file.fileName; })]; });
120124
+ var maxErrors = fileToErrorCount.reduce(function (acc, value) { return Math.max(acc, value[1] || 0); }, 0);
120125
+ var headerRow = ts.Diagnostics.Errors_Files.message;
120126
+ var leftColumnHeadingLength = headerRow.split(" ")[0].length;
120127
+ var leftPaddingGoal = Math.max(leftColumnHeadingLength, numberLength(maxErrors));
120128
+ var headerPadding = Math.max(numberLength(maxErrors) - leftColumnHeadingLength, 0);
120129
+ var tabularData = "";
120130
+ tabularData += " ".repeat(headerPadding) + headerRow + "\n";
120131
+ fileToErrorCount.forEach(function (row) {
120132
+ var file = row[0], errorCount = row[1];
120133
+ var errorCountDigitsLength = Math.log(errorCount) * Math.LOG10E + 1 | 0;
120134
+ var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
120135
+ " ".repeat(leftPaddingGoal - errorCountDigitsLength)
120136
+ : "";
120137
+ tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
120138
+ });
120139
+ return tabularData;
120140
+ }
120016
120141
  function isBuilderProgram(program) {
120017
120142
  return !!program.getState;
120018
120143
  }
@@ -120216,7 +120341,7 @@ var ts;
120216
120341
  listFiles(program, write);
120217
120342
  }
120218
120343
  if (reportSummary) {
120219
- reportSummary(getErrorCountForSummary(diagnostics));
120344
+ reportSummary(getErrorCountForSummary(diagnostics), getFilesInErrorForSummary(diagnostics));
120220
120345
  }
120221
120346
  return {
120222
120347
  emitResult: emitResult,
@@ -120427,7 +120552,7 @@ var ts;
120427
120552
  var system = input.system || ts.sys;
120428
120553
  var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
120429
120554
  var builderProgram = ts.createIncrementalProgram(input);
120430
- var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount) { return system.write(getErrorSummaryText(errorCount, system.newLine)); } : undefined);
120555
+ var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount, filesInError) { return system.write(getErrorSummaryText(errorCount, filesInError, system.newLine)); } : undefined);
120431
120556
  if (input.afterProgramEmitAndDiagnostics)
120432
120557
  input.afterProgramEmitAndDiagnostics(builderProgram);
120433
120558
  return exitStatus;
@@ -122646,11 +122771,14 @@ var ts;
122646
122771
  var canReportSummary = state.watch || !!state.host.reportErrorSummary;
122647
122772
  var diagnostics = state.diagnostics;
122648
122773
  var totalErrors = 0;
122774
+ var filesInError = [];
122649
122775
  if (isCircularBuildOrder(buildOrder)) {
122650
122776
  reportBuildQueue(state, buildOrder.buildOrder);
122651
122777
  reportErrors(state, buildOrder.circularDiagnostics);
122652
122778
  if (canReportSummary)
122653
122779
  totalErrors += ts.getErrorCountForSummary(buildOrder.circularDiagnostics);
122780
+ if (canReportSummary)
122781
+ filesInError = __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(buildOrder.circularDiagnostics), true);
122654
122782
  }
122655
122783
  else {
122656
122784
  // Report errors from the other projects
@@ -122662,12 +122790,14 @@ var ts;
122662
122790
  });
122663
122791
  if (canReportSummary)
122664
122792
  diagnostics.forEach(function (singleProjectErrors) { return totalErrors += ts.getErrorCountForSummary(singleProjectErrors); });
122793
+ if (canReportSummary)
122794
+ diagnostics.forEach(function (singleProjectErrors) { return __spreadArray(__spreadArray([], filesInError, true), ts.getFilesInErrorForSummary(singleProjectErrors), true); });
122665
122795
  }
122666
122796
  if (state.watch) {
122667
122797
  reportWatchStatus(state, ts.getWatchErrorSummaryDiagnosticMessage(totalErrors), totalErrors);
122668
122798
  }
122669
122799
  else if (state.host.reportErrorSummary) {
122670
- state.host.reportErrorSummary(totalErrors);
122800
+ state.host.reportErrorSummary(totalErrors, filesInError);
122671
122801
  }
122672
122802
  }
122673
122803
  /**
@@ -127912,6 +128042,9 @@ var ts;
127912
128042
  }
127913
128043
  return;
127914
128044
  }
128045
+ if (ts.isConstTypeReference(token.parent)) {
128046
+ return 3 /* keyword */;
128047
+ }
127915
128048
  }
127916
128049
  return 2 /* identifier */;
127917
128050
  }
@@ -131732,8 +131865,10 @@ var ts;
131732
131865
  }
131733
131866
  /** Get the corresponding JSDocTag node if the position is in a jsDoc comment */
131734
131867
  function getJsDocTagAtPosition(node, position) {
131735
- var jsdoc = ts.findAncestor(node, ts.isJSDoc);
131736
- return jsdoc && jsdoc.tags && (ts.rangeContainsPosition(jsdoc, position) ? ts.findLast(jsdoc.tags, function (tag) { return tag.pos < position; }) : undefined);
131868
+ return ts.findAncestor(node, function (n) {
131869
+ return ts.isJSDocTag(n) && ts.rangeContainsPosition(n, position) ? true :
131870
+ ts.isJSDoc(n) ? "quit" : false;
131871
+ });
131737
131872
  }
131738
131873
  function getPropertiesForObjectExpression(contextualType, completionsType, obj, checker) {
131739
131874
  var hasCompletionsType = completionsType && completionsType !== contextualType;
@@ -141489,7 +141624,7 @@ var ts;
141489
141624
  displayParts.push(ts.spacePart());
141490
141625
  displayParts.push(ts.operatorPart(63 /* EqualsToken */));
141491
141626
  displayParts.push(ts.spacePart());
141492
- ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */));
141627
+ ts.addRange(displayParts, ts.typeToDisplayParts(typeChecker, ts.isConstTypeReference(location.parent) ? typeChecker.getTypeAtLocation(location.parent) : typeChecker.getDeclaredTypeOfSymbol(symbol), enclosingDeclaration, 8388608 /* InTypeAlias */));
141493
141628
  }
141494
141629
  if (symbolFlags & 384 /* Enum */) {
141495
141630
  prefixNextMeaning();