typescript 4.6.0-dev.20211208 → 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.
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.20211208";
72
+ ts.version = ts.versionMajorMinor + ".0-dev.20211209";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  function tryGetNativeMap() {
@@ -19678,7 +19678,7 @@ var ts;
19678
19678
  }
19679
19679
  function createAssertClause(elements, multiLine) {
19680
19680
  var node = createBaseNode(292);
19681
- node.elements = elements;
19681
+ node.elements = createNodeArray(elements);
19682
19682
  node.multiLine = multiLine;
19683
19683
  node.transformFlags |= 4;
19684
19684
  return node;
@@ -62133,7 +62133,7 @@ var ts;
62133
62133
  typeArguments.pop();
62134
62134
  }
62135
62135
  while (typeArguments.length < typeParameters.length) {
62136
- typeArguments.push(getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
62136
+ typeArguments.push(getDefaultFromTypeParameter(typeParameters[typeArguments.length]) || getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
62137
62137
  }
62138
62138
  return typeArguments;
62139
62139
  }
@@ -62679,8 +62679,7 @@ var ts;
62679
62679
  }
62680
62680
  function checkCallExpression(node, checkMode) {
62681
62681
  var _a;
62682
- if (!checkGrammarTypeArguments(node, node.typeArguments))
62683
- checkGrammarArguments(node.arguments);
62682
+ checkGrammarTypeArguments(node, node.typeArguments);
62684
62683
  var signature = getResolvedSignature(node, undefined, checkMode);
62685
62684
  if (signature === resolvingSignature) {
62686
62685
  return nonInferrableType;
@@ -62777,8 +62776,7 @@ var ts;
62777
62776
  return globalESSymbol === resolveName(left, "Symbol", 111551, undefined, undefined, false);
62778
62777
  }
62779
62778
  function checkImportCallExpression(node) {
62780
- if (!checkGrammarArguments(node.arguments))
62781
- checkGrammarImportCallExpression(node);
62779
+ checkGrammarImportCallExpression(node);
62782
62780
  if (node.arguments.length === 0) {
62783
62781
  return createPromiseReturnType(node, anyType);
62784
62782
  }
@@ -72061,20 +72059,6 @@ var ts;
72061
72059
  }
72062
72060
  return false;
72063
72061
  }
72064
- function checkGrammarForOmittedArgument(args) {
72065
- if (args) {
72066
- for (var _i = 0, args_4 = args; _i < args_4.length; _i++) {
72067
- var arg = args_4[_i];
72068
- if (arg.kind === 226) {
72069
- return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
72070
- }
72071
- }
72072
- }
72073
- return false;
72074
- }
72075
- function checkGrammarArguments(args) {
72076
- return checkGrammarForOmittedArgument(args);
72077
- }
72078
72062
  function checkGrammarHeritageClause(node) {
72079
72063
  var types = node.types;
72080
72064
  if (checkGrammarForDisallowedTrailingComma(types)) {
@@ -84645,7 +84629,7 @@ var ts;
84645
84629
  if (ts.isIdentifier(node.expression)) {
84646
84630
  var expression = substituteExpressionIdentifier(node.expression);
84647
84631
  noSubstitution[ts.getNodeId(expression)] = true;
84648
- if (!ts.isIdentifier(expression)) {
84632
+ if (!ts.isIdentifier(expression) && !(ts.getEmitFlags(node.expression) & 4096)) {
84649
84633
  return ts.addEmitFlags(factory.updateCallExpression(node, expression, undefined, node.arguments), 536870912);
84650
84634
  }
84651
84635
  }
@@ -84655,7 +84639,7 @@ var ts;
84655
84639
  if (ts.isIdentifier(node.tag)) {
84656
84640
  var tag = substituteExpressionIdentifier(node.tag);
84657
84641
  noSubstitution[ts.getNodeId(tag)] = true;
84658
- if (!ts.isIdentifier(tag)) {
84642
+ if (!ts.isIdentifier(tag) && !(ts.getEmitFlags(node.tag) & 4096)) {
84659
84643
  return ts.addEmitFlags(factory.updateTaggedTemplateExpression(node, tag, undefined, node.template), 536870912);
84660
84644
  }
84661
84645
  }
@@ -93750,6 +93734,80 @@ var ts;
93750
93734
  ts.Diagnostics.A_label_is_not_allowed_here.code,
93751
93735
  ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code,
93752
93736
  ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode.code,
93737
+ ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code,
93738
+ ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code,
93739
+ ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name.code,
93740
+ ts.Diagnostics.A_class_member_cannot_have_the_0_keyword.code,
93741
+ ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name.code,
93742
+ ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code,
93743
+ ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
93744
+ ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
93745
+ ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code,
93746
+ ts.Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code,
93747
+ ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context.code,
93748
+ ts.Diagnostics.A_destructuring_declaration_must_have_an_initializer.code,
93749
+ ts.Diagnostics.A_get_accessor_cannot_have_parameters.code,
93750
+ ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern.code,
93751
+ ts.Diagnostics.A_rest_element_cannot_have_a_property_name.code,
93752
+ ts.Diagnostics.A_rest_element_cannot_have_an_initializer.code,
93753
+ ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern.code,
93754
+ ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer.code,
93755
+ ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list.code,
93756
+ ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code,
93757
+ ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body.code,
93758
+ ts.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code,
93759
+ ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter.code,
93760
+ ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code,
93761
+ ts.Diagnostics.An_export_declaration_can_only_be_used_in_a_module.code,
93762
+ ts.Diagnostics.An_export_declaration_cannot_have_modifiers.code,
93763
+ ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module.code,
93764
+ ts.Diagnostics.An_import_declaration_cannot_have_modifiers.code,
93765
+ ts.Diagnostics.An_object_member_cannot_be_declared_optional.code,
93766
+ ts.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code,
93767
+ ts.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code,
93768
+ ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause.code,
93769
+ ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer.code,
93770
+ ts.Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code,
93771
+ ts.Diagnostics.Classes_can_only_extend_a_single_class.code,
93772
+ ts.Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
93773
+ 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,
93774
+ ts.Diagnostics.Duplicate_label_0.code,
93775
+ ts.Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments.code,
93776
+ ts.Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block.code,
93777
+ ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
93778
+ ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
93779
+ ts.Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code,
93780
+ ts.Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code,
93781
+ ts.Diagnostics.Jump_target_cannot_cross_function_boundary.code,
93782
+ ts.Diagnostics.Line_terminator_not_permitted_before_arrow.code,
93783
+ ts.Diagnostics.Modifiers_cannot_appear_here.code,
93784
+ ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code,
93785
+ ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code,
93786
+ ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies.code,
93787
+ 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,
93788
+ ts.Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code,
93789
+ ts.Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code,
93790
+ ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code,
93791
+ ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code,
93792
+ ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code,
93793
+ ts.Diagnostics.Trailing_comma_not_allowed.code,
93794
+ ts.Diagnostics.Variable_declaration_list_cannot_be_empty.code,
93795
+ ts.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses.code,
93796
+ ts.Diagnostics._0_expected.code,
93797
+ ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code,
93798
+ ts.Diagnostics._0_list_cannot_be_empty.code,
93799
+ ts.Diagnostics._0_modifier_already_seen.code,
93800
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration.code,
93801
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element.code,
93802
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter.code,
93803
+ ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind.code,
93804
+ ts.Diagnostics._0_modifier_cannot_be_used_here.code,
93805
+ ts.Diagnostics._0_modifier_must_precede_1_modifier.code,
93806
+ ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block.code,
93807
+ ts.Diagnostics.const_declarations_must_be_initialized.code,
93808
+ ts.Diagnostics.extends_clause_already_seen.code,
93809
+ ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block.code,
93810
+ ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code,
93753
93811
  ]);
93754
93812
  function shouldProgramCreateNewSourceFiles(program, newOptions) {
93755
93813
  if (!program)
@@ -94605,9 +94663,10 @@ var ts;
94605
94663
  var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 || sourceFile.scriptKind === 4
94606
94664
  || sourceFile.scriptKind === 5 || isPlainJs || isCheckJs || sourceFile.scriptKind === 7);
94607
94665
  var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray;
94608
- var checkDiagnostics = includeBindAndCheckDiagnostics && !isPlainJs ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
94666
+ var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
94609
94667
  if (isPlainJs) {
94610
94668
  bindDiagnostics = ts.filter(bindDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
94669
+ checkDiagnostics = ts.filter(checkDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
94611
94670
  }
94612
94671
  return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics && !isPlainJs, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined);
94613
94672
  });
package/lib/tsserver.js CHANGED
@@ -100,7 +100,7 @@ var ts;
100
100
  // The following is baselined as a literal template type without intervention
101
101
  /** The version of the TypeScript compiler release */
102
102
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
103
- ts.version = ts.versionMajorMinor + ".0-dev.20211208";
103
+ ts.version = ts.versionMajorMinor + ".0-dev.20211209";
104
104
  /* @internal */
105
105
  var Comparison;
106
106
  (function (Comparison) {
@@ -24438,7 +24438,7 @@ var ts;
24438
24438
  // @api
24439
24439
  function createAssertClause(elements, multiLine) {
24440
24440
  var node = createBaseNode(292 /* AssertClause */);
24441
- node.elements = elements;
24441
+ node.elements = createNodeArray(elements);
24442
24442
  node.multiLine = multiLine;
24443
24443
  node.transformFlags |= 4 /* ContainsESNext */;
24444
24444
  return node;
@@ -74343,7 +74343,7 @@ var ts;
74343
74343
  typeArguments.pop();
74344
74344
  }
74345
74345
  while (typeArguments.length < typeParameters.length) {
74346
- typeArguments.push(getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
74346
+ typeArguments.push(getDefaultFromTypeParameter(typeParameters[typeArguments.length]) || getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
74347
74347
  }
74348
74348
  return typeArguments;
74349
74349
  }
@@ -74999,8 +74999,7 @@ var ts;
74999
74999
  */
75000
75000
  function checkCallExpression(node, checkMode) {
75001
75001
  var _a;
75002
- if (!checkGrammarTypeArguments(node, node.typeArguments))
75003
- checkGrammarArguments(node.arguments);
75002
+ checkGrammarTypeArguments(node, node.typeArguments);
75004
75003
  var signature = getResolvedSignature(node, /*candidatesOutArray*/ undefined, checkMode);
75005
75004
  if (signature === resolvingSignature) {
75006
75005
  // CheckMode.SkipGenericFunctions is enabled and this is a call to a generic function that
@@ -75105,8 +75104,7 @@ var ts;
75105
75104
  }
75106
75105
  function checkImportCallExpression(node) {
75107
75106
  // Check grammar of dynamic import
75108
- if (!checkGrammarArguments(node.arguments))
75109
- checkGrammarImportCallExpression(node);
75107
+ checkGrammarImportCallExpression(node);
75110
75108
  if (node.arguments.length === 0) {
75111
75109
  return createPromiseReturnType(node, anyType);
75112
75110
  }
@@ -85767,20 +85765,6 @@ var ts;
85767
85765
  }
85768
85766
  return false;
85769
85767
  }
85770
- function checkGrammarForOmittedArgument(args) {
85771
- if (args) {
85772
- for (var _i = 0, args_4 = args; _i < args_4.length; _i++) {
85773
- var arg = args_4[_i];
85774
- if (arg.kind === 226 /* OmittedExpression */) {
85775
- return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
85776
- }
85777
- }
85778
- }
85779
- return false;
85780
- }
85781
- function checkGrammarArguments(args) {
85782
- return checkGrammarForOmittedArgument(args);
85783
- }
85784
85768
  function checkGrammarHeritageClause(node) {
85785
85769
  var types = node.types;
85786
85770
  if (checkGrammarForDisallowedTrailingComma(types)) {
@@ -103028,7 +103012,7 @@ var ts;
103028
103012
  if (ts.isIdentifier(node.expression)) {
103029
103013
  var expression = substituteExpressionIdentifier(node.expression);
103030
103014
  noSubstitution[ts.getNodeId(expression)] = true;
103031
- if (!ts.isIdentifier(expression)) {
103015
+ if (!ts.isIdentifier(expression) && !(ts.getEmitFlags(node.expression) & 4096 /* HelperName */)) {
103032
103016
  return ts.addEmitFlags(factory.updateCallExpression(node, expression,
103033
103017
  /*typeArguments*/ undefined, node.arguments), 536870912 /* IndirectCall */);
103034
103018
  }
@@ -103039,7 +103023,7 @@ var ts;
103039
103023
  if (ts.isIdentifier(node.tag)) {
103040
103024
  var tag = substituteExpressionIdentifier(node.tag);
103041
103025
  noSubstitution[ts.getNodeId(tag)] = true;
103042
- if (!ts.isIdentifier(tag)) {
103026
+ if (!ts.isIdentifier(tag) && !(ts.getEmitFlags(node.tag) & 4096 /* HelperName */)) {
103043
103027
  return ts.addEmitFlags(factory.updateTaggedTemplateExpression(node, tag,
103044
103028
  /*typeArguments*/ undefined, node.template), 536870912 /* IndirectCall */);
103045
103029
  }
@@ -113665,6 +113649,7 @@ var ts;
113665
113649
  ts.getImpliedNodeFormatForFile = getImpliedNodeFormatForFile;
113666
113650
  /** @internal */
113667
113651
  ts.plainJSErrors = new ts.Set([
113652
+ // binder errors
113668
113653
  ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0.code,
113669
113654
  ts.Diagnostics.A_module_cannot_have_multiple_default_exports.code,
113670
113655
  ts.Diagnostics.Another_export_default_is_here.code,
@@ -113680,6 +113665,81 @@ var ts;
113680
113665
  ts.Diagnostics.A_label_is_not_allowed_here.code,
113681
113666
  ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code,
113682
113667
  ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode.code,
113668
+ // grammar errors
113669
+ ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code,
113670
+ ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code,
113671
+ ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name.code,
113672
+ ts.Diagnostics.A_class_member_cannot_have_the_0_keyword.code,
113673
+ ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name.code,
113674
+ ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code,
113675
+ ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
113676
+ ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
113677
+ ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code,
113678
+ ts.Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code,
113679
+ ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context.code,
113680
+ ts.Diagnostics.A_destructuring_declaration_must_have_an_initializer.code,
113681
+ ts.Diagnostics.A_get_accessor_cannot_have_parameters.code,
113682
+ ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern.code,
113683
+ ts.Diagnostics.A_rest_element_cannot_have_a_property_name.code,
113684
+ ts.Diagnostics.A_rest_element_cannot_have_an_initializer.code,
113685
+ ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern.code,
113686
+ ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer.code,
113687
+ ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list.code,
113688
+ ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code,
113689
+ ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body.code,
113690
+ ts.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code,
113691
+ ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter.code,
113692
+ ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code,
113693
+ ts.Diagnostics.An_export_declaration_can_only_be_used_in_a_module.code,
113694
+ ts.Diagnostics.An_export_declaration_cannot_have_modifiers.code,
113695
+ ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module.code,
113696
+ ts.Diagnostics.An_import_declaration_cannot_have_modifiers.code,
113697
+ ts.Diagnostics.An_object_member_cannot_be_declared_optional.code,
113698
+ ts.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code,
113699
+ ts.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code,
113700
+ ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause.code,
113701
+ ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer.code,
113702
+ ts.Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code,
113703
+ ts.Diagnostics.Classes_can_only_extend_a_single_class.code,
113704
+ ts.Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
113705
+ 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,
113706
+ ts.Diagnostics.Duplicate_label_0.code,
113707
+ ts.Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments.code,
113708
+ ts.Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block.code,
113709
+ ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
113710
+ ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
113711
+ ts.Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code,
113712
+ ts.Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code,
113713
+ ts.Diagnostics.Jump_target_cannot_cross_function_boundary.code,
113714
+ ts.Diagnostics.Line_terminator_not_permitted_before_arrow.code,
113715
+ ts.Diagnostics.Modifiers_cannot_appear_here.code,
113716
+ ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code,
113717
+ ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code,
113718
+ ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies.code,
113719
+ 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,
113720
+ ts.Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code,
113721
+ ts.Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code,
113722
+ ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code,
113723
+ ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code,
113724
+ ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code,
113725
+ ts.Diagnostics.Trailing_comma_not_allowed.code,
113726
+ ts.Diagnostics.Variable_declaration_list_cannot_be_empty.code,
113727
+ ts.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses.code,
113728
+ ts.Diagnostics._0_expected.code,
113729
+ ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code,
113730
+ ts.Diagnostics._0_list_cannot_be_empty.code,
113731
+ ts.Diagnostics._0_modifier_already_seen.code,
113732
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration.code,
113733
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element.code,
113734
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter.code,
113735
+ ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind.code,
113736
+ ts.Diagnostics._0_modifier_cannot_be_used_here.code,
113737
+ ts.Diagnostics._0_modifier_must_precede_1_modifier.code,
113738
+ ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block.code,
113739
+ ts.Diagnostics.const_declarations_must_be_initialized.code,
113740
+ ts.Diagnostics.extends_clause_already_seen.code,
113741
+ ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block.code,
113742
+ ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code,
113683
113743
  ]);
113684
113744
  /**
113685
113745
  * Determine if source file needs to be re-created even if its text hasn't changed
@@ -114709,9 +114769,10 @@ var ts;
114709
114769
  var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 /* TS */ || sourceFile.scriptKind === 4 /* TSX */
114710
114770
  || sourceFile.scriptKind === 5 /* External */ || isPlainJs || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */);
114711
114771
  var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray;
114712
- var checkDiagnostics = includeBindAndCheckDiagnostics && !isPlainJs ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
114772
+ var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
114713
114773
  if (isPlainJs) {
114714
114774
  bindDiagnostics = ts.filter(bindDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
114775
+ checkDiagnostics = ts.filter(checkDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
114715
114776
  }
114716
114777
  // skip ts-expect-error errors in plain JS files, and skip JSDoc errors except in checked JS
114717
114778
  return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics && !isPlainJs, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined);
@@ -127399,6 +127460,9 @@ var ts;
127399
127460
  }
127400
127461
  return;
127401
127462
  }
127463
+ if (ts.isConstTypeReference(token.parent)) {
127464
+ return 3 /* keyword */;
127465
+ }
127402
127466
  }
127403
127467
  return 2 /* identifier */;
127404
127468
  }
@@ -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.20211208";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20211209";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -24632,7 +24632,7 @@ var ts;
24632
24632
  // @api
24633
24633
  function createAssertClause(elements, multiLine) {
24634
24634
  var node = createBaseNode(292 /* AssertClause */);
24635
- node.elements = elements;
24635
+ node.elements = createNodeArray(elements);
24636
24636
  node.multiLine = multiLine;
24637
24637
  node.transformFlags |= 4 /* ContainsESNext */;
24638
24638
  return node;
@@ -74537,7 +74537,7 @@ var ts;
74537
74537
  typeArguments.pop();
74538
74538
  }
74539
74539
  while (typeArguments.length < typeParameters.length) {
74540
- typeArguments.push(getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
74540
+ typeArguments.push(getDefaultFromTypeParameter(typeParameters[typeArguments.length]) || getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
74541
74541
  }
74542
74542
  return typeArguments;
74543
74543
  }
@@ -75193,8 +75193,7 @@ var ts;
75193
75193
  */
75194
75194
  function checkCallExpression(node, checkMode) {
75195
75195
  var _a;
75196
- if (!checkGrammarTypeArguments(node, node.typeArguments))
75197
- checkGrammarArguments(node.arguments);
75196
+ checkGrammarTypeArguments(node, node.typeArguments);
75198
75197
  var signature = getResolvedSignature(node, /*candidatesOutArray*/ undefined, checkMode);
75199
75198
  if (signature === resolvingSignature) {
75200
75199
  // CheckMode.SkipGenericFunctions is enabled and this is a call to a generic function that
@@ -75299,8 +75298,7 @@ var ts;
75299
75298
  }
75300
75299
  function checkImportCallExpression(node) {
75301
75300
  // Check grammar of dynamic import
75302
- if (!checkGrammarArguments(node.arguments))
75303
- checkGrammarImportCallExpression(node);
75301
+ checkGrammarImportCallExpression(node);
75304
75302
  if (node.arguments.length === 0) {
75305
75303
  return createPromiseReturnType(node, anyType);
75306
75304
  }
@@ -85961,20 +85959,6 @@ var ts;
85961
85959
  }
85962
85960
  return false;
85963
85961
  }
85964
- function checkGrammarForOmittedArgument(args) {
85965
- if (args) {
85966
- for (var _i = 0, args_4 = args; _i < args_4.length; _i++) {
85967
- var arg = args_4[_i];
85968
- if (arg.kind === 226 /* OmittedExpression */) {
85969
- return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
85970
- }
85971
- }
85972
- }
85973
- return false;
85974
- }
85975
- function checkGrammarArguments(args) {
85976
- return checkGrammarForOmittedArgument(args);
85977
- }
85978
85962
  function checkGrammarHeritageClause(node) {
85979
85963
  var types = node.types;
85980
85964
  if (checkGrammarForDisallowedTrailingComma(types)) {
@@ -103222,7 +103206,7 @@ var ts;
103222
103206
  if (ts.isIdentifier(node.expression)) {
103223
103207
  var expression = substituteExpressionIdentifier(node.expression);
103224
103208
  noSubstitution[ts.getNodeId(expression)] = true;
103225
- if (!ts.isIdentifier(expression)) {
103209
+ if (!ts.isIdentifier(expression) && !(ts.getEmitFlags(node.expression) & 4096 /* HelperName */)) {
103226
103210
  return ts.addEmitFlags(factory.updateCallExpression(node, expression,
103227
103211
  /*typeArguments*/ undefined, node.arguments), 536870912 /* IndirectCall */);
103228
103212
  }
@@ -103233,7 +103217,7 @@ var ts;
103233
103217
  if (ts.isIdentifier(node.tag)) {
103234
103218
  var tag = substituteExpressionIdentifier(node.tag);
103235
103219
  noSubstitution[ts.getNodeId(tag)] = true;
103236
- if (!ts.isIdentifier(tag)) {
103220
+ if (!ts.isIdentifier(tag) && !(ts.getEmitFlags(node.tag) & 4096 /* HelperName */)) {
103237
103221
  return ts.addEmitFlags(factory.updateTaggedTemplateExpression(node, tag,
103238
103222
  /*typeArguments*/ undefined, node.template), 536870912 /* IndirectCall */);
103239
103223
  }
@@ -113859,6 +113843,7 @@ var ts;
113859
113843
  ts.getImpliedNodeFormatForFile = getImpliedNodeFormatForFile;
113860
113844
  /** @internal */
113861
113845
  ts.plainJSErrors = new ts.Set([
113846
+ // binder errors
113862
113847
  ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0.code,
113863
113848
  ts.Diagnostics.A_module_cannot_have_multiple_default_exports.code,
113864
113849
  ts.Diagnostics.Another_export_default_is_here.code,
@@ -113874,6 +113859,81 @@ var ts;
113874
113859
  ts.Diagnostics.A_label_is_not_allowed_here.code,
113875
113860
  ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code,
113876
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,
113877
113937
  ]);
113878
113938
  /**
113879
113939
  * Determine if source file needs to be re-created even if its text hasn't changed
@@ -114903,9 +114963,10 @@ var ts;
114903
114963
  var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 /* TS */ || sourceFile.scriptKind === 4 /* TSX */
114904
114964
  || sourceFile.scriptKind === 5 /* External */ || isPlainJs || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */);
114905
114965
  var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray;
114906
- var checkDiagnostics = includeBindAndCheckDiagnostics && !isPlainJs ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
114966
+ var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
114907
114967
  if (isPlainJs) {
114908
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); });
114909
114970
  }
114910
114971
  // skip ts-expect-error errors in plain JS files, and skip JSDoc errors except in checked JS
114911
114972
  return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics && !isPlainJs, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined);
@@ -127981,6 +128042,9 @@ var ts;
127981
128042
  }
127982
128043
  return;
127983
128044
  }
128045
+ if (ts.isConstTypeReference(token.parent)) {
128046
+ return 3 /* keyword */;
128047
+ }
127984
128048
  }
127985
128049
  return 2 /* identifier */;
127986
128050
  }
package/lib/typescript.js CHANGED
@@ -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.20211208";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20211209";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -24632,7 +24632,7 @@ var ts;
24632
24632
  // @api
24633
24633
  function createAssertClause(elements, multiLine) {
24634
24634
  var node = createBaseNode(292 /* AssertClause */);
24635
- node.elements = elements;
24635
+ node.elements = createNodeArray(elements);
24636
24636
  node.multiLine = multiLine;
24637
24637
  node.transformFlags |= 4 /* ContainsESNext */;
24638
24638
  return node;
@@ -74537,7 +74537,7 @@ var ts;
74537
74537
  typeArguments.pop();
74538
74538
  }
74539
74539
  while (typeArguments.length < typeParameters.length) {
74540
- typeArguments.push(getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
74540
+ typeArguments.push(getDefaultFromTypeParameter(typeParameters[typeArguments.length]) || getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
74541
74541
  }
74542
74542
  return typeArguments;
74543
74543
  }
@@ -75193,8 +75193,7 @@ var ts;
75193
75193
  */
75194
75194
  function checkCallExpression(node, checkMode) {
75195
75195
  var _a;
75196
- if (!checkGrammarTypeArguments(node, node.typeArguments))
75197
- checkGrammarArguments(node.arguments);
75196
+ checkGrammarTypeArguments(node, node.typeArguments);
75198
75197
  var signature = getResolvedSignature(node, /*candidatesOutArray*/ undefined, checkMode);
75199
75198
  if (signature === resolvingSignature) {
75200
75199
  // CheckMode.SkipGenericFunctions is enabled and this is a call to a generic function that
@@ -75299,8 +75298,7 @@ var ts;
75299
75298
  }
75300
75299
  function checkImportCallExpression(node) {
75301
75300
  // Check grammar of dynamic import
75302
- if (!checkGrammarArguments(node.arguments))
75303
- checkGrammarImportCallExpression(node);
75301
+ checkGrammarImportCallExpression(node);
75304
75302
  if (node.arguments.length === 0) {
75305
75303
  return createPromiseReturnType(node, anyType);
75306
75304
  }
@@ -85961,20 +85959,6 @@ var ts;
85961
85959
  }
85962
85960
  return false;
85963
85961
  }
85964
- function checkGrammarForOmittedArgument(args) {
85965
- if (args) {
85966
- for (var _i = 0, args_4 = args; _i < args_4.length; _i++) {
85967
- var arg = args_4[_i];
85968
- if (arg.kind === 226 /* OmittedExpression */) {
85969
- return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
85970
- }
85971
- }
85972
- }
85973
- return false;
85974
- }
85975
- function checkGrammarArguments(args) {
85976
- return checkGrammarForOmittedArgument(args);
85977
- }
85978
85962
  function checkGrammarHeritageClause(node) {
85979
85963
  var types = node.types;
85980
85964
  if (checkGrammarForDisallowedTrailingComma(types)) {
@@ -103222,7 +103206,7 @@ var ts;
103222
103206
  if (ts.isIdentifier(node.expression)) {
103223
103207
  var expression = substituteExpressionIdentifier(node.expression);
103224
103208
  noSubstitution[ts.getNodeId(expression)] = true;
103225
- if (!ts.isIdentifier(expression)) {
103209
+ if (!ts.isIdentifier(expression) && !(ts.getEmitFlags(node.expression) & 4096 /* HelperName */)) {
103226
103210
  return ts.addEmitFlags(factory.updateCallExpression(node, expression,
103227
103211
  /*typeArguments*/ undefined, node.arguments), 536870912 /* IndirectCall */);
103228
103212
  }
@@ -103233,7 +103217,7 @@ var ts;
103233
103217
  if (ts.isIdentifier(node.tag)) {
103234
103218
  var tag = substituteExpressionIdentifier(node.tag);
103235
103219
  noSubstitution[ts.getNodeId(tag)] = true;
103236
- if (!ts.isIdentifier(tag)) {
103220
+ if (!ts.isIdentifier(tag) && !(ts.getEmitFlags(node.tag) & 4096 /* HelperName */)) {
103237
103221
  return ts.addEmitFlags(factory.updateTaggedTemplateExpression(node, tag,
103238
103222
  /*typeArguments*/ undefined, node.template), 536870912 /* IndirectCall */);
103239
103223
  }
@@ -113859,6 +113843,7 @@ var ts;
113859
113843
  ts.getImpliedNodeFormatForFile = getImpliedNodeFormatForFile;
113860
113844
  /** @internal */
113861
113845
  ts.plainJSErrors = new ts.Set([
113846
+ // binder errors
113862
113847
  ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0.code,
113863
113848
  ts.Diagnostics.A_module_cannot_have_multiple_default_exports.code,
113864
113849
  ts.Diagnostics.Another_export_default_is_here.code,
@@ -113874,6 +113859,81 @@ var ts;
113874
113859
  ts.Diagnostics.A_label_is_not_allowed_here.code,
113875
113860
  ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code,
113876
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,
113877
113937
  ]);
113878
113938
  /**
113879
113939
  * Determine if source file needs to be re-created even if its text hasn't changed
@@ -114903,9 +114963,10 @@ var ts;
114903
114963
  var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 /* TS */ || sourceFile.scriptKind === 4 /* TSX */
114904
114964
  || sourceFile.scriptKind === 5 /* External */ || isPlainJs || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */);
114905
114965
  var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray;
114906
- var checkDiagnostics = includeBindAndCheckDiagnostics && !isPlainJs ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
114966
+ var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
114907
114967
  if (isPlainJs) {
114908
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); });
114909
114970
  }
114910
114971
  // skip ts-expect-error errors in plain JS files, and skip JSDoc errors except in checked JS
114911
114972
  return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics && !isPlainJs, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined);
@@ -127981,6 +128042,9 @@ var ts;
127981
128042
  }
127982
128043
  return;
127983
128044
  }
128045
+ if (ts.isConstTypeReference(token.parent)) {
128046
+ return 3 /* keyword */;
128047
+ }
127984
128048
  }
127985
128049
  return 2 /* identifier */;
127986
128050
  }
@@ -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.20211208";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20211209";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -24632,7 +24632,7 @@ var ts;
24632
24632
  // @api
24633
24633
  function createAssertClause(elements, multiLine) {
24634
24634
  var node = createBaseNode(292 /* AssertClause */);
24635
- node.elements = elements;
24635
+ node.elements = createNodeArray(elements);
24636
24636
  node.multiLine = multiLine;
24637
24637
  node.transformFlags |= 4 /* ContainsESNext */;
24638
24638
  return node;
@@ -74537,7 +74537,7 @@ var ts;
74537
74537
  typeArguments.pop();
74538
74538
  }
74539
74539
  while (typeArguments.length < typeParameters.length) {
74540
- typeArguments.push(getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
74540
+ typeArguments.push(getDefaultFromTypeParameter(typeParameters[typeArguments.length]) || getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
74541
74541
  }
74542
74542
  return typeArguments;
74543
74543
  }
@@ -75193,8 +75193,7 @@ var ts;
75193
75193
  */
75194
75194
  function checkCallExpression(node, checkMode) {
75195
75195
  var _a;
75196
- if (!checkGrammarTypeArguments(node, node.typeArguments))
75197
- checkGrammarArguments(node.arguments);
75196
+ checkGrammarTypeArguments(node, node.typeArguments);
75198
75197
  var signature = getResolvedSignature(node, /*candidatesOutArray*/ undefined, checkMode);
75199
75198
  if (signature === resolvingSignature) {
75200
75199
  // CheckMode.SkipGenericFunctions is enabled and this is a call to a generic function that
@@ -75299,8 +75298,7 @@ var ts;
75299
75298
  }
75300
75299
  function checkImportCallExpression(node) {
75301
75300
  // Check grammar of dynamic import
75302
- if (!checkGrammarArguments(node.arguments))
75303
- checkGrammarImportCallExpression(node);
75301
+ checkGrammarImportCallExpression(node);
75304
75302
  if (node.arguments.length === 0) {
75305
75303
  return createPromiseReturnType(node, anyType);
75306
75304
  }
@@ -85961,20 +85959,6 @@ var ts;
85961
85959
  }
85962
85960
  return false;
85963
85961
  }
85964
- function checkGrammarForOmittedArgument(args) {
85965
- if (args) {
85966
- for (var _i = 0, args_4 = args; _i < args_4.length; _i++) {
85967
- var arg = args_4[_i];
85968
- if (arg.kind === 226 /* OmittedExpression */) {
85969
- return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
85970
- }
85971
- }
85972
- }
85973
- return false;
85974
- }
85975
- function checkGrammarArguments(args) {
85976
- return checkGrammarForOmittedArgument(args);
85977
- }
85978
85962
  function checkGrammarHeritageClause(node) {
85979
85963
  var types = node.types;
85980
85964
  if (checkGrammarForDisallowedTrailingComma(types)) {
@@ -103222,7 +103206,7 @@ var ts;
103222
103206
  if (ts.isIdentifier(node.expression)) {
103223
103207
  var expression = substituteExpressionIdentifier(node.expression);
103224
103208
  noSubstitution[ts.getNodeId(expression)] = true;
103225
- if (!ts.isIdentifier(expression)) {
103209
+ if (!ts.isIdentifier(expression) && !(ts.getEmitFlags(node.expression) & 4096 /* HelperName */)) {
103226
103210
  return ts.addEmitFlags(factory.updateCallExpression(node, expression,
103227
103211
  /*typeArguments*/ undefined, node.arguments), 536870912 /* IndirectCall */);
103228
103212
  }
@@ -103233,7 +103217,7 @@ var ts;
103233
103217
  if (ts.isIdentifier(node.tag)) {
103234
103218
  var tag = substituteExpressionIdentifier(node.tag);
103235
103219
  noSubstitution[ts.getNodeId(tag)] = true;
103236
- if (!ts.isIdentifier(tag)) {
103220
+ if (!ts.isIdentifier(tag) && !(ts.getEmitFlags(node.tag) & 4096 /* HelperName */)) {
103237
103221
  return ts.addEmitFlags(factory.updateTaggedTemplateExpression(node, tag,
103238
103222
  /*typeArguments*/ undefined, node.template), 536870912 /* IndirectCall */);
103239
103223
  }
@@ -113859,6 +113843,7 @@ var ts;
113859
113843
  ts.getImpliedNodeFormatForFile = getImpliedNodeFormatForFile;
113860
113844
  /** @internal */
113861
113845
  ts.plainJSErrors = new ts.Set([
113846
+ // binder errors
113862
113847
  ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0.code,
113863
113848
  ts.Diagnostics.A_module_cannot_have_multiple_default_exports.code,
113864
113849
  ts.Diagnostics.Another_export_default_is_here.code,
@@ -113874,6 +113859,81 @@ var ts;
113874
113859
  ts.Diagnostics.A_label_is_not_allowed_here.code,
113875
113860
  ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code,
113876
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,
113877
113937
  ]);
113878
113938
  /**
113879
113939
  * Determine if source file needs to be re-created even if its text hasn't changed
@@ -114903,9 +114963,10 @@ var ts;
114903
114963
  var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 /* TS */ || sourceFile.scriptKind === 4 /* TSX */
114904
114964
  || sourceFile.scriptKind === 5 /* External */ || isPlainJs || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */);
114905
114965
  var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray;
114906
- var checkDiagnostics = includeBindAndCheckDiagnostics && !isPlainJs ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
114966
+ var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
114907
114967
  if (isPlainJs) {
114908
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); });
114909
114970
  }
114910
114971
  // skip ts-expect-error errors in plain JS files, and skip JSDoc errors except in checked JS
114911
114972
  return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics && !isPlainJs, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined);
@@ -127981,6 +128042,9 @@ var ts;
127981
128042
  }
127982
128043
  return;
127983
128044
  }
128045
+ if (ts.isConstTypeReference(token.parent)) {
128046
+ return 3 /* keyword */;
128047
+ }
127984
128048
  }
127985
128049
  return 2 /* identifier */;
127986
128050
  }
@@ -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.20211208";
92
+ ts.version = ts.versionMajorMinor + ".0-dev.20211209";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -24427,7 +24427,7 @@ var ts;
24427
24427
  // @api
24428
24428
  function createAssertClause(elements, multiLine) {
24429
24429
  var node = createBaseNode(292 /* AssertClause */);
24430
- node.elements = elements;
24430
+ node.elements = createNodeArray(elements);
24431
24431
  node.multiLine = multiLine;
24432
24432
  node.transformFlags |= 4 /* ContainsESNext */;
24433
24433
  return node;
@@ -74332,7 +74332,7 @@ var ts;
74332
74332
  typeArguments.pop();
74333
74333
  }
74334
74334
  while (typeArguments.length < typeParameters.length) {
74335
- typeArguments.push(getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
74335
+ typeArguments.push(getDefaultFromTypeParameter(typeParameters[typeArguments.length]) || getConstraintOfTypeParameter(typeParameters[typeArguments.length]) || getDefaultTypeArgumentType(isJs));
74336
74336
  }
74337
74337
  return typeArguments;
74338
74338
  }
@@ -74988,8 +74988,7 @@ var ts;
74988
74988
  */
74989
74989
  function checkCallExpression(node, checkMode) {
74990
74990
  var _a;
74991
- if (!checkGrammarTypeArguments(node, node.typeArguments))
74992
- checkGrammarArguments(node.arguments);
74991
+ checkGrammarTypeArguments(node, node.typeArguments);
74993
74992
  var signature = getResolvedSignature(node, /*candidatesOutArray*/ undefined, checkMode);
74994
74993
  if (signature === resolvingSignature) {
74995
74994
  // CheckMode.SkipGenericFunctions is enabled and this is a call to a generic function that
@@ -75094,8 +75093,7 @@ var ts;
75094
75093
  }
75095
75094
  function checkImportCallExpression(node) {
75096
75095
  // Check grammar of dynamic import
75097
- if (!checkGrammarArguments(node.arguments))
75098
- checkGrammarImportCallExpression(node);
75096
+ checkGrammarImportCallExpression(node);
75099
75097
  if (node.arguments.length === 0) {
75100
75098
  return createPromiseReturnType(node, anyType);
75101
75099
  }
@@ -85756,20 +85754,6 @@ var ts;
85756
85754
  }
85757
85755
  return false;
85758
85756
  }
85759
- function checkGrammarForOmittedArgument(args) {
85760
- if (args) {
85761
- for (var _i = 0, args_4 = args; _i < args_4.length; _i++) {
85762
- var arg = args_4[_i];
85763
- if (arg.kind === 226 /* OmittedExpression */) {
85764
- return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected);
85765
- }
85766
- }
85767
- }
85768
- return false;
85769
- }
85770
- function checkGrammarArguments(args) {
85771
- return checkGrammarForOmittedArgument(args);
85772
- }
85773
85757
  function checkGrammarHeritageClause(node) {
85774
85758
  var types = node.types;
85775
85759
  if (checkGrammarForDisallowedTrailingComma(types)) {
@@ -103017,7 +103001,7 @@ var ts;
103017
103001
  if (ts.isIdentifier(node.expression)) {
103018
103002
  var expression = substituteExpressionIdentifier(node.expression);
103019
103003
  noSubstitution[ts.getNodeId(expression)] = true;
103020
- if (!ts.isIdentifier(expression)) {
103004
+ if (!ts.isIdentifier(expression) && !(ts.getEmitFlags(node.expression) & 4096 /* HelperName */)) {
103021
103005
  return ts.addEmitFlags(factory.updateCallExpression(node, expression,
103022
103006
  /*typeArguments*/ undefined, node.arguments), 536870912 /* IndirectCall */);
103023
103007
  }
@@ -103028,7 +103012,7 @@ var ts;
103028
103012
  if (ts.isIdentifier(node.tag)) {
103029
103013
  var tag = substituteExpressionIdentifier(node.tag);
103030
103014
  noSubstitution[ts.getNodeId(tag)] = true;
103031
- if (!ts.isIdentifier(tag)) {
103015
+ if (!ts.isIdentifier(tag) && !(ts.getEmitFlags(node.tag) & 4096 /* HelperName */)) {
103032
103016
  return ts.addEmitFlags(factory.updateTaggedTemplateExpression(node, tag,
103033
103017
  /*typeArguments*/ undefined, node.template), 536870912 /* IndirectCall */);
103034
103018
  }
@@ -113654,6 +113638,7 @@ var ts;
113654
113638
  ts.getImpliedNodeFormatForFile = getImpliedNodeFormatForFile;
113655
113639
  /** @internal */
113656
113640
  ts.plainJSErrors = new ts.Set([
113641
+ // binder errors
113657
113642
  ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0.code,
113658
113643
  ts.Diagnostics.A_module_cannot_have_multiple_default_exports.code,
113659
113644
  ts.Diagnostics.Another_export_default_is_here.code,
@@ -113669,6 +113654,81 @@ var ts;
113669
113654
  ts.Diagnostics.A_label_is_not_allowed_here.code,
113670
113655
  ts.Diagnostics.Octal_literals_are_not_allowed_in_strict_mode.code,
113671
113656
  ts.Diagnostics.with_statements_are_not_allowed_in_strict_mode.code,
113657
+ // grammar errors
113658
+ ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement.code,
113659
+ ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement.code,
113660
+ ts.Diagnostics.A_class_declaration_without_the_default_modifier_must_have_a_name.code,
113661
+ ts.Diagnostics.A_class_member_cannot_have_the_0_keyword.code,
113662
+ ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name.code,
113663
+ ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement.code,
113664
+ ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
113665
+ ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement.code,
113666
+ ts.Diagnostics.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement.code,
113667
+ ts.Diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration.code,
113668
+ ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context.code,
113669
+ ts.Diagnostics.A_destructuring_declaration_must_have_an_initializer.code,
113670
+ ts.Diagnostics.A_get_accessor_cannot_have_parameters.code,
113671
+ ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern.code,
113672
+ ts.Diagnostics.A_rest_element_cannot_have_a_property_name.code,
113673
+ ts.Diagnostics.A_rest_element_cannot_have_an_initializer.code,
113674
+ ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern.code,
113675
+ ts.Diagnostics.A_rest_parameter_cannot_have_an_initializer.code,
113676
+ ts.Diagnostics.A_rest_parameter_must_be_last_in_a_parameter_list.code,
113677
+ ts.Diagnostics.A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma.code,
113678
+ ts.Diagnostics.A_return_statement_can_only_be_used_within_a_function_body.code,
113679
+ ts.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code,
113680
+ ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter.code,
113681
+ ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code,
113682
+ ts.Diagnostics.An_export_declaration_can_only_be_used_in_a_module.code,
113683
+ ts.Diagnostics.An_export_declaration_cannot_have_modifiers.code,
113684
+ ts.Diagnostics.An_import_declaration_can_only_be_used_in_a_namespace_or_module.code,
113685
+ ts.Diagnostics.An_import_declaration_cannot_have_modifiers.code,
113686
+ ts.Diagnostics.An_object_member_cannot_be_declared_optional.code,
113687
+ ts.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code,
113688
+ ts.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable.code,
113689
+ ts.Diagnostics.Cannot_redeclare_identifier_0_in_catch_clause.code,
113690
+ ts.Diagnostics.Catch_clause_variable_cannot_have_an_initializer.code,
113691
+ ts.Diagnostics.Class_decorators_can_t_be_used_with_static_private_identifier_Consider_removing_the_experimental_decorator.code,
113692
+ ts.Diagnostics.Classes_can_only_extend_a_single_class.code,
113693
+ ts.Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
113694
+ 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,
113695
+ ts.Diagnostics.Duplicate_label_0.code,
113696
+ ts.Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments.code,
113697
+ ts.Diagnostics.For_await_loops_cannot_be_used_inside_a_class_static_block.code,
113698
+ ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
113699
+ ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
113700
+ ts.Diagnostics.JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array.code,
113701
+ ts.Diagnostics.JSX_property_access_expressions_cannot_include_JSX_namespace_names.code,
113702
+ ts.Diagnostics.Jump_target_cannot_cross_function_boundary.code,
113703
+ ts.Diagnostics.Line_terminator_not_permitted_before_arrow.code,
113704
+ ts.Diagnostics.Modifiers_cannot_appear_here.code,
113705
+ ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement.code,
113706
+ ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement.code,
113707
+ ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies.code,
113708
+ 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,
113709
+ ts.Diagnostics.Property_0_is_not_accessible_outside_class_1_because_it_has_a_private_identifier.code,
113710
+ ts.Diagnostics.Tagged_template_expressions_are_not_permitted_in_an_optional_chain.code,
113711
+ ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_may_not_be_async.code,
113712
+ ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer.code,
113713
+ ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer.code,
113714
+ ts.Diagnostics.Trailing_comma_not_allowed.code,
113715
+ ts.Diagnostics.Variable_declaration_list_cannot_be_empty.code,
113716
+ ts.Diagnostics._0_and_1_operations_cannot_be_mixed_without_parentheses.code,
113717
+ ts.Diagnostics._0_expected.code,
113718
+ ts.Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2.code,
113719
+ ts.Diagnostics._0_list_cannot_be_empty.code,
113720
+ ts.Diagnostics._0_modifier_already_seen.code,
113721
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration.code,
113722
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element.code,
113723
+ ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter.code,
113724
+ ts.Diagnostics._0_modifier_cannot_appear_on_class_elements_of_this_kind.code,
113725
+ ts.Diagnostics._0_modifier_cannot_be_used_here.code,
113726
+ ts.Diagnostics._0_modifier_must_precede_1_modifier.code,
113727
+ ts.Diagnostics.const_declarations_can_only_be_declared_inside_a_block.code,
113728
+ ts.Diagnostics.const_declarations_must_be_initialized.code,
113729
+ ts.Diagnostics.extends_clause_already_seen.code,
113730
+ ts.Diagnostics.let_declarations_can_only_be_declared_inside_a_block.code,
113731
+ ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code,
113672
113732
  ]);
113673
113733
  /**
113674
113734
  * Determine if source file needs to be re-created even if its text hasn't changed
@@ -114698,9 +114758,10 @@ var ts;
114698
114758
  var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 /* TS */ || sourceFile.scriptKind === 4 /* TSX */
114699
114759
  || sourceFile.scriptKind === 5 /* External */ || isPlainJs || isCheckJs || sourceFile.scriptKind === 7 /* Deferred */);
114700
114760
  var bindDiagnostics = includeBindAndCheckDiagnostics ? sourceFile.bindDiagnostics : ts.emptyArray;
114701
- var checkDiagnostics = includeBindAndCheckDiagnostics && !isPlainJs ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
114761
+ var checkDiagnostics = includeBindAndCheckDiagnostics ? typeChecker.getDiagnostics(sourceFile, cancellationToken) : ts.emptyArray;
114702
114762
  if (isPlainJs) {
114703
114763
  bindDiagnostics = ts.filter(bindDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
114764
+ checkDiagnostics = ts.filter(checkDiagnostics, function (d) { return ts.plainJSErrors.has(d.code); });
114704
114765
  }
114705
114766
  // skip ts-expect-error errors in plain JS files, and skip JSDoc errors except in checked JS
114706
114767
  return getMergedBindAndCheckDiagnostics(sourceFile, includeBindAndCheckDiagnostics && !isPlainJs, bindDiagnostics, checkDiagnostics, isCheckJs ? sourceFile.jsDocDiagnostics : undefined);
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.20211208",
5
+ "version": "4.6.0-dev.20211209",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [