@typescript-deploys/pr-build 4.8.0-pr-49481-2 → 4.8.0-pr-49554-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -89,7 +89,7 @@ var ts;
89
89
  // The following is baselined as a literal template type without intervention
90
90
  /** The version of the TypeScript compiler release */
91
91
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
92
- ts.version = ts.versionMajorMinor + ".0-insiders.20220610";
92
+ ts.version = ts.versionMajorMinor + ".0-insiders.20220615";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -2646,7 +2646,7 @@ var ts;
2646
2646
  return members.length > 0 && members[0][0] === 0 ? members[0][1] : "0";
2647
2647
  }
2648
2648
  if (isFlags) {
2649
- var result = "";
2649
+ var result = [];
2650
2650
  var remainingFlags = value;
2651
2651
  for (var _i = 0, members_1 = members; _i < members_1.length; _i++) {
2652
2652
  var _a = members_1[_i], enumValue = _a[0], enumName = _a[1];
@@ -2654,12 +2654,12 @@ var ts;
2654
2654
  break;
2655
2655
  }
2656
2656
  if (enumValue !== 0 && enumValue & value) {
2657
- result = "" + result + (result ? "|" : "") + enumName;
2657
+ result.push(enumName);
2658
2658
  remainingFlags &= ~enumValue;
2659
2659
  }
2660
2660
  }
2661
2661
  if (remainingFlags === 0) {
2662
- return result;
2662
+ return result.join("|");
2663
2663
  }
2664
2664
  }
2665
2665
  else {
@@ -2673,7 +2673,15 @@ var ts;
2673
2673
  return value.toString();
2674
2674
  }
2675
2675
  Debug.formatEnum = formatEnum;
2676
+ var enumMemberCache = new ts.Map();
2676
2677
  function getEnumMembers(enumObject) {
2678
+ // Assuming enum objects do not change at runtime, we can cache the enum members list
2679
+ // to reuse later. This saves us from reconstructing this each and every time we call
2680
+ // a formatting function (which can be expensive for large enums like SyntaxKind).
2681
+ var existing = enumMemberCache.get(enumObject);
2682
+ if (existing) {
2683
+ return existing;
2684
+ }
2677
2685
  var result = [];
2678
2686
  for (var name in enumObject) {
2679
2687
  var value = enumObject[name];
@@ -2681,7 +2689,9 @@ var ts;
2681
2689
  result.push([value, name]);
2682
2690
  }
2683
2691
  }
2684
- return ts.stableSort(result, function (x, y) { return ts.compareValues(x[0], y[0]); });
2692
+ var sorted = ts.stableSort(result, function (x, y) { return ts.compareValues(x[0], y[0]); });
2693
+ enumMemberCache.set(enumObject, sorted);
2694
+ return sorted;
2685
2695
  }
2686
2696
  function formatSyntaxKind(kind) {
2687
2697
  return formatEnum(kind, ts.SyntaxKind, /*isFlags*/ false);
@@ -4320,6 +4330,7 @@ var ts;
4320
4330
  SyntaxKind[SyntaxKind["JSDocFunctionType"] = 317] = "JSDocFunctionType";
4321
4331
  SyntaxKind[SyntaxKind["JSDocVariadicType"] = 318] = "JSDocVariadicType";
4322
4332
  SyntaxKind[SyntaxKind["JSDocNamepathType"] = 319] = "JSDocNamepathType";
4333
+ SyntaxKind[SyntaxKind["JSDoc"] = 320] = "JSDoc";
4323
4334
  /** @deprecated Use SyntaxKind.JSDoc */
4324
4335
  SyntaxKind[SyntaxKind["JSDocComment"] = 320] = "JSDocComment";
4325
4336
  SyntaxKind[SyntaxKind["JSDocText"] = 321] = "JSDocText";
@@ -4394,7 +4405,6 @@ var ts;
4394
4405
  SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 347] = "LastJSDocTagNode";
4395
4406
  /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 126] = "FirstContextualKeyword";
4396
4407
  /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 160] = "LastContextualKeyword";
4397
- SyntaxKind[SyntaxKind["JSDoc"] = 320] = "JSDoc";
4398
4408
  })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {}));
4399
4409
  var NodeFlags;
4400
4410
  (function (NodeFlags) {
@@ -8457,6 +8467,7 @@ var ts;
8457
8467
  The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2209, ts.DiagnosticCategory.Error, "The_project_root_is_ambiguous_but_is_required_to_resolve_export_map_entry_0_in_file_1_Supply_the_roo_2209", "The project root is ambiguous, but is required to resolve export map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),
8458
8468
  The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_rootDir_compiler_option_to_disambiguate: diag(2210, ts.DiagnosticCategory.Error, "The_project_root_is_ambiguous_but_is_required_to_resolve_import_map_entry_0_in_file_1_Supply_the_roo_2210", "The project root is ambiguous, but is required to resolve import map entry '{0}' in file '{1}'. Supply the `rootDir` compiler option to disambiguate."),
8459
8469
  Add_extends_constraint: diag(2211, ts.DiagnosticCategory.Message, "Add_extends_constraint_2211", "Add `extends` constraint."),
8470
+ Add_extends_constraint_to_all_type_parameters: diag(2212, ts.DiagnosticCategory.Message, "Add_extends_constraint_to_all_type_parameters_2212", "Add `extends` constraint to all type parameters"),
8460
8471
  Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."),
8461
8472
  Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
8462
8473
  Static_members_cannot_reference_class_type_parameters: diag(2302, ts.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."),
@@ -8942,6 +8953,8 @@ var ts;
8942
8953
  This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value: diag(2839, ts.DiagnosticCategory.Error, "This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839", "This condition will always return '{0}' since JavaScript compares objects by reference, not value."),
8943
8954
  An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes: diag(2840, ts.DiagnosticCategory.Error, "An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_clas_2840", "An interface cannot extend a primitive type like '{0}'; an interface can only extend named types and classes"),
8944
8955
  The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_feature_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(2841, ts.DiagnosticCategory.Error, "The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_2841", "The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
8956
+ _0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation: diag(2842, ts.DiagnosticCategory.Error, "_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842", "'{0}' is an unused renaming of '{1}'. Did you intend to use it as a type annotation?"),
8957
+ We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here: diag(2843, ts.DiagnosticCategory.Error, "We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843", "We can only write a type for '{0}' by adding a type for the entire parameter here."),
8945
8958
  Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
8946
8959
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
8947
8960
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -35756,10 +35769,11 @@ var ts;
35756
35769
  }
35757
35770
  nextToken();
35758
35771
  var typeArguments = parseDelimitedList(20 /* TypeArguments */, parseType);
35759
- if (!parseExpected(31 /* GreaterThanToken */)) {
35772
+ if (reScanGreaterToken() !== 31 /* GreaterThanToken */) {
35760
35773
  // If it doesn't have the closing `>` then it's definitely not an type argument list.
35761
35774
  return undefined;
35762
35775
  }
35776
+ nextToken();
35763
35777
  // We successfully parsed a type argument list. The next token determines whether we want to
35764
35778
  // treat it as such. If the type argument list is followed by `(` or a template literal, as in
35765
35779
  // `f<number>(42)`, we favor the type argument interpretation even though JavaScript would view
@@ -45185,7 +45199,7 @@ var ts;
45185
45199
  case 164 /* Parameter */:
45186
45200
  // Parameters with names are handled at the top of this function. Parameters
45187
45201
  // without names can only come from JSDocFunctionTypes.
45188
- ts.Debug.assert(node.parent.kind === 317 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; });
45202
+ ts.Debug.assert(node.parent.kind === 317 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + ts.Debug.formatSyntaxKind(node.parent.kind) + ", expected JSDocFunctionType"; });
45189
45203
  var functionType = node.parent;
45190
45204
  var index = functionType.parameters.indexOf(node);
45191
45205
  return "arg" + index;
@@ -49173,6 +49187,7 @@ var ts;
49173
49187
  var potentialNewTargetCollisions = [];
49174
49188
  var potentialWeakMapSetCollisions = [];
49175
49189
  var potentialReflectCollisions = [];
49190
+ var potentialUnusedRenamedBindingElementsInTypes = [];
49176
49191
  var awaitedTypeStack = [];
49177
49192
  var diagnostics = ts.createDiagnosticCollection();
49178
49193
  var suggestionDiagnostics = ts.createDiagnosticCollection();
@@ -52508,6 +52523,9 @@ var ts;
52508
52523
  if (symbol && symbol.flags & 262144 /* TypeParameter */ && meaning & 788968 /* Type */) {
52509
52524
  return { accessibility: 0 /* Accessible */ };
52510
52525
  }
52526
+ if (!symbol && ts.isThisIdentifier(firstIdentifier) && isSymbolAccessible(getSymbolOfNode(ts.getThisContainer(firstIdentifier, /*includeArrowFunctions*/ false)), firstIdentifier, meaning, /*computeAliases*/ false).accessibility === 0 /* Accessible */) {
52527
+ return { accessibility: 0 /* Accessible */ };
52528
+ }
52511
52529
  // Verify if the symbol is accessible
52512
52530
  return (symbol && hasVisibleDeclarations(symbol, /*shouldComputeAliasToMakeVisible*/ true)) || {
52513
52531
  accessibility: 1 /* NotAccessible */,
@@ -53680,15 +53698,22 @@ var ts;
53680
53698
  context.approximateLength += ts.symbolName(parameterSymbol).length + 3;
53681
53699
  return parameterNode;
53682
53700
  function cloneBindingName(node) {
53683
- return elideInitializerAndSetEmitFlags(node);
53684
- function elideInitializerAndSetEmitFlags(node) {
53701
+ return elideInitializerAndPropertyRenamingAndSetEmitFlags(node);
53702
+ function elideInitializerAndPropertyRenamingAndSetEmitFlags(node) {
53685
53703
  if (context.tracker.trackSymbol && ts.isComputedPropertyName(node) && isLateBindableName(node)) {
53686
53704
  trackComputedName(node.expression, context.enclosingDeclaration, context);
53687
53705
  }
53688
- var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags);
53706
+ var visited = ts.visitEachChild(node, elideInitializerAndPropertyRenamingAndSetEmitFlags, ts.nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndPropertyRenamingAndSetEmitFlags);
53689
53707
  if (ts.isBindingElement(visited)) {
53690
- visited = ts.factory.updateBindingElement(visited, visited.dotDotDotToken, visited.propertyName, visited.name,
53691
- /*initializer*/ undefined);
53708
+ if (visited.propertyName && ts.isIdentifier(visited.propertyName) && ts.isIdentifier(visited.name)) {
53709
+ visited = ts.factory.updateBindingElement(visited, visited.dotDotDotToken,
53710
+ /* propertyName*/ undefined, visited.propertyName,
53711
+ /*initializer*/ undefined);
53712
+ }
53713
+ else {
53714
+ visited = ts.factory.updateBindingElement(visited, visited.dotDotDotToken, visited.propertyName, visited.name,
53715
+ /*initializer*/ undefined);
53716
+ }
53692
53717
  }
53693
53718
  if (!ts.nodeIsSynthesized(visited)) {
53694
53719
  visited = ts.factory.cloneNode(visited);
@@ -64898,7 +64923,7 @@ var ts;
64898
64923
  return true;
64899
64924
  if (s & 65536 /* Null */ && (!strictNullChecks && !(t & 3145728 /* UnionOrIntersection */) || t & 65536 /* Null */))
64900
64925
  return true;
64901
- if (s & 524288 /* Object */ && t & 67108864 /* NonPrimitive */ && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source)))
64926
+ if (s & 524288 /* Object */ && t & 67108864 /* NonPrimitive */ && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source) && !(ts.getObjectFlags(source) & 8192 /* FreshLiteral */)))
64902
64927
  return true;
64903
64928
  if (relation === assignableRelation || relation === comparableRelation) {
64904
64929
  if (s & 1 /* Any */)
@@ -65462,8 +65487,12 @@ var ts;
65462
65487
  }
65463
65488
  reportRelationError(headMessage, source, target);
65464
65489
  if (source.flags & 262144 /* TypeParameter */ && ((_b = (_a = source.symbol) === null || _a === void 0 ? void 0 : _a.declarations) === null || _b === void 0 ? void 0 : _b[0]) && !getConstraintOfType(source)) {
65465
- var targetConstraintString = typeToString(target, source.symbol.declarations[0]);
65466
- associateRelatedInfo(ts.createDiagnosticForNode(source.symbol.declarations[0], ts.Diagnostics.This_type_parameter_might_need_an_extends_0_constraint, targetConstraintString));
65490
+ var syntheticParam = cloneTypeParameter(source);
65491
+ syntheticParam.constraint = instantiateType(target, makeUnaryTypeMapper(source, syntheticParam));
65492
+ if (hasNonCircularBaseConstraint(syntheticParam)) {
65493
+ var targetConstraintString = typeToString(target, source.symbol.declarations[0]);
65494
+ associateRelatedInfo(ts.createDiagnosticForNode(source.symbol.declarations[0], ts.Diagnostics.This_type_parameter_might_need_an_extends_0_constraint, targetConstraintString));
65495
+ }
65467
65496
  }
65468
65497
  }
65469
65498
  function traceUnionsOrIntersectionsTooLarge(source, target) {
@@ -65602,7 +65631,7 @@ var ts;
65602
65631
  return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source), target, reportErrors && !(source.flags & 131068 /* Primitive */) && !(target.flags & 131068 /* Primitive */));
65603
65632
  }
65604
65633
  if (target.flags & 2097152 /* Intersection */) {
65605
- return typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2 /* Target */);
65634
+ return typeRelatedToEachType(source, target, reportErrors, 2 /* Target */);
65606
65635
  }
65607
65636
  // Source is an intersection. For the comparable relation, if the target is a primitive type we hoist the
65608
65637
  // constraints of all non-primitive types in the source into a new intersection. We do this because the
@@ -68013,12 +68042,13 @@ var ts;
68013
68042
  * with no call or construct signatures.
68014
68043
  */
68015
68044
  function isObjectTypeWithInferableIndex(type) {
68045
+ var objectFlags = ts.getObjectFlags(type);
68016
68046
  return type.flags & 2097152 /* Intersection */
68017
68047
  ? ts.every(type.types, isObjectTypeWithInferableIndex)
68018
68048
  : !!(type.symbol
68019
68049
  && (type.symbol.flags & (4096 /* ObjectLiteral */ | 2048 /* TypeLiteral */ | 384 /* Enum */ | 512 /* ValueModule */)) !== 0
68020
68050
  && !(type.symbol.flags & 32 /* Class */)
68021
- && !typeHasCallOrConstructSignatures(type)) || !!(ts.getObjectFlags(type) & 1024 /* ReverseMapped */ && isObjectTypeWithInferableIndex(type.source));
68051
+ && !typeHasCallOrConstructSignatures(type)) || !!(objectFlags & 4194304 /* ObjectRestType */) || !!(objectFlags & 1024 /* ReverseMapped */ && isObjectTypeWithInferableIndex(type.source));
68022
68052
  }
68023
68053
  function createSymbolWithType(source, type) {
68024
68054
  var symbol = createSymbol(source.flags, source.escapedName, ts.getCheckFlags(source) & 8 /* Readonly */);
@@ -82617,6 +82647,22 @@ var ts;
82617
82647
  }
82618
82648
  });
82619
82649
  }
82650
+ function checkPotentialUncheckedRenamedBindingElementsInTypes() {
82651
+ var _a;
82652
+ for (var _i = 0, potentialUnusedRenamedBindingElementsInTypes_1 = potentialUnusedRenamedBindingElementsInTypes; _i < potentialUnusedRenamedBindingElementsInTypes_1.length; _i++) {
82653
+ var node = potentialUnusedRenamedBindingElementsInTypes_1[_i];
82654
+ if (!((_a = getSymbolOfNode(node)) === null || _a === void 0 ? void 0 : _a.isReferenced)) {
82655
+ var wrappingDeclaration = ts.walkUpBindingElementsAndPatterns(node);
82656
+ ts.Debug.assert(ts.isParameterDeclaration(wrappingDeclaration), "Only parameter declaration should be checked here");
82657
+ var diagnostic = ts.createDiagnosticForNode(node.name, ts.Diagnostics._0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation, ts.declarationNameToString(node.name), ts.declarationNameToString(node.propertyName));
82658
+ if (!wrappingDeclaration.type) {
82659
+ // entire parameter does not have type annotation, suggest adding an annotation
82660
+ ts.addRelatedInfo(diagnostic, ts.createFileDiagnostic(ts.getSourceFileOfNode(wrappingDeclaration), wrappingDeclaration.end, 1, ts.Diagnostics.We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here, ts.declarationNameToString(node.propertyName)));
82661
+ }
82662
+ diagnostics.add(diagnostic);
82663
+ }
82664
+ }
82665
+ }
82620
82666
  function bindingNameText(name) {
82621
82667
  switch (name.kind) {
82622
82668
  case 79 /* Identifier */:
@@ -82918,6 +82964,17 @@ var ts;
82918
82964
  }
82919
82965
  }
82920
82966
  if (ts.isBindingElement(node)) {
82967
+ if (node.propertyName &&
82968
+ ts.isIdentifier(node.name) &&
82969
+ ts.isParameterDeclaration(node) &&
82970
+ ts.nodeIsMissing(ts.getContainingFunction(node).body)) {
82971
+ // type F = ({a: string}) => void;
82972
+ // ^^^^^^
82973
+ // variable renaming in function type notation is confusing,
82974
+ // so we forbid it even if noUnusedLocals is not enabled
82975
+ potentialUnusedRenamedBindingElementsInTypes.push(node);
82976
+ return;
82977
+ }
82921
82978
  if (ts.isObjectBindingPattern(node.parent) && node.dotDotDotToken && languageVersion < 5 /* ES2018 */) {
82922
82979
  checkExternalEmitHelpers(node, 4 /* Rest */);
82923
82980
  }
@@ -86381,6 +86438,7 @@ var ts;
86381
86438
  ts.clear(potentialNewTargetCollisions);
86382
86439
  ts.clear(potentialWeakMapSetCollisions);
86383
86440
  ts.clear(potentialReflectCollisions);
86441
+ ts.clear(potentialUnusedRenamedBindingElementsInTypes);
86384
86442
  ts.forEach(node.statements, checkSourceElement);
86385
86443
  checkSourceElement(node.endOfFileToken);
86386
86444
  checkDeferredNodes(node);
@@ -86396,6 +86454,9 @@ var ts;
86396
86454
  }
86397
86455
  });
86398
86456
  }
86457
+ if (!node.isDeclarationFile) {
86458
+ checkPotentialUncheckedRenamedBindingElementsInTypes();
86459
+ }
86399
86460
  });
86400
86461
  if (compilerOptions.importsNotUsedAsValues === 2 /* Error */ &&
86401
86462
  !node.isDeclarationFile &&
@@ -108446,7 +108507,7 @@ var ts;
108446
108507
  return getTypeAliasDeclarationVisibilityError;
108447
108508
  }
108448
108509
  else {
108449
- return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.SyntaxKind[node.kind]);
108510
+ return ts.Debug.assertNever(node, "Attempted to set a declaration diagnostic context for unhandled node kind: " + ts.Debug.formatSyntaxKind(node.kind));
108450
108511
  }
108451
108512
  function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
108452
108513
  if (node.kind === 254 /* VariableDeclaration */ || node.kind === 203 /* BindingElement */) {
@@ -108657,7 +108718,7 @@ var ts;
108657
108718
  ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_name_1_from_private_module_2 :
108658
108719
  ts.Diagnostics.Parameter_0_of_accessor_has_or_is_using_private_name_1;
108659
108720
  default:
108660
- return ts.Debug.fail("Unknown parent for parameter: " + ts.SyntaxKind[node.parent.kind]);
108721
+ return ts.Debug.fail("Unknown parent for parameter: " + ts.Debug.formatSyntaxKind(node.parent.kind));
108661
108722
  }
108662
108723
  }
108663
108724
  function getTypeParameterConstraintVisibilityError() {
@@ -109137,7 +109198,7 @@ var ts;
109137
109198
  });
109138
109199
  return ret;
109139
109200
  }
109140
- function filterBindingPatternInitializers(name) {
109201
+ function filterBindingPatternInitializersAndRenamings(name) {
109141
109202
  if (name.kind === 79 /* Identifier */) {
109142
109203
  return name;
109143
109204
  }
@@ -109153,7 +109214,12 @@ var ts;
109153
109214
  if (elem.kind === 227 /* OmittedExpression */) {
109154
109215
  return elem;
109155
109216
  }
109156
- return factory.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializers(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined);
109217
+ if (elem.propertyName && ts.isIdentifier(elem.propertyName) && ts.isIdentifier(elem.name) && !elem.symbol.isReferenced) {
109218
+ // Unnecessary property renaming is forbidden in types, so remove renaming
109219
+ return factory.updateBindingElement(elem, elem.dotDotDotToken,
109220
+ /* propertyName */ undefined, elem.propertyName, shouldPrintWithInitializer(elem) ? elem.initializer : undefined);
109221
+ }
109222
+ return factory.updateBindingElement(elem, elem.dotDotDotToken, elem.propertyName, filterBindingPatternInitializersAndRenamings(elem.name), shouldPrintWithInitializer(elem) ? elem.initializer : undefined);
109157
109223
  }
109158
109224
  }
109159
109225
  function ensureParameter(p, modifierMask, type) {
@@ -109162,7 +109228,7 @@ var ts;
109162
109228
  oldDiag = getSymbolAccessibilityDiagnostic;
109163
109229
  getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(p);
109164
109230
  }
109165
- var newParam = factory.updateParameterDeclaration(p, maskModifiers(p, modifierMask), p.dotDotDotToken, filterBindingPatternInitializers(p.name), resolver.isOptionalParameter(p) ? (p.questionToken || factory.createToken(57 /* QuestionToken */)) : undefined, ensureType(p, type || p.type, /*ignorePrivate*/ true), // Ignore private param props, since this type is going straight back into a param
109231
+ var newParam = factory.updateParameterDeclaration(p, maskModifiers(p, modifierMask), p.dotDotDotToken, filterBindingPatternInitializersAndRenamings(p.name), resolver.isOptionalParameter(p) ? (p.questionToken || factory.createToken(57 /* QuestionToken */)) : undefined, ensureType(p, type || p.type, /*ignorePrivate*/ true), // Ignore private param props, since this type is going straight back into a param
109166
109232
  ensureNoInitializer(p));
109167
109233
  if (!suppressNewDiagnosticContexts) {
109168
109234
  getSymbolAccessibilityDiagnostic = oldDiag;
@@ -109423,7 +109489,7 @@ var ts;
109423
109489
  while (ts.length(lateMarkedStatements)) {
109424
109490
  var i = lateMarkedStatements.shift();
109425
109491
  if (!ts.isLateVisibilityPaintedStatement(i)) {
109426
- return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: " + (ts.SyntaxKind ? ts.SyntaxKind[i.kind] : i.kind));
109492
+ return ts.Debug.fail("Late replaced statement was found which is not handled by the declaration transformer!: " + ts.Debug.formatSyntaxKind(i.kind));
109427
109493
  }
109428
109494
  var priorNeedsDeclare = needsDeclare;
109429
109495
  needsDeclare = i.parent && ts.isSourceFile(i.parent) && !(ts.isExternalModule(i.parent) && isBundledEmit);
@@ -109606,7 +109672,7 @@ var ts;
109606
109672
  return cleanup(input);
109607
109673
  return cleanup(factory.updateImportTypeNode(input, factory.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)), input.assertions, input.qualifier, ts.visitNodes(input.typeArguments, visitDeclarationSubtree, ts.isTypeNode), input.isTypeOf));
109608
109674
  }
109609
- default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: " + ts.SyntaxKind[input.kind]);
109675
+ default: ts.Debug.assertNever(input, "Attempted to process unhandled node kind: " + ts.Debug.formatSyntaxKind(input.kind));
109610
109676
  }
109611
109677
  }
109612
109678
  if (ts.isTupleTypeNode(input) && (ts.getLineAndCharacterOfPosition(currentSourceFile, input.pos).line === ts.getLineAndCharacterOfPosition(currentSourceFile, input.end).line)) {
@@ -109928,7 +109994,7 @@ var ts;
109928
109994
  }
109929
109995
  }
109930
109996
  // Anything left unhandled is an error, so this should be unreachable
109931
- return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: " + ts.SyntaxKind[input.kind]);
109997
+ return ts.Debug.assertNever(input, "Unhandled top-level node in declaration emit: " + ts.Debug.formatSyntaxKind(input.kind));
109932
109998
  function cleanup(node) {
109933
109999
  if (isEnclosingDeclaration(input)) {
109934
110000
  enclosingDeclaration = previousEnclosingDeclaration;
@@ -117305,6 +117371,7 @@ var ts;
117305
117371
  ts.Diagnostics.let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations.code,
117306
117372
  ts.Diagnostics.Class_constructor_may_not_be_a_generator.code,
117307
117373
  ts.Diagnostics.Class_constructor_may_not_be_an_accessor.code,
117374
+ ts.Diagnostics.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,
117308
117375
  ]);
117309
117376
  /**
117310
117377
  * Determine if source file needs to be re-created even if its text hasn't changed
@@ -122439,9 +122506,11 @@ var ts;
122439
122506
  }
122440
122507
  function watchAffectingLocationsOfResolution(resolution, addToResolutionsWithOnlyAffectingLocations) {
122441
122508
  ts.Debug.assert(!!resolution.refCount);
122509
+ var affectingLocations = resolution.affectingLocations;
122510
+ if (!affectingLocations.length)
122511
+ return;
122442
122512
  if (addToResolutionsWithOnlyAffectingLocations)
122443
122513
  resolutionsWithOnlyAffectingLocations.push(resolution);
122444
- var affectingLocations = resolution.affectingLocations;
122445
122514
  // Watch package json
122446
122515
  for (var _i = 0, affectingLocations_1 = affectingLocations; _i < affectingLocations_1.length; _i++) {
122447
122516
  var affectingLocation = affectingLocations_1[_i];
@@ -1088,13 +1088,15 @@
1088
1088
  "Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363": "无法生成项目“{0}”,因为其依赖项“{1}”有错误",
1089
1089
  "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383": "无法生成项目 \"{0}\" ,因为未生成其依赖项 \"{1}\"",
1090
1090
  "Project_0_is_being_forcibly_rebuilt_6388": "正在强制重新生成项目“{0}”",
1091
+ "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitte_6399": "项目“{0}”已过期,因为 buildinfo 文件“{1}”指示某些更改未发出",
1091
1092
  "Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353": "项目“{0}”已过期,因为其依赖项“{1}”已过期",
1092
- "Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2_6350": "项目“{0}”已过期,因为最早的输出“{1}”早于最新的输入“{2}”",
1093
+ "Project_0_is_out_of_date_because_output_1_is_older_than_input_2_6350": "项目“{0}”已过期,因为输出“{1}”早于输入“{2}”",
1093
1094
  "Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352": "项目“{0}”已过期,因为输出文件“{1}”不存在",
1094
1095
  "Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381": "项目 \"{0}\" 已过期,因为其输出是使用与当前版本 \"{2}\" 不同的版本 \"{1}\" 生成的",
1095
1096
  "Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed_6372": "项目 \"{0}\" 已过期,因为其依赖项 \"{1}\" 的输出已更改",
1096
1097
  "Project_0_is_up_to_date_6361": "“{0}”项目已是最新",
1097
- "Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2_6351": "项目“{0}”已是最新,因为最新的输入“{1}”早于最早的输出“{2}”",
1098
+ "Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2_6351": "项目“{0}”是最新的,因为最新的输入“{1}”早于输出“{2}”",
1099
+ "Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_fil_6400": "项目“{0}”是最新的,但需要更新早于输入文件的输出文件的时间戳",
1098
1100
  "Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354": "项目“{0}”已是最新,拥有来自其依赖项的 .d.ts 文件",
1099
1101
  "Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202": "项目引用不能形成环形图。检测到循环: {0}",
1100
1102
  "Projects_6255": "项目",
@@ -1088,13 +1088,15 @@
1088
1088
  "Project_0_can_t_be_built_because_its_dependency_1_has_errors_6363": "因為專案 '{0}' 的相依性 '{1}' 發生錯誤,所以無法建置該專案",
1089
1089
  "Project_0_can_t_be_built_because_its_dependency_1_was_not_built_6383": "因為未建置專案 '{0}' 的相依性 '{1}',所以無法建置該專案",
1090
1090
  "Project_0_is_being_forcibly_rebuilt_6388": "正在強制重建專案 '{0}'",
1091
+ "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitte_6399": "因為 buildinfo 檔案 '{1}' 指出某些變更並未發出,所以專案 '{0}' 已過期",
1091
1092
  "Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date_6353": "因為專案 '{0}' 的相依性 '{1}' 已過期,所以該專案已過期",
1092
- "Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2_6350": "因為最舊的輸出 '{1}' 早於最新的輸入 '{2}',所以專案 '{0}' 已過期",
1093
+ "Project_0_is_out_of_date_because_output_1_is_older_than_input_2_6350": "因為輸出 '{1}' 早於輸入 '{2}',所以專案 '{0}' 已過期",
1093
1094
  "Project_0_is_out_of_date_because_output_file_1_does_not_exist_6352": "因為輸出檔案 '{1}' 不存在,所以專案 '{0}' 已過期",
1094
1095
  "Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_curren_6381": "因為專案 '{0}' 的輸出使用版本 '{1}' 產生而成,與目前的版本 '{2}' 不同,所以該專案已過期",
1095
1096
  "Project_0_is_out_of_date_because_output_of_its_dependency_1_has_changed_6372": "因為專案 '{0}' 的相依性 '{1}' 輸出已變更,所以該專案已過期",
1096
1097
  "Project_0_is_up_to_date_6361": "專案 '{0}' 為最新狀態",
1097
- "Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2_6351": "因為最新的輸入 '{1}' 早於最舊的輸出 '{2}',所以專案 '{0}' 為最新狀態",
1098
+ "Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2_6351": "因為最新的輸入 '{1}' 早於最舊的輸出 '{2}',所以專案 '{0}' 為最新狀態",
1099
+ "Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_fil_6400": "專案 '{0}' 為最新狀態,但需要更新比輸入檔案還舊的輸出檔案時間戳記",
1098
1100
  "Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies_6354": "專案 '{0}' 為最新狀態,且有來自其相依性的 .d.ts 檔案",
1099
1101
  "Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202": "專案參考不會形成循環圖。但偵測到循環: {0}",
1100
1102
  "Projects_6255": "專案",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typescript-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "4.8.0-pr-49481-2",
5
+ "version": "4.8.0-pr-49554-2",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -33,6 +33,7 @@
33
33
  "@octokit/rest": "latest",
34
34
  "@types/chai": "latest",
35
35
  "@types/convert-source-map": "latest",
36
+ "@types/fs-extra": "^9.0.13",
36
37
  "@types/glob": "latest",
37
38
  "@types/gulp": "^4.0.9",
38
39
  "@types/gulp-concat": "latest",