@typescript-deploys/pr-build 5.5.0-pr-58440-3 → 5.5.0-pr-58326-8

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.
Files changed (3) hide show
  1. package/lib/tsc.js +106 -118
  2. package/lib/typescript.js +106 -118
  3. package/package.json +1 -1
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-insiders.20240505`;
21
+ var version = `${versionMajorMinor}.0-insiders.20240506`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -46669,7 +46669,12 @@ function createTypeChecker(host) {
46669
46669
  if (resolvedTarget === unknownSymbol) {
46670
46670
  return source;
46671
46671
  }
46672
- target = cloneSymbol(resolvedTarget);
46672
+ if (!(resolvedTarget.flags & getExcludedSymbolFlags(source.flags)) || (source.flags | resolvedTarget.flags) & 67108864 /* Assignment */) {
46673
+ target = cloneSymbol(resolvedTarget);
46674
+ } else {
46675
+ reportMergeSymbolError(target, source);
46676
+ return source;
46677
+ }
46673
46678
  }
46674
46679
  if (source.flags & 512 /* ValueModule */ && target.flags & 512 /* ValueModule */ && target.constEnumOnlyModule && !source.constEnumOnlyModule) {
46675
46680
  target.constEnumOnlyModule = false;
@@ -46701,31 +46706,34 @@ function createTypeChecker(host) {
46701
46706
  );
46702
46707
  }
46703
46708
  } else {
46704
- const isEitherEnum = !!(target.flags & 384 /* Enum */ || source.flags & 384 /* Enum */);
46705
- const isEitherBlockScoped = !!(target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */);
46709
+ reportMergeSymbolError(target, source);
46710
+ }
46711
+ return target;
46712
+ function reportMergeSymbolError(target2, source2) {
46713
+ const isEitherEnum = !!(target2.flags & 384 /* Enum */ || source2.flags & 384 /* Enum */);
46714
+ const isEitherBlockScoped = !!(target2.flags & 2 /* BlockScopedVariable */ || source2.flags & 2 /* BlockScopedVariable */);
46706
46715
  const message = isEitherEnum ? Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations : isEitherBlockScoped ? Diagnostics.Cannot_redeclare_block_scoped_variable_0 : Diagnostics.Duplicate_identifier_0;
46707
- const sourceSymbolFile = source.declarations && getSourceFileOfNode(source.declarations[0]);
46708
- const targetSymbolFile = target.declarations && getSourceFileOfNode(target.declarations[0]);
46716
+ const sourceSymbolFile = source2.declarations && getSourceFileOfNode(source2.declarations[0]);
46717
+ const targetSymbolFile = target2.declarations && getSourceFileOfNode(target2.declarations[0]);
46709
46718
  const isSourcePlainJs = isPlainJsFile(sourceSymbolFile, compilerOptions.checkJs);
46710
46719
  const isTargetPlainJs = isPlainJsFile(targetSymbolFile, compilerOptions.checkJs);
46711
- const symbolName2 = symbolToString(source);
46720
+ const symbolName2 = symbolToString(source2);
46712
46721
  if (sourceSymbolFile && targetSymbolFile && amalgamatedDuplicates && !isEitherEnum && sourceSymbolFile !== targetSymbolFile) {
46713
46722
  const firstFile = comparePaths(sourceSymbolFile.path, targetSymbolFile.path) === -1 /* LessThan */ ? sourceSymbolFile : targetSymbolFile;
46714
46723
  const secondFile = firstFile === sourceSymbolFile ? targetSymbolFile : sourceSymbolFile;
46715
46724
  const filesDuplicates = getOrUpdate(amalgamatedDuplicates, `${firstFile.path}|${secondFile.path}`, () => ({ firstFile, secondFile, conflictingSymbols: /* @__PURE__ */ new Map() }));
46716
46725
  const conflictingSymbolInfo = getOrUpdate(filesDuplicates.conflictingSymbols, symbolName2, () => ({ isBlockScoped: isEitherBlockScoped, firstFileLocations: [], secondFileLocations: [] }));
46717
46726
  if (!isSourcePlainJs)
46718
- addDuplicateLocations(conflictingSymbolInfo.firstFileLocations, source);
46727
+ addDuplicateLocations(conflictingSymbolInfo.firstFileLocations, source2);
46719
46728
  if (!isTargetPlainJs)
46720
- addDuplicateLocations(conflictingSymbolInfo.secondFileLocations, target);
46729
+ addDuplicateLocations(conflictingSymbolInfo.secondFileLocations, target2);
46721
46730
  } else {
46722
46731
  if (!isSourcePlainJs)
46723
- addDuplicateDeclarationErrorsForSymbols(source, message, symbolName2, target);
46732
+ addDuplicateDeclarationErrorsForSymbols(source2, message, symbolName2, target2);
46724
46733
  if (!isTargetPlainJs)
46725
- addDuplicateDeclarationErrorsForSymbols(target, message, symbolName2, source);
46734
+ addDuplicateDeclarationErrorsForSymbols(target2, message, symbolName2, source2);
46726
46735
  }
46727
46736
  }
46728
- return target;
46729
46737
  function addDuplicateLocations(locs, symbol) {
46730
46738
  if (symbol.declarations) {
46731
46739
  for (const decl of symbol.declarations) {
@@ -56192,13 +56200,8 @@ function createTypeChecker(host) {
56192
56200
  if (left.typeParameters && right.typeParameters) {
56193
56201
  paramMapper = createTypeMapper(right.typeParameters, left.typeParameters);
56194
56202
  }
56195
- let flags = (left.flags | right.flags) & (167 /* PropagatingFlags */ & ~1 /* HasRestParameter */);
56196
56203
  const declaration = left.declaration;
56197
56204
  const params = combineUnionParameters(left, right, paramMapper);
56198
- const lastParam = lastOrUndefined(params);
56199
- if (lastParam && getCheckFlags(lastParam) & 32768 /* RestParameter */) {
56200
- flags |= 1 /* HasRestParameter */;
56201
- }
56202
56205
  const thisParam = combineUnionThisParam(left.thisParameter, right.thisParameter, paramMapper);
56203
56206
  const minArgCount = Math.max(left.minArgumentCount, right.minArgumentCount);
56204
56207
  const result = createSignature(
@@ -56211,7 +56214,7 @@ function createTypeChecker(host) {
56211
56214
  /*resolvedTypePredicate*/
56212
56215
  void 0,
56213
56216
  minArgCount,
56214
- flags
56217
+ (left.flags | right.flags) & 167 /* PropagatingFlags */
56215
56218
  );
56216
56219
  result.compositeKind = 1048576 /* Union */;
56217
56220
  result.compositeSignatures = concatenate(left.compositeKind !== 2097152 /* Intersection */ && left.compositeSignatures || [left], [right]);
@@ -71203,13 +71206,8 @@ function createTypeChecker(host) {
71203
71206
  if (left.typeParameters && right.typeParameters) {
71204
71207
  paramMapper = createTypeMapper(right.typeParameters, left.typeParameters);
71205
71208
  }
71206
- let flags = (left.flags | right.flags) & (167 /* PropagatingFlags */ & ~1 /* HasRestParameter */);
71207
71209
  const declaration = left.declaration;
71208
71210
  const params = combineIntersectionParameters(left, right, paramMapper);
71209
- const lastParam = lastOrUndefined(params);
71210
- if (lastParam && getCheckFlags(lastParam) & 32768 /* RestParameter */) {
71211
- flags |= 1 /* HasRestParameter */;
71212
- }
71213
71211
  const thisParam = combineIntersectionThisParam(left.thisParameter, right.thisParameter, paramMapper);
71214
71212
  const minArgCount = Math.max(left.minArgumentCount, right.minArgumentCount);
71215
71213
  const result = createSignature(
@@ -71222,7 +71220,7 @@ function createTypeChecker(host) {
71222
71220
  /*resolvedTypePredicate*/
71223
71221
  void 0,
71224
71222
  minArgCount,
71225
- flags
71223
+ (left.flags | right.flags) & 167 /* PropagatingFlags */
71226
71224
  );
71227
71225
  result.compositeKind = 2097152 /* Intersection */;
71228
71226
  result.compositeSignatures = concatenate(left.compositeKind === 2097152 /* Intersection */ && left.compositeSignatures || [left], [right]);
@@ -114221,13 +114219,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114221
114219
  }
114222
114220
  }
114223
114221
  function emitComputedPropertyName(node) {
114224
- const savedPrivateNameTempFlags = privateNameTempFlags;
114225
- const savedReservedMemberNames = reservedPrivateNames;
114226
- popPrivateNameGenerationScope();
114227
114222
  writePunctuation("[");
114228
114223
  emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfComputedPropertyName);
114229
114224
  writePunctuation("]");
114230
- pushPrivateNameGenerationScope(savedPrivateNameTempFlags, savedReservedMemberNames);
114231
114225
  }
114232
114226
  function emitTypeParameter(node) {
114233
114227
  emitModifierList(node, node.modifiers);
@@ -114288,15 +114282,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114288
114282
  writeTrailingSemicolon();
114289
114283
  }
114290
114284
  function emitMethodSignature(node) {
114291
- pushNameGenerationScope(node);
114292
114285
  emitModifierList(node, node.modifiers);
114293
114286
  emit(node.name);
114294
114287
  emit(node.questionToken);
114295
- emitTypeParameters(node, node.typeParameters);
114296
- emitParameters(node, node.parameters);
114297
- emitTypeAnnotation(node.type);
114298
- writeTrailingSemicolon();
114299
- popNameGenerationScope(node);
114288
+ emitSignatureAndBody(node, emitSignatureHead, emitEmptyFunctionBody);
114300
114289
  }
114301
114290
  function emitMethodDeclaration(node) {
114302
114291
  emitDecoratorsAndModifiers(
@@ -114308,11 +114297,13 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114308
114297
  emit(node.asteriskToken);
114309
114298
  emit(node.name);
114310
114299
  emit(node.questionToken);
114311
- emitSignatureAndBody(node, emitSignatureHead);
114300
+ emitSignatureAndBody(node, emitSignatureHead, emitFunctionBody);
114312
114301
  }
114313
114302
  function emitClassStaticBlockDeclaration(node) {
114314
114303
  writeKeyword("static");
114304
+ pushNameGenerationScope(node);
114315
114305
  emitBlockFunctionBody(node.body);
114306
+ popNameGenerationScope(node);
114316
114307
  }
114317
114308
  function emitConstructor(node) {
114318
114309
  emitDecoratorsAndModifiers(
@@ -114322,7 +114313,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114322
114313
  false
114323
114314
  );
114324
114315
  writeKeyword("constructor");
114325
- emitSignatureAndBody(node, emitSignatureHead);
114316
+ emitSignatureAndBody(node, emitSignatureHead, emitFunctionBody);
114326
114317
  }
114327
114318
  function emitAccessorDeclaration(node) {
114328
114319
  const pos = emitDecoratorsAndModifiers(
@@ -114335,25 +114326,15 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114335
114326
  emitTokenWithComment(token, pos, writeKeyword, node);
114336
114327
  writeSpace();
114337
114328
  emit(node.name);
114338
- emitSignatureAndBody(node, emitSignatureHead);
114329
+ emitSignatureAndBody(node, emitSignatureHead, emitFunctionBody);
114339
114330
  }
114340
114331
  function emitCallSignature(node) {
114341
- pushNameGenerationScope(node);
114342
- emitTypeParameters(node, node.typeParameters);
114343
- emitParameters(node, node.parameters);
114344
- emitTypeAnnotation(node.type);
114345
- writeTrailingSemicolon();
114346
- popNameGenerationScope(node);
114332
+ emitSignatureAndBody(node, emitSignatureHead, emitEmptyFunctionBody);
114347
114333
  }
114348
114334
  function emitConstructSignature(node) {
114349
- pushNameGenerationScope(node);
114350
114335
  writeKeyword("new");
114351
114336
  writeSpace();
114352
- emitTypeParameters(node, node.typeParameters);
114353
- emitParameters(node, node.parameters);
114354
- emitTypeAnnotation(node.type);
114355
- writeTrailingSemicolon();
114356
- popNameGenerationScope(node);
114337
+ emitSignatureAndBody(node, emitSignatureHead, emitEmptyFunctionBody);
114357
114338
  }
114358
114339
  function emitIndexSignature(node) {
114359
114340
  emitDecoratorsAndModifiers(
@@ -114391,14 +114372,17 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114391
114372
  emitTypeArguments(node, node.typeArguments);
114392
114373
  }
114393
114374
  function emitFunctionType(node) {
114394
- pushNameGenerationScope(node);
114375
+ emitSignatureAndBody(node, emitFunctionTypeHead, emitFunctionTypeBody);
114376
+ }
114377
+ function emitFunctionTypeHead(node) {
114395
114378
  emitTypeParameters(node, node.typeParameters);
114396
114379
  emitParametersForArrow(node, node.parameters);
114397
114380
  writeSpace();
114398
114381
  writePunctuation("=>");
114382
+ }
114383
+ function emitFunctionTypeBody(node) {
114399
114384
  writeSpace();
114400
114385
  emit(node.type);
114401
- popNameGenerationScope(node);
114402
114386
  }
114403
114387
  function emitJSDocFunctionType(node) {
114404
114388
  writeKeyword("function");
@@ -114419,17 +114403,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114419
114403
  writePunctuation("=");
114420
114404
  }
114421
114405
  function emitConstructorType(node) {
114422
- pushNameGenerationScope(node);
114423
114406
  emitModifierList(node, node.modifiers);
114424
114407
  writeKeyword("new");
114425
114408
  writeSpace();
114426
- emitTypeParameters(node, node.typeParameters);
114427
- emitParameters(node, node.parameters);
114428
- writeSpace();
114429
- writePunctuation("=>");
114430
- writeSpace();
114431
- emit(node.type);
114432
- popNameGenerationScope(node);
114409
+ emitSignatureAndBody(node, emitFunctionTypeHead, emitFunctionTypeBody);
114433
114410
  }
114434
114411
  function emitTypeQuery(node) {
114435
114412
  writeKeyword("typeof");
@@ -114438,16 +114415,13 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114438
114415
  emitTypeArguments(node, node.typeArguments);
114439
114416
  }
114440
114417
  function emitTypeLiteral(node) {
114441
- pushPrivateNameGenerationScope(
114442
- 0 /* Auto */,
114443
- /*newReservedMemberNames*/
114444
- void 0
114445
- );
114418
+ pushNameGenerationScope(node);
114419
+ forEach(node.members, generateMemberNames);
114446
114420
  writePunctuation("{");
114447
114421
  const flags = getEmitFlags(node) & 1 /* SingleLine */ ? 768 /* SingleLineTypeLiteralMembers */ : 32897 /* MultiLineTypeLiteralMembers */;
114448
114422
  emitList(node, node.members, flags | 524288 /* NoSpaceIfEmpty */);
114449
114423
  writePunctuation("}");
114450
- popPrivateNameGenerationScope();
114424
+ popNameGenerationScope(node);
114451
114425
  }
114452
114426
  function emitArrayType(node) {
114453
114427
  emit(node.elementType, parenthesizer.parenthesizeNonArrayTypeOfPostfixType);
@@ -114619,11 +114593,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114619
114593
  emitExpressionList(node, elements, 8914 /* ArrayLiteralExpressionElements */ | preferNewLine, parenthesizer.parenthesizeExpressionForDisallowedComma);
114620
114594
  }
114621
114595
  function emitObjectLiteralExpression(node) {
114622
- pushPrivateNameGenerationScope(
114623
- 0 /* Auto */,
114624
- /*newReservedMemberNames*/
114625
- void 0
114626
- );
114596
+ pushNameGenerationScope(node);
114627
114597
  forEach(node.properties, generateMemberNames);
114628
114598
  const indentedFlag = getEmitFlags(node) & 131072 /* Indented */;
114629
114599
  if (indentedFlag) {
@@ -114635,7 +114605,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114635
114605
  if (indentedFlag) {
114636
114606
  decreaseIndent();
114637
114607
  }
114638
- popPrivateNameGenerationScope();
114608
+ popNameGenerationScope(node);
114639
114609
  }
114640
114610
  function emitPropertyAccessExpression(node) {
114641
114611
  emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess);
@@ -114750,7 +114720,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114750
114720
  }
114751
114721
  function emitArrowFunction(node) {
114752
114722
  emitModifierList(node, node.modifiers);
114753
- emitSignatureAndBody(node, emitArrowFunctionHead);
114723
+ emitSignatureAndBody(node, emitArrowFunctionHead, emitArrowFunctionBody);
114754
114724
  }
114755
114725
  function emitArrowFunctionHead(node) {
114756
114726
  emitTypeParameters(node, node.typeParameters);
@@ -114759,6 +114729,14 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114759
114729
  writeSpace();
114760
114730
  emit(node.equalsGreaterThanToken);
114761
114731
  }
114732
+ function emitArrowFunctionBody(node) {
114733
+ if (isBlock(node.body)) {
114734
+ emitBlockFunctionBody(node.body);
114735
+ } else {
114736
+ writeSpace();
114737
+ emitExpression(node.body, parenthesizer.parenthesizeConciseBodyOfArrowFunction);
114738
+ }
114739
+ }
114762
114740
  function emitDeleteExpression(node) {
114763
114741
  emitTokenWithComment(91 /* DeleteKeyword */, node.pos, writeKeyword, node);
114764
114742
  writeSpace();
@@ -115306,35 +115284,33 @@ function createPrinter(printerOptions = {}, handlers = {}) {
115306
115284
  emit(node.asteriskToken);
115307
115285
  writeSpace();
115308
115286
  emitIdentifierName(node.name);
115309
- emitSignatureAndBody(node, emitSignatureHead);
115287
+ emitSignatureAndBody(node, emitSignatureHead, emitFunctionBody);
115288
+ }
115289
+ function emitSignatureAndBody(node, emitSignatureHead2, emitBody) {
115290
+ const indentedFlag = getEmitFlags(node) & 131072 /* Indented */;
115291
+ if (indentedFlag) {
115292
+ increaseIndent();
115293
+ }
115294
+ pushNameGenerationScope(node);
115295
+ forEach(node.parameters, generateNames);
115296
+ emitSignatureHead2(node);
115297
+ emitBody(node);
115298
+ popNameGenerationScope(node);
115299
+ if (indentedFlag) {
115300
+ decreaseIndent();
115301
+ }
115310
115302
  }
115311
- function emitSignatureAndBody(node, emitSignatureHead2) {
115303
+ function emitFunctionBody(node) {
115312
115304
  const body = node.body;
115313
115305
  if (body) {
115314
- if (isBlock(body)) {
115315
- const indentedFlag = getEmitFlags(node) & 131072 /* Indented */;
115316
- if (indentedFlag) {
115317
- increaseIndent();
115318
- }
115319
- pushNameGenerationScope(node);
115320
- forEach(node.parameters, generateNames);
115321
- generateNames(node.body);
115322
- emitSignatureHead2(node);
115323
- emitBlockFunctionBody(body);
115324
- popNameGenerationScope(node);
115325
- if (indentedFlag) {
115326
- decreaseIndent();
115327
- }
115328
- } else {
115329
- emitSignatureHead2(node);
115330
- writeSpace();
115331
- emitExpression(body, parenthesizer.parenthesizeConciseBodyOfArrowFunction);
115332
- }
115306
+ emitBlockFunctionBody(body);
115333
115307
  } else {
115334
- emitSignatureHead2(node);
115335
115308
  writeTrailingSemicolon();
115336
115309
  }
115337
115310
  }
115311
+ function emitEmptyFunctionBody(_node) {
115312
+ writeTrailingSemicolon();
115313
+ }
115338
115314
  function emitSignatureHead(node) {
115339
115315
  emitTypeParameters(node, node.typeParameters);
115340
115316
  emitParameters(node, node.parameters);
@@ -115363,6 +115339,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
115363
115339
  return true;
115364
115340
  }
115365
115341
  function emitBlockFunctionBody(body) {
115342
+ generateNames(body);
115366
115343
  onBeforeEmitNode == null ? void 0 : onBeforeEmitNode(body);
115367
115344
  writeSpace();
115368
115345
  writePunctuation("{");
@@ -115403,12 +115380,6 @@ function createPrinter(printerOptions = {}, handlers = {}) {
115403
115380
  emitClassDeclarationOrExpression(node);
115404
115381
  }
115405
115382
  function emitClassDeclarationOrExpression(node) {
115406
- pushPrivateNameGenerationScope(
115407
- 0 /* Auto */,
115408
- /*newReservedMemberNames*/
115409
- void 0
115410
- );
115411
- forEach(node.members, generateMemberNames);
115412
115383
  emitDecoratorsAndModifiers(
115413
115384
  node,
115414
115385
  node.modifiers,
@@ -115428,19 +115399,16 @@ function createPrinter(printerOptions = {}, handlers = {}) {
115428
115399
  emitList(node, node.heritageClauses, 0 /* ClassHeritageClauses */);
115429
115400
  writeSpace();
115430
115401
  writePunctuation("{");
115402
+ pushNameGenerationScope(node);
115403
+ forEach(node.members, generateMemberNames);
115431
115404
  emitList(node, node.members, 129 /* ClassMembers */);
115405
+ popNameGenerationScope(node);
115432
115406
  writePunctuation("}");
115433
115407
  if (indentedFlag) {
115434
115408
  decreaseIndent();
115435
115409
  }
115436
- popPrivateNameGenerationScope();
115437
115410
  }
115438
115411
  function emitInterfaceDeclaration(node) {
115439
- pushPrivateNameGenerationScope(
115440
- 0 /* Auto */,
115441
- /*newReservedMemberNames*/
115442
- void 0
115443
- );
115444
115412
  emitDecoratorsAndModifiers(
115445
115413
  node,
115446
115414
  node.modifiers,
@@ -115454,9 +115422,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
115454
115422
  emitList(node, node.heritageClauses, 512 /* HeritageClauses */);
115455
115423
  writeSpace();
115456
115424
  writePunctuation("{");
115425
+ pushNameGenerationScope(node);
115426
+ forEach(node.members, generateMemberNames);
115457
115427
  emitList(node, node.members, 129 /* InterfaceMembers */);
115428
+ popNameGenerationScope(node);
115458
115429
  writePunctuation("}");
115459
- popPrivateNameGenerationScope();
115460
115430
  }
115461
115431
  function emitTypeAliasDeclaration(node) {
115462
115432
  emitDecoratorsAndModifiers(
@@ -116837,6 +116807,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
116837
116807
  return getLiteralText(node, currentSourceFile, flags);
116838
116808
  }
116839
116809
  function pushNameGenerationScope(node) {
116810
+ privateNameTempFlagsStack.push(privateNameTempFlags);
116811
+ privateNameTempFlags = 0 /* Auto */;
116812
+ reservedPrivateNamesStack.push(reservedPrivateNames);
116840
116813
  if (node && getEmitFlags(node) & 1048576 /* ReuseTempVariableScope */) {
116841
116814
  return;
116842
116815
  }
@@ -116847,6 +116820,8 @@ function createPrinter(printerOptions = {}, handlers = {}) {
116847
116820
  reservedNamesStack.push(reservedNames);
116848
116821
  }
116849
116822
  function popNameGenerationScope(node) {
116823
+ privateNameTempFlags = privateNameTempFlagsStack.pop();
116824
+ reservedPrivateNames = reservedPrivateNamesStack.pop();
116850
116825
  if (node && getEmitFlags(node) & 1048576 /* ReuseTempVariableScope */) {
116851
116826
  return;
116852
116827
  }
@@ -116860,16 +116835,6 @@ function createPrinter(printerOptions = {}, handlers = {}) {
116860
116835
  }
116861
116836
  reservedNames.add(name);
116862
116837
  }
116863
- function pushPrivateNameGenerationScope(newPrivateNameTempFlags, newReservedMemberNames) {
116864
- privateNameTempFlagsStack.push(privateNameTempFlags);
116865
- privateNameTempFlags = newPrivateNameTempFlags;
116866
- reservedPrivateNamesStack.push(reservedNames);
116867
- reservedPrivateNames = newReservedMemberNames;
116868
- }
116869
- function popPrivateNameGenerationScope() {
116870
- privateNameTempFlags = privateNameTempFlagsStack.pop();
116871
- reservedPrivateNames = reservedPrivateNamesStack.pop();
116872
- }
116873
116838
  function reservePrivateNameInNestedScopes(name) {
116874
116839
  if (!reservedPrivateNames || reservedPrivateNames === lastOrUndefined(reservedPrivateNamesStack)) {
116875
116840
  reservedPrivateNames = /* @__PURE__ */ new Set();
@@ -116969,7 +116934,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
116969
116934
  case 303 /* PropertyAssignment */:
116970
116935
  case 304 /* ShorthandPropertyAssignment */:
116971
116936
  case 172 /* PropertyDeclaration */:
116937
+ case 171 /* PropertySignature */:
116972
116938
  case 174 /* MethodDeclaration */:
116939
+ case 173 /* MethodSignature */:
116973
116940
  case 177 /* GetAccessor */:
116974
116941
  case 178 /* SetAccessor */:
116975
116942
  generateNameIfNeeded(node.name);
@@ -117003,7 +116970,28 @@ function createPrinter(printerOptions = {}, handlers = {}) {
117003
116970
  return isFileLevelUniqueNameInCurrentFile(name, privateName) && !isReservedName(name, privateName) && !generatedNames.has(name);
117004
116971
  }
117005
116972
  function isReservedName(name, privateName) {
117006
- return privateName ? !!(reservedPrivateNames == null ? void 0 : reservedPrivateNames.has(name)) : !!(reservedNames == null ? void 0 : reservedNames.has(name));
116973
+ let set;
116974
+ let stack;
116975
+ if (privateName) {
116976
+ set = reservedPrivateNames;
116977
+ stack = reservedPrivateNamesStack;
116978
+ } else {
116979
+ set = reservedNames;
116980
+ stack = reservedNamesStack;
116981
+ }
116982
+ if (set == null ? void 0 : set.has(name)) {
116983
+ return true;
116984
+ }
116985
+ for (let i = stack.length - 1; i >= 0; i--) {
116986
+ if (set === stack[i]) {
116987
+ continue;
116988
+ }
116989
+ set = stack[i];
116990
+ if (set == null ? void 0 : set.has(name)) {
116991
+ return true;
116992
+ }
116993
+ }
116994
+ return false;
117007
116995
  }
117008
116996
  function isFileLevelUniqueNameInCurrentFile(name, _isPrivate) {
117009
116997
  return currentSourceFile ? isFileLevelUniqueName(currentSourceFile, name, hasGlobalName) : true;
package/lib/typescript.js CHANGED
@@ -2364,7 +2364,7 @@ module.exports = __toCommonJS(typescript_exports);
2364
2364
 
2365
2365
  // src/compiler/corePublic.ts
2366
2366
  var versionMajorMinor = "5.5";
2367
- var version = `${versionMajorMinor}.0-insiders.20240505`;
2367
+ var version = `${versionMajorMinor}.0-insiders.20240506`;
2368
2368
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2369
2369
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2370
2370
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -51509,7 +51509,12 @@ function createTypeChecker(host) {
51509
51509
  if (resolvedTarget === unknownSymbol) {
51510
51510
  return source;
51511
51511
  }
51512
- target = cloneSymbol(resolvedTarget);
51512
+ if (!(resolvedTarget.flags & getExcludedSymbolFlags(source.flags)) || (source.flags | resolvedTarget.flags) & 67108864 /* Assignment */) {
51513
+ target = cloneSymbol(resolvedTarget);
51514
+ } else {
51515
+ reportMergeSymbolError(target, source);
51516
+ return source;
51517
+ }
51513
51518
  }
51514
51519
  if (source.flags & 512 /* ValueModule */ && target.flags & 512 /* ValueModule */ && target.constEnumOnlyModule && !source.constEnumOnlyModule) {
51515
51520
  target.constEnumOnlyModule = false;
@@ -51541,31 +51546,34 @@ function createTypeChecker(host) {
51541
51546
  );
51542
51547
  }
51543
51548
  } else {
51544
- const isEitherEnum = !!(target.flags & 384 /* Enum */ || source.flags & 384 /* Enum */);
51545
- const isEitherBlockScoped = !!(target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */);
51549
+ reportMergeSymbolError(target, source);
51550
+ }
51551
+ return target;
51552
+ function reportMergeSymbolError(target2, source2) {
51553
+ const isEitherEnum = !!(target2.flags & 384 /* Enum */ || source2.flags & 384 /* Enum */);
51554
+ const isEitherBlockScoped = !!(target2.flags & 2 /* BlockScopedVariable */ || source2.flags & 2 /* BlockScopedVariable */);
51546
51555
  const message = isEitherEnum ? Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations : isEitherBlockScoped ? Diagnostics.Cannot_redeclare_block_scoped_variable_0 : Diagnostics.Duplicate_identifier_0;
51547
- const sourceSymbolFile = source.declarations && getSourceFileOfNode(source.declarations[0]);
51548
- const targetSymbolFile = target.declarations && getSourceFileOfNode(target.declarations[0]);
51556
+ const sourceSymbolFile = source2.declarations && getSourceFileOfNode(source2.declarations[0]);
51557
+ const targetSymbolFile = target2.declarations && getSourceFileOfNode(target2.declarations[0]);
51549
51558
  const isSourcePlainJs = isPlainJsFile(sourceSymbolFile, compilerOptions.checkJs);
51550
51559
  const isTargetPlainJs = isPlainJsFile(targetSymbolFile, compilerOptions.checkJs);
51551
- const symbolName2 = symbolToString(source);
51560
+ const symbolName2 = symbolToString(source2);
51552
51561
  if (sourceSymbolFile && targetSymbolFile && amalgamatedDuplicates && !isEitherEnum && sourceSymbolFile !== targetSymbolFile) {
51553
51562
  const firstFile = comparePaths(sourceSymbolFile.path, targetSymbolFile.path) === -1 /* LessThan */ ? sourceSymbolFile : targetSymbolFile;
51554
51563
  const secondFile = firstFile === sourceSymbolFile ? targetSymbolFile : sourceSymbolFile;
51555
51564
  const filesDuplicates = getOrUpdate(amalgamatedDuplicates, `${firstFile.path}|${secondFile.path}`, () => ({ firstFile, secondFile, conflictingSymbols: /* @__PURE__ */ new Map() }));
51556
51565
  const conflictingSymbolInfo = getOrUpdate(filesDuplicates.conflictingSymbols, symbolName2, () => ({ isBlockScoped: isEitherBlockScoped, firstFileLocations: [], secondFileLocations: [] }));
51557
51566
  if (!isSourcePlainJs)
51558
- addDuplicateLocations(conflictingSymbolInfo.firstFileLocations, source);
51567
+ addDuplicateLocations(conflictingSymbolInfo.firstFileLocations, source2);
51559
51568
  if (!isTargetPlainJs)
51560
- addDuplicateLocations(conflictingSymbolInfo.secondFileLocations, target);
51569
+ addDuplicateLocations(conflictingSymbolInfo.secondFileLocations, target2);
51561
51570
  } else {
51562
51571
  if (!isSourcePlainJs)
51563
- addDuplicateDeclarationErrorsForSymbols(source, message, symbolName2, target);
51572
+ addDuplicateDeclarationErrorsForSymbols(source2, message, symbolName2, target2);
51564
51573
  if (!isTargetPlainJs)
51565
- addDuplicateDeclarationErrorsForSymbols(target, message, symbolName2, source);
51574
+ addDuplicateDeclarationErrorsForSymbols(target2, message, symbolName2, source2);
51566
51575
  }
51567
51576
  }
51568
- return target;
51569
51577
  function addDuplicateLocations(locs, symbol) {
51570
51578
  if (symbol.declarations) {
51571
51579
  for (const decl of symbol.declarations) {
@@ -61032,13 +61040,8 @@ function createTypeChecker(host) {
61032
61040
  if (left.typeParameters && right.typeParameters) {
61033
61041
  paramMapper = createTypeMapper(right.typeParameters, left.typeParameters);
61034
61042
  }
61035
- let flags = (left.flags | right.flags) & (167 /* PropagatingFlags */ & ~1 /* HasRestParameter */);
61036
61043
  const declaration = left.declaration;
61037
61044
  const params = combineUnionParameters(left, right, paramMapper);
61038
- const lastParam = lastOrUndefined(params);
61039
- if (lastParam && getCheckFlags(lastParam) & 32768 /* RestParameter */) {
61040
- flags |= 1 /* HasRestParameter */;
61041
- }
61042
61045
  const thisParam = combineUnionThisParam(left.thisParameter, right.thisParameter, paramMapper);
61043
61046
  const minArgCount = Math.max(left.minArgumentCount, right.minArgumentCount);
61044
61047
  const result = createSignature(
@@ -61051,7 +61054,7 @@ function createTypeChecker(host) {
61051
61054
  /*resolvedTypePredicate*/
61052
61055
  void 0,
61053
61056
  minArgCount,
61054
- flags
61057
+ (left.flags | right.flags) & 167 /* PropagatingFlags */
61055
61058
  );
61056
61059
  result.compositeKind = 1048576 /* Union */;
61057
61060
  result.compositeSignatures = concatenate(left.compositeKind !== 2097152 /* Intersection */ && left.compositeSignatures || [left], [right]);
@@ -76043,13 +76046,8 @@ function createTypeChecker(host) {
76043
76046
  if (left.typeParameters && right.typeParameters) {
76044
76047
  paramMapper = createTypeMapper(right.typeParameters, left.typeParameters);
76045
76048
  }
76046
- let flags = (left.flags | right.flags) & (167 /* PropagatingFlags */ & ~1 /* HasRestParameter */);
76047
76049
  const declaration = left.declaration;
76048
76050
  const params = combineIntersectionParameters(left, right, paramMapper);
76049
- const lastParam = lastOrUndefined(params);
76050
- if (lastParam && getCheckFlags(lastParam) & 32768 /* RestParameter */) {
76051
- flags |= 1 /* HasRestParameter */;
76052
- }
76053
76051
  const thisParam = combineIntersectionThisParam(left.thisParameter, right.thisParameter, paramMapper);
76054
76052
  const minArgCount = Math.max(left.minArgumentCount, right.minArgumentCount);
76055
76053
  const result = createSignature(
@@ -76062,7 +76060,7 @@ function createTypeChecker(host) {
76062
76060
  /*resolvedTypePredicate*/
76063
76061
  void 0,
76064
76062
  minArgCount,
76065
- flags
76063
+ (left.flags | right.flags) & 167 /* PropagatingFlags */
76066
76064
  );
76067
76065
  result.compositeKind = 2097152 /* Intersection */;
76068
76066
  result.compositeSignatures = concatenate(left.compositeKind === 2097152 /* Intersection */ && left.compositeSignatures || [left], [right]);
@@ -119259,13 +119257,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
119259
119257
  }
119260
119258
  }
119261
119259
  function emitComputedPropertyName(node) {
119262
- const savedPrivateNameTempFlags = privateNameTempFlags;
119263
- const savedReservedMemberNames = reservedPrivateNames;
119264
- popPrivateNameGenerationScope();
119265
119260
  writePunctuation("[");
119266
119261
  emitExpression(node.expression, parenthesizer.parenthesizeExpressionOfComputedPropertyName);
119267
119262
  writePunctuation("]");
119268
- pushPrivateNameGenerationScope(savedPrivateNameTempFlags, savedReservedMemberNames);
119269
119263
  }
119270
119264
  function emitTypeParameter(node) {
119271
119265
  emitModifierList(node, node.modifiers);
@@ -119326,15 +119320,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
119326
119320
  writeTrailingSemicolon();
119327
119321
  }
119328
119322
  function emitMethodSignature(node) {
119329
- pushNameGenerationScope(node);
119330
119323
  emitModifierList(node, node.modifiers);
119331
119324
  emit(node.name);
119332
119325
  emit(node.questionToken);
119333
- emitTypeParameters(node, node.typeParameters);
119334
- emitParameters(node, node.parameters);
119335
- emitTypeAnnotation(node.type);
119336
- writeTrailingSemicolon();
119337
- popNameGenerationScope(node);
119326
+ emitSignatureAndBody(node, emitSignatureHead, emitEmptyFunctionBody);
119338
119327
  }
119339
119328
  function emitMethodDeclaration(node) {
119340
119329
  emitDecoratorsAndModifiers(
@@ -119346,11 +119335,13 @@ function createPrinter(printerOptions = {}, handlers = {}) {
119346
119335
  emit(node.asteriskToken);
119347
119336
  emit(node.name);
119348
119337
  emit(node.questionToken);
119349
- emitSignatureAndBody(node, emitSignatureHead);
119338
+ emitSignatureAndBody(node, emitSignatureHead, emitFunctionBody);
119350
119339
  }
119351
119340
  function emitClassStaticBlockDeclaration(node) {
119352
119341
  writeKeyword("static");
119342
+ pushNameGenerationScope(node);
119353
119343
  emitBlockFunctionBody(node.body);
119344
+ popNameGenerationScope(node);
119354
119345
  }
119355
119346
  function emitConstructor(node) {
119356
119347
  emitDecoratorsAndModifiers(
@@ -119360,7 +119351,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
119360
119351
  false
119361
119352
  );
119362
119353
  writeKeyword("constructor");
119363
- emitSignatureAndBody(node, emitSignatureHead);
119354
+ emitSignatureAndBody(node, emitSignatureHead, emitFunctionBody);
119364
119355
  }
119365
119356
  function emitAccessorDeclaration(node) {
119366
119357
  const pos = emitDecoratorsAndModifiers(
@@ -119373,25 +119364,15 @@ function createPrinter(printerOptions = {}, handlers = {}) {
119373
119364
  emitTokenWithComment(token, pos, writeKeyword, node);
119374
119365
  writeSpace();
119375
119366
  emit(node.name);
119376
- emitSignatureAndBody(node, emitSignatureHead);
119367
+ emitSignatureAndBody(node, emitSignatureHead, emitFunctionBody);
119377
119368
  }
119378
119369
  function emitCallSignature(node) {
119379
- pushNameGenerationScope(node);
119380
- emitTypeParameters(node, node.typeParameters);
119381
- emitParameters(node, node.parameters);
119382
- emitTypeAnnotation(node.type);
119383
- writeTrailingSemicolon();
119384
- popNameGenerationScope(node);
119370
+ emitSignatureAndBody(node, emitSignatureHead, emitEmptyFunctionBody);
119385
119371
  }
119386
119372
  function emitConstructSignature(node) {
119387
- pushNameGenerationScope(node);
119388
119373
  writeKeyword("new");
119389
119374
  writeSpace();
119390
- emitTypeParameters(node, node.typeParameters);
119391
- emitParameters(node, node.parameters);
119392
- emitTypeAnnotation(node.type);
119393
- writeTrailingSemicolon();
119394
- popNameGenerationScope(node);
119375
+ emitSignatureAndBody(node, emitSignatureHead, emitEmptyFunctionBody);
119395
119376
  }
119396
119377
  function emitIndexSignature(node) {
119397
119378
  emitDecoratorsAndModifiers(
@@ -119429,14 +119410,17 @@ function createPrinter(printerOptions = {}, handlers = {}) {
119429
119410
  emitTypeArguments(node, node.typeArguments);
119430
119411
  }
119431
119412
  function emitFunctionType(node) {
119432
- pushNameGenerationScope(node);
119413
+ emitSignatureAndBody(node, emitFunctionTypeHead, emitFunctionTypeBody);
119414
+ }
119415
+ function emitFunctionTypeHead(node) {
119433
119416
  emitTypeParameters(node, node.typeParameters);
119434
119417
  emitParametersForArrow(node, node.parameters);
119435
119418
  writeSpace();
119436
119419
  writePunctuation("=>");
119420
+ }
119421
+ function emitFunctionTypeBody(node) {
119437
119422
  writeSpace();
119438
119423
  emit(node.type);
119439
- popNameGenerationScope(node);
119440
119424
  }
119441
119425
  function emitJSDocFunctionType(node) {
119442
119426
  writeKeyword("function");
@@ -119457,17 +119441,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
119457
119441
  writePunctuation("=");
119458
119442
  }
119459
119443
  function emitConstructorType(node) {
119460
- pushNameGenerationScope(node);
119461
119444
  emitModifierList(node, node.modifiers);
119462
119445
  writeKeyword("new");
119463
119446
  writeSpace();
119464
- emitTypeParameters(node, node.typeParameters);
119465
- emitParameters(node, node.parameters);
119466
- writeSpace();
119467
- writePunctuation("=>");
119468
- writeSpace();
119469
- emit(node.type);
119470
- popNameGenerationScope(node);
119447
+ emitSignatureAndBody(node, emitFunctionTypeHead, emitFunctionTypeBody);
119471
119448
  }
119472
119449
  function emitTypeQuery(node) {
119473
119450
  writeKeyword("typeof");
@@ -119476,16 +119453,13 @@ function createPrinter(printerOptions = {}, handlers = {}) {
119476
119453
  emitTypeArguments(node, node.typeArguments);
119477
119454
  }
119478
119455
  function emitTypeLiteral(node) {
119479
- pushPrivateNameGenerationScope(
119480
- 0 /* Auto */,
119481
- /*newReservedMemberNames*/
119482
- void 0
119483
- );
119456
+ pushNameGenerationScope(node);
119457
+ forEach(node.members, generateMemberNames);
119484
119458
  writePunctuation("{");
119485
119459
  const flags = getEmitFlags(node) & 1 /* SingleLine */ ? 768 /* SingleLineTypeLiteralMembers */ : 32897 /* MultiLineTypeLiteralMembers */;
119486
119460
  emitList(node, node.members, flags | 524288 /* NoSpaceIfEmpty */);
119487
119461
  writePunctuation("}");
119488
- popPrivateNameGenerationScope();
119462
+ popNameGenerationScope(node);
119489
119463
  }
119490
119464
  function emitArrayType(node) {
119491
119465
  emit(node.elementType, parenthesizer.parenthesizeNonArrayTypeOfPostfixType);
@@ -119657,11 +119631,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
119657
119631
  emitExpressionList(node, elements, 8914 /* ArrayLiteralExpressionElements */ | preferNewLine, parenthesizer.parenthesizeExpressionForDisallowedComma);
119658
119632
  }
119659
119633
  function emitObjectLiteralExpression(node) {
119660
- pushPrivateNameGenerationScope(
119661
- 0 /* Auto */,
119662
- /*newReservedMemberNames*/
119663
- void 0
119664
- );
119634
+ pushNameGenerationScope(node);
119665
119635
  forEach(node.properties, generateMemberNames);
119666
119636
  const indentedFlag = getEmitFlags(node) & 131072 /* Indented */;
119667
119637
  if (indentedFlag) {
@@ -119673,7 +119643,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
119673
119643
  if (indentedFlag) {
119674
119644
  decreaseIndent();
119675
119645
  }
119676
- popPrivateNameGenerationScope();
119646
+ popNameGenerationScope(node);
119677
119647
  }
119678
119648
  function emitPropertyAccessExpression(node) {
119679
119649
  emitExpression(node.expression, parenthesizer.parenthesizeLeftSideOfAccess);
@@ -119788,7 +119758,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
119788
119758
  }
119789
119759
  function emitArrowFunction(node) {
119790
119760
  emitModifierList(node, node.modifiers);
119791
- emitSignatureAndBody(node, emitArrowFunctionHead);
119761
+ emitSignatureAndBody(node, emitArrowFunctionHead, emitArrowFunctionBody);
119792
119762
  }
119793
119763
  function emitArrowFunctionHead(node) {
119794
119764
  emitTypeParameters(node, node.typeParameters);
@@ -119797,6 +119767,14 @@ function createPrinter(printerOptions = {}, handlers = {}) {
119797
119767
  writeSpace();
119798
119768
  emit(node.equalsGreaterThanToken);
119799
119769
  }
119770
+ function emitArrowFunctionBody(node) {
119771
+ if (isBlock(node.body)) {
119772
+ emitBlockFunctionBody(node.body);
119773
+ } else {
119774
+ writeSpace();
119775
+ emitExpression(node.body, parenthesizer.parenthesizeConciseBodyOfArrowFunction);
119776
+ }
119777
+ }
119800
119778
  function emitDeleteExpression(node) {
119801
119779
  emitTokenWithComment(91 /* DeleteKeyword */, node.pos, writeKeyword, node);
119802
119780
  writeSpace();
@@ -120344,35 +120322,33 @@ function createPrinter(printerOptions = {}, handlers = {}) {
120344
120322
  emit(node.asteriskToken);
120345
120323
  writeSpace();
120346
120324
  emitIdentifierName(node.name);
120347
- emitSignatureAndBody(node, emitSignatureHead);
120325
+ emitSignatureAndBody(node, emitSignatureHead, emitFunctionBody);
120326
+ }
120327
+ function emitSignatureAndBody(node, emitSignatureHead2, emitBody) {
120328
+ const indentedFlag = getEmitFlags(node) & 131072 /* Indented */;
120329
+ if (indentedFlag) {
120330
+ increaseIndent();
120331
+ }
120332
+ pushNameGenerationScope(node);
120333
+ forEach(node.parameters, generateNames);
120334
+ emitSignatureHead2(node);
120335
+ emitBody(node);
120336
+ popNameGenerationScope(node);
120337
+ if (indentedFlag) {
120338
+ decreaseIndent();
120339
+ }
120348
120340
  }
120349
- function emitSignatureAndBody(node, emitSignatureHead2) {
120341
+ function emitFunctionBody(node) {
120350
120342
  const body = node.body;
120351
120343
  if (body) {
120352
- if (isBlock(body)) {
120353
- const indentedFlag = getEmitFlags(node) & 131072 /* Indented */;
120354
- if (indentedFlag) {
120355
- increaseIndent();
120356
- }
120357
- pushNameGenerationScope(node);
120358
- forEach(node.parameters, generateNames);
120359
- generateNames(node.body);
120360
- emitSignatureHead2(node);
120361
- emitBlockFunctionBody(body);
120362
- popNameGenerationScope(node);
120363
- if (indentedFlag) {
120364
- decreaseIndent();
120365
- }
120366
- } else {
120367
- emitSignatureHead2(node);
120368
- writeSpace();
120369
- emitExpression(body, parenthesizer.parenthesizeConciseBodyOfArrowFunction);
120370
- }
120344
+ emitBlockFunctionBody(body);
120371
120345
  } else {
120372
- emitSignatureHead2(node);
120373
120346
  writeTrailingSemicolon();
120374
120347
  }
120375
120348
  }
120349
+ function emitEmptyFunctionBody(_node) {
120350
+ writeTrailingSemicolon();
120351
+ }
120376
120352
  function emitSignatureHead(node) {
120377
120353
  emitTypeParameters(node, node.typeParameters);
120378
120354
  emitParameters(node, node.parameters);
@@ -120401,6 +120377,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
120401
120377
  return true;
120402
120378
  }
120403
120379
  function emitBlockFunctionBody(body) {
120380
+ generateNames(body);
120404
120381
  onBeforeEmitNode == null ? void 0 : onBeforeEmitNode(body);
120405
120382
  writeSpace();
120406
120383
  writePunctuation("{");
@@ -120441,12 +120418,6 @@ function createPrinter(printerOptions = {}, handlers = {}) {
120441
120418
  emitClassDeclarationOrExpression(node);
120442
120419
  }
120443
120420
  function emitClassDeclarationOrExpression(node) {
120444
- pushPrivateNameGenerationScope(
120445
- 0 /* Auto */,
120446
- /*newReservedMemberNames*/
120447
- void 0
120448
- );
120449
- forEach(node.members, generateMemberNames);
120450
120421
  emitDecoratorsAndModifiers(
120451
120422
  node,
120452
120423
  node.modifiers,
@@ -120466,19 +120437,16 @@ function createPrinter(printerOptions = {}, handlers = {}) {
120466
120437
  emitList(node, node.heritageClauses, 0 /* ClassHeritageClauses */);
120467
120438
  writeSpace();
120468
120439
  writePunctuation("{");
120440
+ pushNameGenerationScope(node);
120441
+ forEach(node.members, generateMemberNames);
120469
120442
  emitList(node, node.members, 129 /* ClassMembers */);
120443
+ popNameGenerationScope(node);
120470
120444
  writePunctuation("}");
120471
120445
  if (indentedFlag) {
120472
120446
  decreaseIndent();
120473
120447
  }
120474
- popPrivateNameGenerationScope();
120475
120448
  }
120476
120449
  function emitInterfaceDeclaration(node) {
120477
- pushPrivateNameGenerationScope(
120478
- 0 /* Auto */,
120479
- /*newReservedMemberNames*/
120480
- void 0
120481
- );
120482
120450
  emitDecoratorsAndModifiers(
120483
120451
  node,
120484
120452
  node.modifiers,
@@ -120492,9 +120460,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
120492
120460
  emitList(node, node.heritageClauses, 512 /* HeritageClauses */);
120493
120461
  writeSpace();
120494
120462
  writePunctuation("{");
120463
+ pushNameGenerationScope(node);
120464
+ forEach(node.members, generateMemberNames);
120495
120465
  emitList(node, node.members, 129 /* InterfaceMembers */);
120466
+ popNameGenerationScope(node);
120496
120467
  writePunctuation("}");
120497
- popPrivateNameGenerationScope();
120498
120468
  }
120499
120469
  function emitTypeAliasDeclaration(node) {
120500
120470
  emitDecoratorsAndModifiers(
@@ -121875,6 +121845,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
121875
121845
  return getLiteralText(node, currentSourceFile, flags);
121876
121846
  }
121877
121847
  function pushNameGenerationScope(node) {
121848
+ privateNameTempFlagsStack.push(privateNameTempFlags);
121849
+ privateNameTempFlags = 0 /* Auto */;
121850
+ reservedPrivateNamesStack.push(reservedPrivateNames);
121878
121851
  if (node && getEmitFlags(node) & 1048576 /* ReuseTempVariableScope */) {
121879
121852
  return;
121880
121853
  }
@@ -121885,6 +121858,8 @@ function createPrinter(printerOptions = {}, handlers = {}) {
121885
121858
  reservedNamesStack.push(reservedNames);
121886
121859
  }
121887
121860
  function popNameGenerationScope(node) {
121861
+ privateNameTempFlags = privateNameTempFlagsStack.pop();
121862
+ reservedPrivateNames = reservedPrivateNamesStack.pop();
121888
121863
  if (node && getEmitFlags(node) & 1048576 /* ReuseTempVariableScope */) {
121889
121864
  return;
121890
121865
  }
@@ -121898,16 +121873,6 @@ function createPrinter(printerOptions = {}, handlers = {}) {
121898
121873
  }
121899
121874
  reservedNames.add(name);
121900
121875
  }
121901
- function pushPrivateNameGenerationScope(newPrivateNameTempFlags, newReservedMemberNames) {
121902
- privateNameTempFlagsStack.push(privateNameTempFlags);
121903
- privateNameTempFlags = newPrivateNameTempFlags;
121904
- reservedPrivateNamesStack.push(reservedNames);
121905
- reservedPrivateNames = newReservedMemberNames;
121906
- }
121907
- function popPrivateNameGenerationScope() {
121908
- privateNameTempFlags = privateNameTempFlagsStack.pop();
121909
- reservedPrivateNames = reservedPrivateNamesStack.pop();
121910
- }
121911
121876
  function reservePrivateNameInNestedScopes(name) {
121912
121877
  if (!reservedPrivateNames || reservedPrivateNames === lastOrUndefined(reservedPrivateNamesStack)) {
121913
121878
  reservedPrivateNames = /* @__PURE__ */ new Set();
@@ -122007,7 +121972,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
122007
121972
  case 303 /* PropertyAssignment */:
122008
121973
  case 304 /* ShorthandPropertyAssignment */:
122009
121974
  case 172 /* PropertyDeclaration */:
121975
+ case 171 /* PropertySignature */:
122010
121976
  case 174 /* MethodDeclaration */:
121977
+ case 173 /* MethodSignature */:
122011
121978
  case 177 /* GetAccessor */:
122012
121979
  case 178 /* SetAccessor */:
122013
121980
  generateNameIfNeeded(node.name);
@@ -122041,7 +122008,28 @@ function createPrinter(printerOptions = {}, handlers = {}) {
122041
122008
  return isFileLevelUniqueNameInCurrentFile(name, privateName) && !isReservedName(name, privateName) && !generatedNames.has(name);
122042
122009
  }
122043
122010
  function isReservedName(name, privateName) {
122044
- return privateName ? !!(reservedPrivateNames == null ? void 0 : reservedPrivateNames.has(name)) : !!(reservedNames == null ? void 0 : reservedNames.has(name));
122011
+ let set;
122012
+ let stack;
122013
+ if (privateName) {
122014
+ set = reservedPrivateNames;
122015
+ stack = reservedPrivateNamesStack;
122016
+ } else {
122017
+ set = reservedNames;
122018
+ stack = reservedNamesStack;
122019
+ }
122020
+ if (set == null ? void 0 : set.has(name)) {
122021
+ return true;
122022
+ }
122023
+ for (let i = stack.length - 1; i >= 0; i--) {
122024
+ if (set === stack[i]) {
122025
+ continue;
122026
+ }
122027
+ set = stack[i];
122028
+ if (set == null ? void 0 : set.has(name)) {
122029
+ return true;
122030
+ }
122031
+ }
122032
+ return false;
122045
122033
  }
122046
122034
  function isFileLevelUniqueNameInCurrentFile(name, _isPrivate) {
122047
122035
  return currentSourceFile ? isFileLevelUniqueName(currentSourceFile, name, hasGlobalName) : true;
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": "5.5.0-pr-58440-3",
5
+ "version": "5.5.0-pr-58326-8",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [