typescript 5.5.0-dev.20240311 → 5.5.0-dev.20240313

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
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.5";
21
- var version = `${versionMajorMinor}.0-dev.20240311`;
21
+ var version = `${versionMajorMinor}.0-dev.20240313`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -6342,7 +6342,7 @@ var Diagnostics = {
6342
6342
  Overload_signatures_must_all_be_abstract_or_non_abstract: diag(2512, 1 /* Error */, "Overload_signatures_must_all_be_abstract_or_non_abstract_2512", "Overload signatures must all be abstract or non-abstract."),
6343
6343
  Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression: diag(2513, 1 /* Error */, "Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression_2513", "Abstract method '{0}' in class '{1}' cannot be accessed via super expression."),
6344
6344
  A_tuple_type_cannot_be_indexed_with_a_negative_value: diag(2514, 1 /* Error */, "A_tuple_type_cannot_be_indexed_with_a_negative_value_2514", "A tuple type cannot be indexed with a negative value."),
6345
- Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2: diag(2515, 1 /* Error */, "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515", "Non-abstract class '{0}' does not implement inherited abstract member '{1}' from class '{2}'."),
6345
+ Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2: diag(2515, 1 /* Error */, "Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2_2515", "Non-abstract class '{0}' does not implement inherited abstract member {1} from class '{2}'."),
6346
6346
  All_declarations_of_an_abstract_method_must_be_consecutive: diag(2516, 1 /* Error */, "All_declarations_of_an_abstract_method_must_be_consecutive_2516", "All declarations of an abstract method must be consecutive."),
6347
6347
  Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: diag(2517, 1 /* Error */, "Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type_2517", "Cannot assign an abstract constructor type to a non-abstract constructor type."),
6348
6348
  A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: diag(2518, 1 /* Error */, "A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard_2518", "A 'this'-based type guard is not compatible with a parameter-based type guard."),
@@ -6452,9 +6452,13 @@ var Diagnostics = {
6452
6452
  Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator: diag(2638, 1 /* Error */, "Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operato_2638", "Type '{0}' may represent a primitive value, which is not permitted as the right operand of the 'in' operator."),
6453
6453
  React_components_cannot_include_JSX_namespace_names: diag(2639, 1 /* Error */, "React_components_cannot_include_JSX_namespace_names_2639", "React components cannot include JSX namespace names"),
6454
6454
  Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: diag(2649, 1 /* Error */, "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", "Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),
6455
+ Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and_2_more: diag(2650, 1 /* Error */, "Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and__2650", "Non-abstract class expression is missing implementations for the following members of '{0}': {1} and {2} more."),
6455
6456
  A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: diag(2651, 1 /* Error */, "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),
6456
6457
  Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: diag(2652, 1 /* Error */, "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),
6457
6458
  Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1: diag(2653, 1 /* Error */, "Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1_2653", "Non-abstract class expression does not implement inherited abstract member '{0}' from class '{1}'."),
6459
+ Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2: diag(2654, 1 /* Error */, "Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_2654", "Non-abstract class '{0}' is missing implementations for the following members of '{1}': {2}."),
6460
+ Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more: diag(2655, 1 /* Error */, "Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more_2655", "Non-abstract class '{0}' is missing implementations for the following members of '{1}': {2} and {3} more."),
6461
+ Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1: diag(2656, 1 /* Error */, "Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_2656", "Non-abstract class expression is missing implementations for the following members of '{0}': {1}."),
6458
6462
  JSX_expressions_must_have_one_parent_element: diag(2657, 1 /* Error */, "JSX_expressions_must_have_one_parent_element_2657", "JSX expressions must have one parent element."),
6459
6463
  Type_0_provides_no_match_for_the_signature_1: diag(2658, 1 /* Error */, "Type_0_provides_no_match_for_the_signature_1_2658", "Type '{0}' provides no match for the signature '{1}'."),
6460
6464
  super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: diag(2659, 1 /* Error */, "super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_highe_2659", "'super' is only allowed in members of object literal expressions when option 'target' is 'ES2015' or higher."),
@@ -7783,7 +7787,6 @@ var Diagnostics = {
7783
7787
  _0_is_possibly_null_or_undefined: diag(18049, 1 /* Error */, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
7784
7788
  The_value_0_cannot_be_used_here: diag(18050, 1 /* Error */, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
7785
7789
  Compiler_option_0_cannot_be_given_an_empty_string: diag(18051, 1 /* Error */, "Compiler_option_0_cannot_be_given_an_empty_string_18051", "Compiler option '{0}' cannot be given an empty string."),
7786
- Non_abstract_class_0_does_not_implement_all_abstract_members_of_1: diag(18052, 1 /* Error */, "Non_abstract_class_0_does_not_implement_all_abstract_members_of_1_18052", "Non-abstract class '{0}' does not implement all abstract members of '{1}'"),
7787
7790
  Its_type_0_is_not_a_valid_JSX_element_type: diag(18053, 1 /* Error */, "Its_type_0_is_not_a_valid_JSX_element_type_18053", "Its type '{0}' is not a valid JSX element type."),
7788
7791
  await_using_statements_cannot_be_used_inside_a_class_static_block: diag(18054, 1 /* Error */, "await_using_statements_cannot_be_used_inside_a_class_static_block_18054", "'await using' statements cannot be used inside a class static block.")
7789
7792
  };
@@ -17570,7 +17573,7 @@ function canUsePropertyAccess(name, languageVersion) {
17570
17573
  }
17571
17574
  function isJSDocOptionalParameter(node) {
17572
17575
  return isInJSFile(node) && // node.type should only be a JSDocOptionalType when node is a parameter of a JSDocFunctionType
17573
- (node.type && node.type.kind === 316 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(({ isBracketed, typeExpression }) => isBracketed || !!typeExpression && typeExpression.type.kind === 316 /* JSDocOptionalType */));
17576
+ (node.type && node.type.kind === 316 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(isOptionalJSDocPropertyLikeTag));
17574
17577
  }
17575
17578
  function isOptionalDeclaration(declaration) {
17576
17579
  switch (declaration.kind) {
@@ -44179,8 +44182,6 @@ function createTypeChecker(host) {
44179
44182
  var comparableRelation = /* @__PURE__ */ new Map();
44180
44183
  var identityRelation = /* @__PURE__ */ new Map();
44181
44184
  var enumRelation = /* @__PURE__ */ new Map();
44182
- var builtinGlobals = createSymbolTable();
44183
- builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol);
44184
44185
  var suggestedExtensions = [
44185
44186
  [".mts", ".mjs"],
44186
44187
  [".ts", ".js"],
@@ -44598,17 +44599,17 @@ function createTypeChecker(host) {
44598
44599
  }
44599
44600
  }
44600
44601
  }
44601
- function addToSymbolTable(target, source, message) {
44602
- source.forEach((sourceSymbol, id) => {
44603
- const targetSymbol = target.get(id);
44604
- if (targetSymbol) {
44605
- forEach(targetSymbol.declarations, addDeclarationDiagnostic(unescapeLeadingUnderscores(id), message));
44606
- } else {
44607
- target.set(id, sourceSymbol);
44608
- }
44609
- });
44610
- function addDeclarationDiagnostic(id, message2) {
44611
- return (declaration) => diagnostics.add(createDiagnosticForNode(declaration, message2, id));
44602
+ function addUndefinedToGlobalsOrErrorOnRedeclaration() {
44603
+ const name = undefinedSymbol.escapedName;
44604
+ const targetSymbol = globals.get(name);
44605
+ if (targetSymbol) {
44606
+ forEach(targetSymbol.declarations, (declaration) => {
44607
+ if (!isTypeDeclaration(declaration)) {
44608
+ diagnostics.add(createDiagnosticForNode(declaration, Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0, unescapeLeadingUnderscores(name)));
44609
+ }
44610
+ });
44611
+ } else {
44612
+ globals.set(name, undefinedSymbol);
44612
44613
  }
44613
44614
  }
44614
44615
  function getSymbolLinks(symbol) {
@@ -44678,7 +44679,14 @@ function createTypeChecker(host) {
44678
44679
  } else if (declaration.kind === 260 /* VariableDeclaration */) {
44679
44680
  return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage);
44680
44681
  } else if (isClassLike(declaration)) {
44681
- return !findAncestor(usage, (n) => isComputedPropertyName(n) && n.parent.parent === declaration);
44682
+ const container = findAncestor(usage, (n) => n === declaration ? "quit" : isComputedPropertyName(n) ? n.parent.parent === declaration : isDecorator(n) && (n.parent === declaration || isMethodDeclaration(n.parent) && n.parent.parent === declaration || isGetOrSetAccessorDeclaration(n.parent) && n.parent.parent === declaration || isPropertyDeclaration(n.parent) && n.parent.parent === declaration || isParameter(n.parent) && n.parent.parent.parent === declaration));
44683
+ if (!container) {
44684
+ return true;
44685
+ }
44686
+ if (isDecorator(container)) {
44687
+ return !!findAncestor(usage, (n) => n === container ? "quit" : isFunctionLike(n) && !getImmediatelyInvokedFunctionExpression(n));
44688
+ }
44689
+ return false;
44682
44690
  } else if (isPropertyDeclaration(declaration)) {
44683
44691
  return !isPropertyImmediatelyReferencedWithinDeclaration(
44684
44692
  declaration,
@@ -55351,10 +55359,16 @@ function createTypeChecker(host) {
55351
55359
  const symbol = getSymbol(globals, '"' + moduleName + '"', 512 /* ValueModule */);
55352
55360
  return symbol && withAugmentations ? getMergedSymbol(symbol) : symbol;
55353
55361
  }
55362
+ function hasEffectiveQuestionToken(node) {
55363
+ return hasQuestionToken(node) || isOptionalJSDocPropertyLikeTag(node) || isParameter(node) && isJSDocOptionalParameter(node);
55364
+ }
55354
55365
  function isOptionalParameter(node) {
55355
- if (hasQuestionToken(node) || isOptionalJSDocPropertyLikeTag(node) || isJSDocOptionalParameter(node)) {
55366
+ if (hasEffectiveQuestionToken(node)) {
55356
55367
  return true;
55357
55368
  }
55369
+ if (!isParameter(node)) {
55370
+ return false;
55371
+ }
55358
55372
  if (node.initializer) {
55359
55373
  const signature = getSignatureFromDeclaration(node.parent);
55360
55374
  const parameterIndex = node.parent.parameters.indexOf(node);
@@ -55454,7 +55468,7 @@ function createTypeChecker(host) {
55454
55468
  if (type && type.kind === 201 /* LiteralType */) {
55455
55469
  flags |= 2 /* HasLiteralTypes */;
55456
55470
  }
55457
- const isOptionalParameter2 = isOptionalJSDocPropertyLikeTag(param) || param.initializer || param.questionToken || isRestParameter(param) || iife && parameters.length > iife.arguments.length && !type || isJSDocOptionalParameter(param);
55471
+ const isOptionalParameter2 = hasEffectiveQuestionToken(param) || isParameter(param) && param.initializer || isRestParameter(param) || iife && parameters.length > iife.arguments.length && !type;
55458
55472
  if (!isOptionalParameter2) {
55459
55473
  minArgumentCount = parameters.length;
55460
55474
  }
@@ -60572,7 +60586,7 @@ function createTypeChecker(host) {
60572
60586
  if (reduced !== type) {
60573
60587
  return reduced;
60574
60588
  }
60575
- if (type.flags & 2097152 /* Intersection */ && some(type.types, isEmptyAnonymousObjectType)) {
60589
+ if (type.flags & 2097152 /* Intersection */ && shouldNormalizeIntersection(type)) {
60576
60590
  const normalizedTypes = sameMap(type.types, (t) => getNormalizedType(t, writing));
60577
60591
  if (normalizedTypes !== type.types) {
60578
60592
  return getIntersectionType(normalizedTypes);
@@ -60580,6 +60594,17 @@ function createTypeChecker(host) {
60580
60594
  }
60581
60595
  return type;
60582
60596
  }
60597
+ function shouldNormalizeIntersection(type) {
60598
+ let hasInstantiable = false;
60599
+ let hasNullableOrEmpty = false;
60600
+ for (const t of type.types) {
60601
+ hasInstantiable || (hasInstantiable = !!(t.flags & 465829888 /* Instantiable */));
60602
+ hasNullableOrEmpty || (hasNullableOrEmpty = !!(t.flags & 98304 /* Nullable */) || isEmptyAnonymousObjectType(t));
60603
+ if (hasInstantiable && hasNullableOrEmpty)
60604
+ return true;
60605
+ }
60606
+ return false;
60607
+ }
60583
60608
  function getNormalizedTupleType(type, writing) {
60584
60609
  const elements = getElementTypes(type);
60585
60610
  const normalizedElements = sameMap(elements, (t) => t.flags & 25165824 /* Simplifiable */ ? getSimplifiedType(t, writing) : t);
@@ -65430,9 +65455,9 @@ function createTypeChecker(host) {
65430
65455
  if (strictNullChecks) {
65431
65456
  switch (facts) {
65432
65457
  case 524288 /* NEUndefined */:
65433
- return mapType(reduced, (t) => hasTypeFacts(t, 65536 /* EQUndefined */) ? getIntersectionType([t, hasTypeFacts(t, 131072 /* EQNull */) && !maybeTypeOfKind(reduced, 65536 /* Null */) ? getUnionType([emptyObjectType, nullType]) : emptyObjectType]) : t);
65458
+ return removeNullableByIntersection(reduced, 65536 /* EQUndefined */, 131072 /* EQNull */, 33554432 /* IsNull */, nullType);
65434
65459
  case 1048576 /* NENull */:
65435
- return mapType(reduced, (t) => hasTypeFacts(t, 131072 /* EQNull */) ? getIntersectionType([t, hasTypeFacts(t, 65536 /* EQUndefined */) && !maybeTypeOfKind(reduced, 32768 /* Undefined */) ? getUnionType([emptyObjectType, undefinedType]) : emptyObjectType]) : t);
65460
+ return removeNullableByIntersection(reduced, 131072 /* EQNull */, 65536 /* EQUndefined */, 16777216 /* IsUndefined */, undefinedType);
65436
65461
  case 2097152 /* NEUndefinedOrNull */:
65437
65462
  case 4194304 /* Truthy */:
65438
65463
  return mapType(reduced, (t) => hasTypeFacts(t, 262144 /* EQUndefinedOrNull */) ? getGlobalNonNullableTypeInstantiation(t) : t);
@@ -65440,6 +65465,14 @@ function createTypeChecker(host) {
65440
65465
  }
65441
65466
  return reduced;
65442
65467
  }
65468
+ function removeNullableByIntersection(type, targetFacts, otherFacts, otherIncludesFacts, otherType) {
65469
+ const facts = getTypeFacts(type, 65536 /* EQUndefined */ | 131072 /* EQNull */ | 16777216 /* IsUndefined */ | 33554432 /* IsNull */);
65470
+ if (!(facts & targetFacts)) {
65471
+ return type;
65472
+ }
65473
+ const emptyAndOtherUnion = getUnionType([emptyObjectType, otherType]);
65474
+ return mapType(type, (t) => hasTypeFacts(t, targetFacts) ? getIntersectionType([t, !(facts & otherIncludesFacts) && hasTypeFacts(t, otherFacts) ? emptyAndOtherUnion : emptyObjectType]) : t);
65475
+ }
65443
65476
  function recombineUnknownType(type) {
65444
65477
  return type === unknownUnionType ? unknownType : type;
65445
65478
  }
@@ -69007,7 +69040,7 @@ function createTypeChecker(host) {
69007
69040
  }
69008
69041
  }
69009
69042
  function checkSpreadExpression(node, checkMode) {
69010
- if (languageVersion < 2 /* ES2015 */) {
69043
+ if (languageVersion < 2 /* SpreadElements */) {
69011
69044
  checkExternalEmitHelpers(node, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 1024 /* SpreadArray */);
69012
69045
  }
69013
69046
  const arrayOrIterableType = checkExpression(node.expression, checkMode);
@@ -69041,7 +69074,7 @@ function createTypeChecker(host) {
69041
69074
  for (let i = 0; i < elementCount; i++) {
69042
69075
  const e = elements[i];
69043
69076
  if (e.kind === 230 /* SpreadElement */) {
69044
- if (languageVersion < 2 /* ES2015 */) {
69077
+ if (languageVersion < 2 /* SpreadElements */) {
69045
69078
  checkExternalEmitHelpers(e, compilerOptions.downlevelIteration ? 1536 /* SpreadIncludes */ : 1024 /* SpreadArray */);
69046
69079
  }
69047
69080
  const spreadType = checkExpression(e.expression, checkMode, forceTuple);
@@ -69271,7 +69304,7 @@ function createTypeChecker(host) {
69271
69304
  addIntraExpressionInferenceSite(inferenceContext, inferenceNode, type);
69272
69305
  }
69273
69306
  } else if (memberDecl.kind === 305 /* SpreadAssignment */) {
69274
- if (languageVersion < 2 /* ES2015 */) {
69307
+ if (languageVersion < 2 /* ObjectAssign */) {
69275
69308
  checkExternalEmitHelpers(memberDecl, 2 /* Assign */);
69276
69309
  }
69277
69310
  if (propertiesArray.length > 0) {
@@ -70296,7 +70329,7 @@ function createTypeChecker(host) {
70296
70329
  const isAnyLike = isTypeAny(apparentType) || apparentType === silentNeverType;
70297
70330
  let prop;
70298
70331
  if (isPrivateIdentifier(right)) {
70299
- if (languageVersion < 99 /* ESNext */) {
70332
+ if (languageVersion < 9 /* PrivateNamesAndClassStaticBlocks */ || languageVersion < 99 /* ClassAndClassElementDecorators */ || !useDefineForClassFields) {
70300
70333
  if (assignmentKind !== 0 /* None */) {
70301
70334
  checkExternalEmitHelpers(node, 1048576 /* ClassPrivateFieldSet */);
70302
70335
  }
@@ -72123,7 +72156,7 @@ function createTypeChecker(host) {
72123
72156
  }
72124
72157
  return resolveErrorCall(node);
72125
72158
  }
72126
- if (checkMode & 8 /* SkipGenericFunctions */ && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunctionOrConstructor)) {
72159
+ if (checkMode & 8 /* SkipGenericFunctions */ && !node.typeArguments && callSignatures.some(isGenericFunctionReturningFunction)) {
72127
72160
  skippedGenericFunction(node, checkMode);
72128
72161
  return resolvingSignature;
72129
72162
  }
@@ -72133,12 +72166,8 @@ function createTypeChecker(host) {
72133
72166
  }
72134
72167
  return resolveCall(node, callSignatures, candidatesOutArray, checkMode, callChainFlags);
72135
72168
  }
72136
- function isGenericFunctionReturningFunctionOrConstructor(signature) {
72137
- if (!signature.typeParameters) {
72138
- return false;
72139
- }
72140
- const returnType = getReturnTypeOfSignature(signature);
72141
- return isFunctionType(returnType) || isConstructorType(returnType);
72169
+ function isGenericFunctionReturningFunction(signature) {
72170
+ return !!(signature.typeParameters && isFunctionType(getReturnTypeOfSignature(signature)));
72142
72171
  }
72143
72172
  function isUntypedFunctionCall(funcType, apparentFuncType, numCallSignatures, numConstructSignatures) {
72144
72173
  return isTypeAny(funcType) || isTypeAny(apparentFuncType) && !!(funcType.flags & 262144 /* TypeParameter */) || !numCallSignatures && !numConstructSignatures && !(apparentFuncType.flags & 1048576 /* Union */) && !(getReducedType(apparentFuncType).flags & 131072 /* Never */) && isTypeAssignableTo(funcType, globalFunctionType);
@@ -72909,7 +72938,7 @@ function createTypeChecker(host) {
72909
72938
  function checkTaggedTemplateExpression(node) {
72910
72939
  if (!checkGrammarTaggedTemplateChain(node))
72911
72940
  checkGrammarTypeArguments(node, node.typeArguments);
72912
- if (languageVersion < 2 /* ES2015 */) {
72941
+ if (languageVersion < 2 /* TaggedTemplates */) {
72913
72942
  checkExternalEmitHelpers(node, 262144 /* MakeTemplateObject */);
72914
72943
  }
72915
72944
  const signature = getResolvedSignature(node);
@@ -74556,7 +74585,7 @@ function createTypeChecker(host) {
74556
74585
  return silentNeverType;
74557
74586
  }
74558
74587
  if (isPrivateIdentifier(left)) {
74559
- if (languageVersion < 99 /* ESNext */) {
74588
+ if (languageVersion < 9 /* PrivateNamesAndClassStaticBlocks */ || languageVersion < 99 /* ClassAndClassElementDecorators */ || !useDefineForClassFields) {
74560
74589
  checkExternalEmitHelpers(left, 2097152 /* ClassPrivateFieldIn */);
74561
74590
  }
74562
74591
  if (!getNodeLinks(left).resolvedSymbol && getContainingClass(left)) {
@@ -74617,7 +74646,7 @@ function createTypeChecker(host) {
74617
74646
  if (propertyIndex < properties.length - 1) {
74618
74647
  error(property, Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern);
74619
74648
  } else {
74620
- if (languageVersion < 99 /* ESNext */) {
74649
+ if (languageVersion < 5 /* ObjectSpreadRest */) {
74621
74650
  checkExternalEmitHelpers(property, 4 /* Rest */);
74622
74651
  }
74623
74652
  const nonRestNames = [];
@@ -74638,7 +74667,7 @@ function createTypeChecker(host) {
74638
74667
  }
74639
74668
  function checkArrayLiteralAssignment(node, sourceType, checkMode) {
74640
74669
  const elements = node.elements;
74641
- if (languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) {
74670
+ if (languageVersion < 2 /* DestructuringAssignment */ && compilerOptions.downlevelIteration) {
74642
74671
  checkExternalEmitHelpers(node, 512 /* Read */);
74643
74672
  }
74644
74673
  const possiblyOutOfBoundsType = checkIteratedTypeOrElementType(65 /* Destructuring */ | 128 /* PossiblyOutOfBounds */, sourceType, undefinedType, node) || errorType;
@@ -75340,10 +75369,10 @@ function createTypeChecker(host) {
75340
75369
  }
75341
75370
  const isAsync = (functionFlags & 2 /* Async */) !== 0;
75342
75371
  if (node.asteriskToken) {
75343
- if (isAsync && languageVersion < 99 /* ESNext */) {
75372
+ if (isAsync && languageVersion < 5 /* AsyncGenerators */) {
75344
75373
  checkExternalEmitHelpers(node, 26624 /* AsyncDelegatorIncludes */);
75345
75374
  }
75346
- if (!isAsync && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) {
75375
+ if (!isAsync && languageVersion < 2 /* Generators */ && compilerOptions.downlevelIteration) {
75347
75376
  checkExternalEmitHelpers(node, 256 /* Values */);
75348
75377
  }
75349
75378
  }
@@ -76115,13 +76144,13 @@ function createTypeChecker(host) {
76115
76144
  }
76116
76145
  const functionFlags = getFunctionFlags(node);
76117
76146
  if (!(functionFlags & 4 /* Invalid */)) {
76118
- if ((functionFlags & 3 /* AsyncGenerator */) === 3 /* AsyncGenerator */ && languageVersion < 99 /* ESNext */) {
76147
+ if ((functionFlags & 3 /* AsyncGenerator */) === 3 /* AsyncGenerator */ && languageVersion < 5 /* AsyncGenerators */) {
76119
76148
  checkExternalEmitHelpers(node, 6144 /* AsyncGeneratorIncludes */);
76120
76149
  }
76121
- if ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */ && languageVersion < 4 /* ES2017 */) {
76150
+ if ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */ && languageVersion < 4 /* AsyncFunctions */) {
76122
76151
  checkExternalEmitHelpers(node, 64 /* Awaiter */);
76123
76152
  }
76124
- if ((functionFlags & 3 /* AsyncGenerator */) !== 0 /* Normal */ && languageVersion < 2 /* ES2015 */) {
76153
+ if ((functionFlags & 3 /* AsyncGenerator */) !== 0 /* Normal */ && languageVersion < 2 /* Generators */) {
76125
76154
  checkExternalEmitHelpers(node, 128 /* Generator */);
76126
76155
  }
76127
76156
  }
@@ -76354,15 +76383,17 @@ function createTypeChecker(host) {
76354
76383
  setNodeLinksForPrivateIdentifierScope(node);
76355
76384
  }
76356
76385
  function setNodeLinksForPrivateIdentifierScope(node) {
76357
- if (isPrivateIdentifier(node.name) && languageVersion < 99 /* ESNext */) {
76358
- for (let lexicalScope = getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = getEnclosingBlockScopeContainer(lexicalScope)) {
76359
- getNodeLinks(lexicalScope).flags |= 1048576 /* ContainsClassWithPrivateIdentifiers */;
76360
- }
76361
- if (isClassExpression(node.parent)) {
76362
- const enclosingIterationStatement = getEnclosingIterationStatement(node.parent);
76363
- if (enclosingIterationStatement) {
76364
- getNodeLinks(node.name).flags |= 32768 /* BlockScopedBindingInLoop */;
76365
- getNodeLinks(enclosingIterationStatement).flags |= 4096 /* LoopWithCapturedBlockScopedBinding */;
76386
+ if (isPrivateIdentifier(node.name)) {
76387
+ if (languageVersion < 9 /* PrivateNamesAndClassStaticBlocks */ || languageVersion < 99 /* ClassAndClassElementDecorators */ || !useDefineForClassFields) {
76388
+ for (let lexicalScope = getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = getEnclosingBlockScopeContainer(lexicalScope)) {
76389
+ getNodeLinks(lexicalScope).flags |= 1048576 /* ContainsClassWithPrivateIdentifiers */;
76390
+ }
76391
+ if (isClassExpression(node.parent)) {
76392
+ const enclosingIterationStatement = getEnclosingIterationStatement(node.parent);
76393
+ if (enclosingIterationStatement) {
76394
+ getNodeLinks(node.name).flags |= 32768 /* BlockScopedBindingInLoop */;
76395
+ getNodeLinks(enclosingIterationStatement).flags |= 4096 /* LoopWithCapturedBlockScopedBinding */;
76396
+ }
76366
76397
  }
76367
76398
  }
76368
76399
  }
@@ -77487,7 +77518,7 @@ function createTypeChecker(host) {
77487
77518
  if (node.kind === 169 /* Parameter */) {
77488
77519
  checkExternalEmitHelpers(firstDecorator, 32 /* Param */);
77489
77520
  }
77490
- } else if (languageVersion < 99 /* ESNext */) {
77521
+ } else if (languageVersion < 99 /* ClassAndClassElementDecorators */) {
77491
77522
  checkExternalEmitHelpers(firstDecorator, 8 /* ESDecorateAndRunInitializers */);
77492
77523
  if (isClassDeclaration(node)) {
77493
77524
  if (!node.name) {
@@ -78192,7 +78223,7 @@ function createTypeChecker(host) {
78192
78223
  potentialUnusedRenamedBindingElementsInTypes.push(node);
78193
78224
  return;
78194
78225
  }
78195
- if (isObjectBindingPattern(node.parent) && node.dotDotDotToken && languageVersion < 5 /* ES2018 */) {
78226
+ if (isObjectBindingPattern(node.parent) && node.dotDotDotToken && languageVersion < 5 /* ObjectSpreadRest */) {
78196
78227
  checkExternalEmitHelpers(node, 4 /* Rest */);
78197
78228
  }
78198
78229
  if (node.propertyName && node.propertyName.kind === 167 /* ComputedPropertyName */) {
@@ -78228,7 +78259,7 @@ function createTypeChecker(host) {
78228
78259
  }
78229
78260
  }
78230
78261
  if (isBindingPattern(node.name)) {
78231
- if (node.name.kind === 207 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) {
78262
+ if (node.name.kind === 207 /* ArrayBindingPattern */ && languageVersion < 2 /* BindingPatterns */ && compilerOptions.downlevelIteration) {
78232
78263
  checkExternalEmitHelpers(node, 512 /* Read */);
78233
78264
  }
78234
78265
  forEach(node.name.elements, checkSourceElement);
@@ -78379,7 +78410,7 @@ function createTypeChecker(host) {
78379
78410
  }
78380
78411
  function checkVariableDeclarationList(node) {
78381
78412
  const blockScopeKind = getCombinedNodeFlags(node) & 7 /* BlockScoped */;
78382
- if (blockScopeKind === 4 /* Using */ || blockScopeKind === 6 /* AwaitUsing */) {
78413
+ if ((blockScopeKind === 4 /* Using */ || blockScopeKind === 6 /* AwaitUsing */) && languageVersion < 99 /* UsingAndAwaitUsing */) {
78383
78414
  checkExternalEmitHelpers(node, 16777216 /* AddDisposableResourceAndDisposeResources */);
78384
78415
  }
78385
78416
  forEach(node.declarations, checkSourceElement);
@@ -78552,11 +78583,11 @@ function createTypeChecker(host) {
78552
78583
  grammarErrorOnNode(node.awaitModifier, Diagnostics.for_await_loops_cannot_be_used_inside_a_class_static_block);
78553
78584
  } else {
78554
78585
  const functionFlags = getFunctionFlags(container);
78555
- if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion < 99 /* ESNext */) {
78586
+ if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion < 5 /* ForAwaitOf */) {
78556
78587
  checkExternalEmitHelpers(node, 16384 /* ForAwaitOfIncludes */);
78557
78588
  }
78558
78589
  }
78559
- } else if (compilerOptions.downlevelIteration && languageVersion < 2 /* ES2015 */) {
78590
+ } else if (compilerOptions.downlevelIteration && languageVersion < 2 /* ForOf */) {
78560
78591
  checkExternalEmitHelpers(node, 256 /* ForOfIncludes */);
78561
78592
  }
78562
78593
  if (node.initializer.kind === 261 /* VariableDeclarationList */) {
@@ -79480,6 +79511,7 @@ function createTypeChecker(host) {
79480
79511
  case "symbol":
79481
79512
  case "void":
79482
79513
  case "object":
79514
+ case "undefined":
79483
79515
  error(name, message, name.escapedText);
79484
79516
  }
79485
79517
  }
@@ -79619,12 +79651,12 @@ function createTypeChecker(host) {
79619
79651
  return true;
79620
79652
  }
79621
79653
  function getFirstTransformableStaticClassElement(node) {
79622
- const willTransformStaticElementsOfDecoratedClass = !legacyDecorators && languageVersion < 99 /* ESNext */ && classOrConstructorParameterIsDecorated(
79654
+ const willTransformStaticElementsOfDecoratedClass = !legacyDecorators && languageVersion < 99 /* ClassAndClassElementDecorators */ && classOrConstructorParameterIsDecorated(
79623
79655
  /*useLegacyDecorators*/
79624
79656
  false,
79625
79657
  node
79626
79658
  );
79627
- const willTransformPrivateElementsOrClassStaticBlocks = languageVersion <= 9 /* ES2022 */;
79659
+ const willTransformPrivateElementsOrClassStaticBlocks = languageVersion < 9 /* PrivateNamesAndClassStaticBlocks */ || languageVersion < 99 /* ClassAndClassElementDecorators */;
79628
79660
  const willTransformInitializers = !emitStandardClassFields;
79629
79661
  if (willTransformStaticElementsOfDecoratedClass || willTransformPrivateElementsOrClassStaticBlocks) {
79630
79662
  for (const member of node.members) {
@@ -79653,7 +79685,7 @@ function createTypeChecker(host) {
79653
79685
  const parent = walkUpOuterExpressions(node);
79654
79686
  if (!isNamedEvaluationSource(parent))
79655
79687
  return;
79656
- const willTransformESDecorators = !legacyDecorators && languageVersion < 99 /* ESNext */;
79688
+ const willTransformESDecorators = !legacyDecorators && languageVersion < 99 /* ClassAndClassElementDecorators */;
79657
79689
  let location;
79658
79690
  if (willTransformESDecorators && classOrConstructorParameterIsDecorated(
79659
79691
  /*useLegacyDecorators*/
@@ -79713,7 +79745,7 @@ function createTypeChecker(host) {
79713
79745
  const baseTypeNode = getEffectiveBaseTypeNode(node);
79714
79746
  if (baseTypeNode) {
79715
79747
  forEach(baseTypeNode.typeArguments, checkSourceElement);
79716
- if (languageVersion < 2 /* ES2015 */) {
79748
+ if (languageVersion < 2 /* Classes */) {
79717
79749
  checkExternalEmitHelpers(baseTypeNode.parent, 1 /* Extends */);
79718
79750
  }
79719
79751
  const extendsNode = getClassExtendsHeritageElement(node);
@@ -80009,9 +80041,9 @@ function createTypeChecker(host) {
80009
80041
  return filter(symbol.declarations, (d) => d.kind === 263 /* ClassDeclaration */ || d.kind === 264 /* InterfaceDeclaration */);
80010
80042
  }
80011
80043
  function checkKindsOfPropertyMemberOverrides(type, baseType) {
80012
- var _a, _b, _c, _d;
80044
+ var _a, _b, _c, _d, _e;
80013
80045
  const baseProperties = getPropertiesOfType(baseType);
80014
- let inheritedAbstractMemberNotImplementedError;
80046
+ const notImplementedInfo = /* @__PURE__ */ new Map();
80015
80047
  basePropertyCheck:
80016
80048
  for (const baseProperty of baseProperties) {
80017
80049
  const base = getTargetSymbol(baseProperty);
@@ -80037,36 +80069,11 @@ function createTypeChecker(host) {
80037
80069
  continue basePropertyCheck;
80038
80070
  }
80039
80071
  }
80040
- if (!inheritedAbstractMemberNotImplementedError) {
80041
- inheritedAbstractMemberNotImplementedError = error(
80042
- derivedClassDecl,
80043
- Diagnostics.Non_abstract_class_0_does_not_implement_all_abstract_members_of_1,
80044
- typeToString(type),
80045
- typeToString(baseType)
80046
- );
80047
- }
80048
- if (derivedClassDecl.kind === 231 /* ClassExpression */) {
80049
- addRelatedInfo(
80050
- inheritedAbstractMemberNotImplementedError,
80051
- createDiagnosticForNode(
80052
- baseProperty.valueDeclaration ?? (baseProperty.declarations && first(baseProperty.declarations)) ?? derivedClassDecl,
80053
- Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1,
80054
- symbolToString(baseProperty),
80055
- typeToString(baseType)
80056
- )
80057
- );
80058
- } else {
80059
- addRelatedInfo(
80060
- inheritedAbstractMemberNotImplementedError,
80061
- createDiagnosticForNode(
80062
- baseProperty.valueDeclaration ?? (baseProperty.declarations && first(baseProperty.declarations)) ?? derivedClassDecl,
80063
- Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2,
80064
- typeToString(type),
80065
- symbolToString(baseProperty),
80066
- typeToString(baseType)
80067
- )
80068
- );
80069
- }
80072
+ const baseTypeName = typeToString(baseType);
80073
+ const typeName = typeToString(type);
80074
+ const basePropertyName = symbolToString(baseProperty);
80075
+ const missedProperties = append((_a = notImplementedInfo.get(derivedClassDecl)) == null ? void 0 : _a.missedProperties, basePropertyName);
80076
+ notImplementedInfo.set(derivedClassDecl, { baseTypeName, typeName, missedProperties });
80070
80077
  }
80071
80078
  } else {
80072
80079
  const derivedDeclarationFlags = getDeclarationModifierFlagsFromSymbol(derived);
@@ -80077,7 +80084,7 @@ function createTypeChecker(host) {
80077
80084
  const basePropertyFlags = base.flags & 98308 /* PropertyOrAccessor */;
80078
80085
  const derivedPropertyFlags = derived.flags & 98308 /* PropertyOrAccessor */;
80079
80086
  if (basePropertyFlags && derivedPropertyFlags) {
80080
- if ((getCheckFlags(base) & 6 /* Synthetic */ ? (_a = base.declarations) == null ? void 0 : _a.some((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags)) : (_b = base.declarations) == null ? void 0 : _b.every((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags))) || getCheckFlags(base) & 262144 /* Mapped */ || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration)) {
80087
+ if ((getCheckFlags(base) & 6 /* Synthetic */ ? (_b = base.declarations) == null ? void 0 : _b.some((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags)) : (_c = base.declarations) == null ? void 0 : _c.every((d) => isPropertyAbstractOrInterface(d, baseDeclarationFlags))) || getCheckFlags(base) & 262144 /* Mapped */ || derived.valueDeclaration && isBinaryExpression(derived.valueDeclaration)) {
80081
80088
  continue;
80082
80089
  }
80083
80090
  const overriddenInstanceProperty = basePropertyFlags !== 4 /* Property */ && derivedPropertyFlags === 4 /* Property */;
@@ -80086,8 +80093,8 @@ function createTypeChecker(host) {
80086
80093
  const errorMessage2 = overriddenInstanceProperty ? Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property : Diagnostics._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor;
80087
80094
  error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage2, symbolToString(base), typeToString(baseType), typeToString(type));
80088
80095
  } else if (useDefineForClassFields) {
80089
- const uninitialized = (_c = derived.declarations) == null ? void 0 : _c.find((d) => d.kind === 172 /* PropertyDeclaration */ && !d.initializer);
80090
- if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 64 /* Abstract */) && !(derivedDeclarationFlags & 64 /* Abstract */) && !((_d = derived.declarations) == null ? void 0 : _d.some((d) => !!(d.flags & 33554432 /* Ambient */)))) {
80096
+ const uninitialized = (_d = derived.declarations) == null ? void 0 : _d.find((d) => d.kind === 172 /* PropertyDeclaration */ && !d.initializer);
80097
+ if (uninitialized && !(derived.flags & 33554432 /* Transient */) && !(baseDeclarationFlags & 64 /* Abstract */) && !(derivedDeclarationFlags & 64 /* Abstract */) && !((_e = derived.declarations) == null ? void 0 : _e.some((d) => !!(d.flags & 33554432 /* Ambient */)))) {
80091
80098
  const constructor = findConstructorDeclaration(getClassLikeDeclarationOfSymbol(type.symbol));
80092
80099
  const propName = uninitialized.name;
80093
80100
  if (uninitialized.exclamationToken || !constructor || !isIdentifier(propName) || !strictNullChecks || !isPropertyInitializedInConstructor(propName, type, constructor)) {
@@ -80112,6 +80119,30 @@ function createTypeChecker(host) {
80112
80119
  error(getNameOfDeclaration(derived.valueDeclaration) || derived.valueDeclaration, errorMessage, typeToString(baseType), symbolToString(base), typeToString(type));
80113
80120
  }
80114
80121
  }
80122
+ for (const [errorNode, memberInfo] of notImplementedInfo) {
80123
+ if (length(memberInfo.missedProperties) === 1) {
80124
+ if (isClassExpression(errorNode)) {
80125
+ error(errorNode, Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, first(memberInfo.missedProperties), memberInfo.baseTypeName);
80126
+ } else {
80127
+ error(errorNode, Diagnostics.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2, memberInfo.typeName, first(memberInfo.missedProperties), memberInfo.baseTypeName);
80128
+ }
80129
+ } else if (length(memberInfo.missedProperties) > 5) {
80130
+ const missedProperties = map(memberInfo.missedProperties.slice(0, 4), (prop) => `'${prop}'`).join(", ");
80131
+ const remainingMissedProperties = length(memberInfo.missedProperties) - 4;
80132
+ if (isClassExpression(errorNode)) {
80133
+ error(errorNode, Diagnostics.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and_2_more, memberInfo.baseTypeName, missedProperties, remainingMissedProperties);
80134
+ } else {
80135
+ error(errorNode, Diagnostics.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more, memberInfo.typeName, memberInfo.baseTypeName, missedProperties, remainingMissedProperties);
80136
+ }
80137
+ } else {
80138
+ const missedProperties = map(memberInfo.missedProperties, (prop) => `'${prop}'`).join(", ");
80139
+ if (isClassExpression(errorNode)) {
80140
+ error(errorNode, Diagnostics.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1, memberInfo.baseTypeName, missedProperties);
80141
+ } else {
80142
+ error(errorNode, Diagnostics.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2, memberInfo.typeName, memberInfo.baseTypeName, missedProperties);
80143
+ }
80144
+ }
80145
+ }
80115
80146
  }
80116
80147
  function isPropertyAbstractOrInterface(declaration, baseDeclarationFlags) {
80117
80148
  return baseDeclarationFlags & 64 /* Abstract */ && (!isPropertyDeclaration(declaration) || !declaration.initializer) || isInterfaceDeclaration(declaration.parent);
@@ -83182,7 +83213,7 @@ function createTypeChecker(host) {
83182
83213
  }
83183
83214
  }
83184
83215
  }
83185
- addToSymbolTable(globals, builtinGlobals, Diagnostics.Declaration_name_conflicts_with_built_in_global_identifier_0);
83216
+ addUndefinedToGlobalsOrErrorOnRedeclaration();
83186
83217
  getSymbolLinks(undefinedSymbol).type = undefinedWideningType;
83187
83218
  getSymbolLinks(argumentsSymbol).type = getGlobalType(
83188
83219
  "IArguments",
@@ -83836,7 +83867,7 @@ function createTypeChecker(host) {
83836
83867
  if (parameter.initializer) {
83837
83868
  return grammarErrorOnNode(parameter.name, Diagnostics.A_rest_parameter_cannot_have_an_initializer);
83838
83869
  }
83839
- } else if (isOptionalParameter(parameter)) {
83870
+ } else if (hasEffectiveQuestionToken(parameter)) {
83840
83871
  seenOptionalParameter = true;
83841
83872
  if (parameter.questionToken && parameter.initializer) {
83842
83873
  return grammarErrorOnNode(parameter.name, Diagnostics.Parameter_cannot_have_question_mark_and_initializer);
@@ -86770,12 +86801,12 @@ function getOriginalNodeId(node) {
86770
86801
  function containsDefaultReference(node) {
86771
86802
  if (!node)
86772
86803
  return false;
86773
- if (!isNamedImports(node))
86804
+ if (!isNamedImports(node) && !isNamedExports(node))
86774
86805
  return false;
86775
86806
  return some(node.elements, isNamedDefaultReference);
86776
86807
  }
86777
86808
  function isNamedDefaultReference(e) {
86778
- return e.propertyName !== void 0 && e.propertyName.escapedText === "default" /* Default */;
86809
+ return e.propertyName !== void 0 ? e.propertyName.escapedText === "default" /* Default */ : e.name.escapedText === "default" /* Default */;
86779
86810
  }
86780
86811
  function chainBundle(context, transformSourceFile) {
86781
86812
  return transformSourceFileOrBundle;
@@ -86849,6 +86880,7 @@ function collectExternalModuleInfo(context, sourceFile) {
86849
86880
  externalImports.push(node);
86850
86881
  if (isNamedExports(node.exportClause)) {
86851
86882
  addExportedNamesForExportDeclaration(node);
86883
+ hasImportDefault || (hasImportDefault = containsDefaultReference(node.exportClause));
86852
86884
  } else {
86853
86885
  const name = node.exportClause.name;
86854
86886
  if (!uniqueExports.get(idText(name))) {