@typescript-deploys/pr-build 5.6.0-pr-58760-2 → 5.6.0-pr-58514-9

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/typescript.js CHANGED
@@ -277,7 +277,7 @@ __export(typescript_exports, {
277
277
  changeFullExtension: () => changeFullExtension,
278
278
  changesAffectModuleResolution: () => changesAffectModuleResolution,
279
279
  changesAffectingProgramStructure: () => changesAffectingProgramStructure,
280
- characterToRegularExpressionFlag: () => characterToRegularExpressionFlag,
280
+ characterCodeToRegularExpressionFlag: () => characterCodeToRegularExpressionFlag,
281
281
  childIsDecorated: () => childIsDecorated,
282
282
  classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated,
283
283
  classHasClassThisAssignment: () => classHasClassThisAssignment,
@@ -377,9 +377,8 @@ __export(typescript_exports, {
377
377
  createBaseNodeFactory: () => createBaseNodeFactory,
378
378
  createBinaryExpressionTrampoline: () => createBinaryExpressionTrampoline,
379
379
  createBindingHelper: () => createBindingHelper,
380
- createBuildInfo: () => createBuildInfo,
381
380
  createBuilderProgram: () => createBuilderProgram,
382
- createBuilderProgramUsingProgramBuildInfo: () => createBuilderProgramUsingProgramBuildInfo,
381
+ createBuilderProgramUsingIncrementalBuildInfo: () => createBuilderProgramUsingIncrementalBuildInfo,
383
382
  createBuilderStatusReporter: () => createBuilderStatusReporter,
384
383
  createCacheWithRedirects: () => createCacheWithRedirects,
385
384
  createCacheableExportInfoMap: () => createCacheableExportInfoMap,
@@ -1263,7 +1262,7 @@ __export(typescript_exports, {
1263
1262
  isBreakStatement: () => isBreakStatement,
1264
1263
  isBuild: () => isBuild,
1265
1264
  isBuildInfoFile: () => isBuildInfoFile,
1266
- isBuilderProgram: () => isBuilderProgram2,
1265
+ isBuilderProgram: () => isBuilderProgram,
1267
1266
  isBundle: () => isBundle,
1268
1267
  isCallChain: () => isCallChain,
1269
1268
  isCallExpression: () => isCallExpression,
@@ -1470,6 +1469,8 @@ __export(typescript_exports, {
1470
1469
  isInTemplateString: () => isInTemplateString,
1471
1470
  isInTopLevelContext: () => isInTopLevelContext,
1472
1471
  isInTypeQuery: () => isInTypeQuery,
1472
+ isIncrementalBuildInfo: () => isIncrementalBuildInfo,
1473
+ isIncrementalBundleEmitBuildInfo: () => isIncrementalBundleEmitBuildInfo,
1473
1474
  isIncrementalCompilation: () => isIncrementalCompilation,
1474
1475
  isIndexSignatureDeclaration: () => isIndexSignatureDeclaration,
1475
1476
  isIndexedAccessTypeNode: () => isIndexedAccessTypeNode,
@@ -1612,6 +1613,7 @@ __export(typescript_exports, {
1612
1613
  isModuleBlock: () => isModuleBlock,
1613
1614
  isModuleBody: () => isModuleBody,
1614
1615
  isModuleDeclaration: () => isModuleDeclaration,
1616
+ isModuleExportName: () => isModuleExportName,
1615
1617
  isModuleExportsAccessExpression: () => isModuleExportsAccessExpression,
1616
1618
  isModuleIdentifier: () => isModuleIdentifier,
1617
1619
  isModuleName: () => isModuleName,
@@ -1705,7 +1707,6 @@ __export(typescript_exports, {
1705
1707
  isPrivateIdentifierClassElementDeclaration: () => isPrivateIdentifierClassElementDeclaration,
1706
1708
  isPrivateIdentifierPropertyAccessExpression: () => isPrivateIdentifierPropertyAccessExpression,
1707
1709
  isPrivateIdentifierSymbol: () => isPrivateIdentifierSymbol,
1708
- isProgramBundleEmitBuildInfo: () => isProgramBundleEmitBuildInfo,
1709
1710
  isProgramUptoDate: () => isProgramUptoDate,
1710
1711
  isPrologueDirective: () => isPrologueDirective,
1711
1712
  isPropertyAccessChain: () => isPropertyAccessChain,
@@ -1929,6 +1930,9 @@ __export(typescript_exports, {
1929
1930
  missingFileModifiedTime: () => missingFileModifiedTime,
1930
1931
  modifierToFlag: () => modifierToFlag,
1931
1932
  modifiersToFlags: () => modifiersToFlags,
1933
+ moduleExportNameIsDefault: () => moduleExportNameIsDefault,
1934
+ moduleExportNameTextEscaped: () => moduleExportNameTextEscaped,
1935
+ moduleExportNameTextUnescaped: () => moduleExportNameTextUnescaped,
1932
1936
  moduleOptionDeclaration: () => moduleOptionDeclaration,
1933
1937
  moduleResolutionIsEqualTo: () => moduleResolutionIsEqualTo,
1934
1938
  moduleResolutionNameAndModeGetter: () => moduleResolutionNameAndModeGetter,
@@ -2074,7 +2078,7 @@ __export(typescript_exports, {
2074
2078
  reducePathComponents: () => reducePathComponents,
2075
2079
  refactor: () => ts_refactor_exports,
2076
2080
  regExpEscape: () => regExpEscape,
2077
- regularExpressionFlagToCharacter: () => regularExpressionFlagToCharacter,
2081
+ regularExpressionFlagToCharacterCode: () => regularExpressionFlagToCharacterCode,
2078
2082
  relativeComplement: () => relativeComplement,
2079
2083
  removeAllComments: () => removeAllComments,
2080
2084
  removeEmitHelper: () => removeEmitHelper,
@@ -2332,7 +2336,6 @@ __export(typescript_exports, {
2332
2336
  unusedLabelIsError: () => unusedLabelIsError,
2333
2337
  unwrapInnermostStatementOfLabel: () => unwrapInnermostStatementOfLabel,
2334
2338
  unwrapParenthesizedExpression: () => unwrapParenthesizedExpression,
2335
- unwrapParenthesizedType: () => unwrapParenthesizedType,
2336
2339
  updateErrorForNoInputFiles: () => updateErrorForNoInputFiles,
2337
2340
  updateLanguageServiceSourceFile: () => updateLanguageServiceSourceFile,
2338
2341
  updateMissingFilePathsWatch: () => updateMissingFilePathsWatch,
@@ -2372,7 +2375,7 @@ module.exports = __toCommonJS(typescript_exports);
2372
2375
 
2373
2376
  // src/compiler/corePublic.ts
2374
2377
  var versionMajorMinor = "5.6";
2375
- var version = `${versionMajorMinor}.0-insiders.20240603`;
2378
+ var version = `${versionMajorMinor}.0-insiders.20240610`;
2376
2379
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2377
2380
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2378
2381
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -11457,7 +11460,8 @@ var Diagnostics = {
11457
11460
  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."),
11458
11461
  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."),
11459
11462
  _0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is_enabled: diag(18055, 1 /* Error */, "_0_has_a_string_type_but_must_have_syntactically_recognizable_string_syntax_when_isolatedModules_is__18055", "'{0}' has a string type, but must have syntactically recognizable string syntax when 'isolatedModules' is enabled."),
11460
- Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled: diag(18056, 1 /* Error */, "Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is__18056", "Enum member following a non-literal numeric member must have an initializer when 'isolatedModules' is enabled.")
11463
+ Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is_enabled: diag(18056, 1 /* Error */, "Enum_member_following_a_non_literal_numeric_member_must_have_an_initializer_when_isolatedModules_is__18056", "Enum member following a non-literal numeric member must have an initializer when 'isolatedModules' is enabled."),
11464
+ String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es2020: diag(18057, 1 /* Error */, "String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es_18057", "String literal import and export names are not supported when the '--module' flag is set to 'es2015' or 'es2020'.")
11461
11465
  };
11462
11466
 
11463
11467
  // src/compiler/scanner.ts
@@ -11617,16 +11621,16 @@ var textToToken = new Map(Object.entries({
11617
11621
  "#": 63 /* HashToken */,
11618
11622
  "`": 62 /* BacktickToken */
11619
11623
  }));
11620
- var charToRegExpFlag = new Map(Object.entries({
11621
- d: 1 /* HasIndices */,
11622
- g: 2 /* Global */,
11623
- i: 4 /* IgnoreCase */,
11624
- m: 8 /* Multiline */,
11625
- s: 16 /* DotAll */,
11626
- u: 32 /* Unicode */,
11627
- v: 64 /* UnicodeSets */,
11628
- y: 128 /* Sticky */
11629
- }));
11624
+ var charCodeToRegExpFlag = /* @__PURE__ */ new Map([
11625
+ [100 /* d */, 1 /* HasIndices */],
11626
+ [103 /* g */, 2 /* Global */],
11627
+ [105 /* i */, 4 /* IgnoreCase */],
11628
+ [109 /* m */, 8 /* Multiline */],
11629
+ [115 /* s */, 16 /* DotAll */],
11630
+ [117 /* u */, 32 /* Unicode */],
11631
+ [118 /* v */, 64 /* UnicodeSets */],
11632
+ [121 /* y */, 128 /* Sticky */]
11633
+ ]);
11630
11634
  var regExpFlagToFirstAvailableLanguageVersion = /* @__PURE__ */ new Map([
11631
11635
  [1 /* HasIndices */, 9 /* RegularExpressionFlagsHasIndices */],
11632
11636
  [16 /* DotAll */, 5 /* RegularExpressionFlagsDotAll */],
@@ -11682,12 +11686,12 @@ function tokenToString(t) {
11682
11686
  function stringToToken(s) {
11683
11687
  return textToToken.get(s);
11684
11688
  }
11685
- var regExpFlagChars = makeReverseMap(charToRegExpFlag);
11686
- function regularExpressionFlagToCharacter(f) {
11687
- return regExpFlagChars[f];
11689
+ var regExpFlagCharCodes = makeReverseMap(charCodeToRegExpFlag);
11690
+ function regularExpressionFlagToCharacterCode(f) {
11691
+ return regExpFlagCharCodes[f];
11688
11692
  }
11689
- function characterToRegularExpressionFlag(c) {
11690
- return charToRegExpFlag.get(c);
11693
+ function characterCodeToRegularExpressionFlag(ch) {
11694
+ return charCodeToRegExpFlag.get(ch);
11691
11695
  }
11692
11696
  function computeLineStarts(text) {
11693
11697
  const result = [];
@@ -13403,24 +13407,25 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
13403
13407
  pos++;
13404
13408
  let regExpFlags = 0 /* None */;
13405
13409
  while (true) {
13406
- const ch = charCodeChecked(pos);
13410
+ const ch = codePointChecked(pos);
13407
13411
  if (ch === -1 /* EOF */ || !isIdentifierPart(ch, languageVersion)) {
13408
13412
  break;
13409
13413
  }
13414
+ const size = charSize(ch);
13410
13415
  if (reportErrors2) {
13411
- const flag = characterToRegularExpressionFlag(String.fromCharCode(ch));
13416
+ const flag = characterCodeToRegularExpressionFlag(ch);
13412
13417
  if (flag === void 0) {
13413
- error2(Diagnostics.Unknown_regular_expression_flag, pos, 1);
13418
+ error2(Diagnostics.Unknown_regular_expression_flag, pos, size);
13414
13419
  } else if (regExpFlags & flag) {
13415
- error2(Diagnostics.Duplicate_regular_expression_flag, pos, 1);
13420
+ error2(Diagnostics.Duplicate_regular_expression_flag, pos, size);
13416
13421
  } else if (((regExpFlags | flag) & 96 /* AnyUnicodeMode */) === 96 /* AnyUnicodeMode */) {
13417
- error2(Diagnostics.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, pos, 1);
13422
+ error2(Diagnostics.The_Unicode_u_flag_and_the_Unicode_Sets_v_flag_cannot_be_set_simultaneously, pos, size);
13418
13423
  } else {
13419
13424
  regExpFlags |= flag;
13420
- checkRegularExpressionFlagAvailable(flag, pos);
13425
+ checkRegularExpressionFlagAvailability(flag, size);
13421
13426
  }
13422
13427
  }
13423
- pos++;
13428
+ pos += size;
13424
13429
  }
13425
13430
  if (reportErrors2) {
13426
13431
  scanRange(startOfRegExpBody, endOfRegExpBody - startOfRegExpBody, () => {
@@ -13635,22 +13640,23 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
13635
13640
  }
13636
13641
  function scanPatternModifiers(currFlags) {
13637
13642
  while (true) {
13638
- const ch = charCodeChecked(pos);
13643
+ const ch = codePointChecked(pos);
13639
13644
  if (ch === -1 /* EOF */ || !isIdentifierPart(ch, languageVersion)) {
13640
13645
  break;
13641
13646
  }
13642
- const flag = characterToRegularExpressionFlag(String.fromCharCode(ch));
13647
+ const size = charSize(ch);
13648
+ const flag = characterCodeToRegularExpressionFlag(ch);
13643
13649
  if (flag === void 0) {
13644
- error2(Diagnostics.Unknown_regular_expression_flag, pos, 1);
13650
+ error2(Diagnostics.Unknown_regular_expression_flag, pos, size);
13645
13651
  } else if (currFlags & flag) {
13646
- error2(Diagnostics.Duplicate_regular_expression_flag, pos, 1);
13652
+ error2(Diagnostics.Duplicate_regular_expression_flag, pos, size);
13647
13653
  } else if (!(flag & 28 /* Modifiers */)) {
13648
- error2(Diagnostics.This_regular_expression_flag_cannot_be_toggled_within_a_subpattern, pos, 1);
13654
+ error2(Diagnostics.This_regular_expression_flag_cannot_be_toggled_within_a_subpattern, pos, size);
13649
13655
  } else {
13650
13656
  currFlags |= flag;
13651
- checkRegularExpressionFlagAvailable(flag, pos);
13657
+ checkRegularExpressionFlagAvailability(flag, size);
13652
13658
  }
13653
- pos++;
13659
+ pos += size;
13654
13660
  }
13655
13661
  return currFlags;
13656
13662
  }
@@ -14254,6 +14260,12 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
14254
14260
  forEach(groupNameReferences, (reference) => {
14255
14261
  if (!(groupSpecifiers == null ? void 0 : groupSpecifiers.has(reference.name))) {
14256
14262
  error2(Diagnostics.There_is_no_capturing_group_named_0_in_this_regular_expression, reference.pos, reference.end - reference.pos, reference.name);
14263
+ if (groupSpecifiers) {
14264
+ const suggestion = getSpellingSuggestion(reference.name, groupSpecifiers, identity);
14265
+ if (suggestion) {
14266
+ error2(Diagnostics.Did_you_mean_0, reference.pos, reference.end - reference.pos, suggestion);
14267
+ }
14268
+ }
14257
14269
  }
14258
14270
  });
14259
14271
  forEach(decimalEscapes, (escape) => {
@@ -14266,10 +14278,10 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
14266
14278
  }
14267
14279
  });
14268
14280
  }
14269
- function checkRegularExpressionFlagAvailable(flag, pos2) {
14281
+ function checkRegularExpressionFlagAvailability(flag, size) {
14270
14282
  const availableFrom = regExpFlagToFirstAvailableLanguageVersion.get(flag);
14271
14283
  if (availableFrom && languageVersion < availableFrom) {
14272
- error2(Diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, pos2, 1, getNameOfScriptTarget(availableFrom));
14284
+ error2(Diagnostics.This_regular_expression_flag_is_only_available_when_targeting_0_or_later, pos, size, getNameOfScriptTarget(availableFrom));
14273
14285
  }
14274
14286
  }
14275
14287
  function appendIfCommentDirective(commentDirectives2, text2, commentDirectiveRegEx, lineStart) {
@@ -16597,7 +16609,16 @@ function isJSDocTypeExpressionOrChild(node) {
16597
16609
  return !!findAncestor(node, isJSDocTypeExpression);
16598
16610
  }
16599
16611
  function isExportNamespaceAsDefaultDeclaration(node) {
16600
- return !!(isExportDeclaration(node) && node.exportClause && isNamespaceExport(node.exportClause) && node.exportClause.name.escapedText === "default");
16612
+ return !!(isExportDeclaration(node) && node.exportClause && isNamespaceExport(node.exportClause) && moduleExportNameIsDefault(node.exportClause.name));
16613
+ }
16614
+ function moduleExportNameTextUnescaped(node) {
16615
+ return node.kind === 11 /* StringLiteral */ ? node.text : unescapeLeadingUnderscores(node.escapedText);
16616
+ }
16617
+ function moduleExportNameTextEscaped(node) {
16618
+ return node.kind === 11 /* StringLiteral */ ? escapeLeadingUnderscores(node.text) : node.escapedText;
16619
+ }
16620
+ function moduleExportNameIsDefault(node) {
16621
+ return (node.kind === 11 /* StringLiteral */ ? node.text : node.escapedText) === "default" /* Default */;
16601
16622
  }
16602
16623
  function getTextOfNodeFromSourceText(sourceText, node, includeTrivia = false) {
16603
16624
  if (nodeIsMissing(node)) {
@@ -23415,7 +23436,7 @@ function createNameResolver({
23415
23436
  }
23416
23437
  break;
23417
23438
  }
23418
- if (isSelfReferenceLocation(location)) {
23439
+ if (isSelfReferenceLocation(location, lastLocation)) {
23419
23440
  lastSelfReferenceLocation = location;
23420
23441
  }
23421
23442
  lastLocation = location;
@@ -23516,8 +23537,10 @@ function createNameResolver({
23516
23537
  }
23517
23538
  return !getImmediatelyInvokedFunctionExpression(location);
23518
23539
  }
23519
- function isSelfReferenceLocation(node) {
23540
+ function isSelfReferenceLocation(node, lastLocation) {
23520
23541
  switch (node.kind) {
23542
+ case 169 /* Parameter */:
23543
+ return !!lastLocation && lastLocation === node.name;
23521
23544
  case 262 /* FunctionDeclaration */:
23522
23545
  case 263 /* ClassDeclaration */:
23523
23546
  case 264 /* InterfaceDeclaration */:
@@ -23573,12 +23596,6 @@ function unwrapParenthesizedExpression(o) {
23573
23596
  }
23574
23597
  return o;
23575
23598
  }
23576
- function unwrapParenthesizedType(o) {
23577
- while (o.kind === 196 /* ParenthesizedType */) {
23578
- o = o.type;
23579
- }
23580
- return o;
23581
- }
23582
23599
  function hasInferredType(node) {
23583
23600
  Debug.type(node);
23584
23601
  switch (node.kind) {
@@ -30398,6 +30415,9 @@ function isNamedExports(node) {
30398
30415
  function isExportSpecifier(node) {
30399
30416
  return node.kind === 281 /* ExportSpecifier */;
30400
30417
  }
30418
+ function isModuleExportName(node) {
30419
+ return node.kind === 80 /* Identifier */ || node.kind === 11 /* StringLiteral */;
30420
+ }
30401
30421
  function isMissingDeclaration(node) {
30402
30422
  return node.kind === 282 /* MissingDeclaration */;
30403
30423
  }
@@ -31143,6 +31163,9 @@ function getLocalNameForExternalImport(factory2, node, sourceFile) {
31143
31163
  const namespaceDeclaration = getNamespaceDeclarationNode(node);
31144
31164
  if (namespaceDeclaration && !isDefaultImport(node) && !isExportNamespaceAsDefaultDeclaration(node)) {
31145
31165
  const name = namespaceDeclaration.name;
31166
+ if (name.kind === 11 /* StringLiteral */) {
31167
+ return factory2.getGeneratedNameForNode(node);
31168
+ }
31146
31169
  return isGeneratedIdentifier(name) ? name : factory2.createIdentifier(getSourceTextOfNodeFromSourceFile(sourceFile, name) || idText(name));
31147
31170
  }
31148
31171
  if (node.kind === 272 /* ImportDeclaration */ && node.importClause) {
@@ -33505,6 +33528,9 @@ var Parser;
33505
33528
  if (token() === 161 /* FromKeyword */ && lookAhead(nextTokenIsStringLiteral)) {
33506
33529
  return false;
33507
33530
  }
33531
+ if (token() === 11 /* StringLiteral */) {
33532
+ return true;
33533
+ }
33508
33534
  return tokenIsIdentifierOrKeyword(token());
33509
33535
  case 13 /* JsxAttributes */:
33510
33536
  return tokenIsIdentifierOrKeyword(token()) || token() === 19 /* OpenBraceToken */;
@@ -37953,6 +37979,12 @@ var Parser;
37953
37979
  const name = parseIdentifier();
37954
37980
  return finishNode(factory2.createNamespaceImport(name), pos);
37955
37981
  }
37982
+ function canParseModuleExportName() {
37983
+ return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */;
37984
+ }
37985
+ function parseModuleExportName(parseName) {
37986
+ return token() === 11 /* StringLiteral */ ? parseLiteralNode() : parseName();
37987
+ }
37956
37988
  function parseNamedImportsOrExports(kind) {
37957
37989
  const pos = getNodePos();
37958
37990
  const node = kind === 275 /* NamedImports */ ? factory2.createNamedImports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseImportSpecifier, 19 /* OpenBraceToken */, 20 /* CloseBraceToken */)) : factory2.createNamedExports(parseBracketedList(23 /* ImportOrExportSpecifiers */, parseExportSpecifier, 19 /* OpenBraceToken */, 20 /* CloseBraceToken */));
@@ -37973,42 +38005,51 @@ var Parser;
37973
38005
  let isTypeOnly = false;
37974
38006
  let propertyName;
37975
38007
  let canParseAsKeyword = true;
37976
- let name = parseIdentifierName();
37977
- if (name.escapedText === "type") {
38008
+ let name = parseModuleExportName(parseIdentifierName);
38009
+ if (name.kind === 80 /* Identifier */ && name.escapedText === "type") {
37978
38010
  if (token() === 130 /* AsKeyword */) {
37979
38011
  const firstAs = parseIdentifierName();
37980
38012
  if (token() === 130 /* AsKeyword */) {
37981
38013
  const secondAs = parseIdentifierName();
37982
- if (tokenIsIdentifierOrKeyword(token())) {
38014
+ if (canParseModuleExportName()) {
37983
38015
  isTypeOnly = true;
37984
38016
  propertyName = firstAs;
37985
- name = parseNameWithKeywordCheck();
38017
+ name = parseModuleExportName(parseNameWithKeywordCheck);
37986
38018
  canParseAsKeyword = false;
37987
38019
  } else {
37988
38020
  propertyName = name;
37989
38021
  name = secondAs;
37990
38022
  canParseAsKeyword = false;
37991
38023
  }
37992
- } else if (tokenIsIdentifierOrKeyword(token())) {
38024
+ } else if (canParseModuleExportName()) {
37993
38025
  propertyName = name;
37994
38026
  canParseAsKeyword = false;
37995
- name = parseNameWithKeywordCheck();
38027
+ name = parseModuleExportName(parseNameWithKeywordCheck);
37996
38028
  } else {
37997
38029
  isTypeOnly = true;
37998
38030
  name = firstAs;
37999
38031
  }
38000
- } else if (tokenIsIdentifierOrKeyword(token())) {
38032
+ } else if (canParseModuleExportName()) {
38001
38033
  isTypeOnly = true;
38002
- name = parseNameWithKeywordCheck();
38034
+ name = parseModuleExportName(parseNameWithKeywordCheck);
38003
38035
  }
38004
38036
  }
38005
38037
  if (canParseAsKeyword && token() === 130 /* AsKeyword */) {
38006
38038
  propertyName = name;
38007
38039
  parseExpected(130 /* AsKeyword */);
38008
- name = parseNameWithKeywordCheck();
38040
+ name = parseModuleExportName(parseNameWithKeywordCheck);
38009
38041
  }
38010
- if (kind === 276 /* ImportSpecifier */ && checkIdentifierIsKeyword) {
38011
- parseErrorAt(checkIdentifierStart, checkIdentifierEnd, Diagnostics.Identifier_expected);
38042
+ if (kind === 276 /* ImportSpecifier */) {
38043
+ if (name.kind !== 80 /* Identifier */) {
38044
+ parseErrorAt(skipTrivia(sourceText, name.pos), name.end, Diagnostics.Identifier_expected);
38045
+ name = setTextRangePosEnd(createMissingNode(
38046
+ 80 /* Identifier */,
38047
+ /*reportAtCurrentPosition*/
38048
+ false
38049
+ ), name.pos, name.pos);
38050
+ } else if (checkIdentifierIsKeyword) {
38051
+ parseErrorAt(checkIdentifierStart, checkIdentifierEnd, Diagnostics.Identifier_expected);
38052
+ }
38012
38053
  }
38013
38054
  const node = kind === 276 /* ImportSpecifier */ ? factory2.createImportSpecifier(isTypeOnly, propertyName, name) : factory2.createExportSpecifier(isTypeOnly, propertyName, name);
38014
38055
  return finishNode(node, pos);
@@ -38020,7 +38061,7 @@ var Parser;
38020
38061
  }
38021
38062
  }
38022
38063
  function parseNamespaceExport(pos) {
38023
- return finishNode(factory2.createNamespaceExport(parseIdentifierName()), pos);
38064
+ return finishNode(factory2.createNamespaceExport(parseModuleExportName(parseIdentifierName)), pos);
38024
38065
  }
38025
38066
  function parseExportDeclaration(pos, hasJSDoc, modifiers) {
38026
38067
  const savedAwaitContext = inAwaitContext();
@@ -45781,6 +45822,9 @@ function getModuleInstanceStateWorker(node, visited) {
45781
45822
  }
45782
45823
  function getModuleInstanceStateForAliasTarget(specifier, visited) {
45783
45824
  const name = specifier.propertyName || specifier.name;
45825
+ if (name.kind !== 80 /* Identifier */) {
45826
+ return 1 /* Instantiated */;
45827
+ }
45784
45828
  let p = specifier.parent;
45785
45829
  while (p) {
45786
45830
  if (isBlock(p) || isModuleBlock(p) || isSourceFile(p)) {
@@ -46037,7 +46081,7 @@ function createBinder() {
46037
46081
  }
46038
46082
  function declareSymbol(symbolTable, parent3, node, includes, excludes, isReplaceableByMethod, isComputedName) {
46039
46083
  Debug.assert(isComputedName || !hasDynamicName(node));
46040
- const isDefaultExport = hasSyntacticModifier(node, 2048 /* Default */) || isExportSpecifier(node) && node.name.escapedText === "default";
46084
+ const isDefaultExport = hasSyntacticModifier(node, 2048 /* Default */) || isExportSpecifier(node) && moduleExportNameIsDefault(node.name);
46041
46085
  const name = isComputedName ? "__computed" /* Computed */ : isDefaultExport && parent3 ? "default" /* Default */ : getDeclarationName(node);
46042
46086
  let symbol;
46043
46087
  if (name === void 0) {
@@ -49925,7 +49969,8 @@ function createTypeChecker(host) {
49925
49969
  isUndefinedIdentifierExpression(node) {
49926
49970
  Debug.assert(isExpressionNode(node));
49927
49971
  return getSymbolAtLocation(node) === undefinedSymbol;
49928
- }
49972
+ },
49973
+ isDefinitelyReferenceToGlobalSymbolObject
49929
49974
  });
49930
49975
  var evaluate = createEvaluator({
49931
49976
  evaluateElementAccessExpression,
@@ -50882,6 +50927,21 @@ function createTypeChecker(host) {
50882
50927
  ];
50883
50928
  initializeTypeChecker();
50884
50929
  return checker;
50930
+ function isDefinitelyReferenceToGlobalSymbolObject(node) {
50931
+ if (!isPropertyAccessExpression(node)) return false;
50932
+ if (!isIdentifier(node.name)) return false;
50933
+ if (!isPropertyAccessExpression(node.expression) && !isIdentifier(node.expression)) return false;
50934
+ if (isIdentifier(node.expression)) {
50935
+ return idText(node.expression) === "Symbol" && getResolvedSymbol(node.expression) === (getGlobalSymbol(
50936
+ "Symbol",
50937
+ 111551 /* Value */ | 1048576 /* ExportValue */,
50938
+ /*diagnostic*/
50939
+ void 0
50940
+ ) || unknownSymbol);
50941
+ }
50942
+ if (!isIdentifier(node.expression.expression)) return false;
50943
+ return idText(node.expression.name) === "Symbol" && idText(node.expression.expression) === "globalThis" && getResolvedSymbol(node.expression.expression) === globalThisSymbol;
50944
+ }
50885
50945
  function getCachedType(key) {
50886
50946
  return key ? cachedTypes.get(key) : void 0;
50887
50947
  }
@@ -51910,7 +51970,7 @@ function createTypeChecker(host) {
51910
51970
  const isExport = typeOnlyDeclaration.kind === 281 /* ExportSpecifier */ || typeOnlyDeclaration.kind === 278 /* ExportDeclaration */;
51911
51971
  const message = isExport ? Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type : Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type;
51912
51972
  const relatedMessage = isExport ? Diagnostics._0_was_exported_here : Diagnostics._0_was_imported_here;
51913
- const name = typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ ? "*" : unescapeLeadingUnderscores(typeOnlyDeclaration.name.escapedText);
51973
+ const name = typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ ? "*" : moduleExportNameTextUnescaped(typeOnlyDeclaration.name);
51914
51974
  addRelatedInfo(error2(node.moduleReference, message), createDiagnosticForNode(typeOnlyDeclaration, relatedMessage, name));
51915
51975
  }
51916
51976
  }
@@ -52154,12 +52214,12 @@ function createTypeChecker(host) {
52154
52214
  if (valueSymbol.exports) result.exports = new Map(valueSymbol.exports);
52155
52215
  return result;
52156
52216
  }
52157
- function getExportOfModule(symbol, name, specifier, dontResolveAlias) {
52217
+ function getExportOfModule(symbol, nameText, specifier, dontResolveAlias) {
52158
52218
  var _a;
52159
52219
  if (symbol.flags & 1536 /* Module */) {
52160
- const exportSymbol = getExportsOfSymbol(symbol).get(name.escapedText);
52220
+ const exportSymbol = getExportsOfSymbol(symbol).get(nameText);
52161
52221
  const resolved = resolveSymbol(exportSymbol, dontResolveAlias);
52162
- const exportStarDeclaration = (_a = getSymbolLinks(symbol).typeOnlyExportStarMap) == null ? void 0 : _a.get(name.escapedText);
52222
+ const exportStarDeclaration = (_a = getSymbolLinks(symbol).typeOnlyExportStarMap) == null ? void 0 : _a.get(nameText);
52163
52223
  markSymbolOfAliasDeclarationIfTypeOnly(
52164
52224
  specifier,
52165
52225
  exportSymbol,
@@ -52167,7 +52227,7 @@ function createTypeChecker(host) {
52167
52227
  /*overwriteEmpty*/
52168
52228
  false,
52169
52229
  exportStarDeclaration,
52170
- name.escapedText
52230
+ nameText
52171
52231
  );
52172
52232
  return resolved;
52173
52233
  }
@@ -52185,10 +52245,11 @@ function createTypeChecker(host) {
52185
52245
  const moduleSpecifier = getExternalModuleRequireArgument(node) || node.moduleSpecifier;
52186
52246
  const moduleSymbol = resolveExternalModuleName(node, moduleSpecifier);
52187
52247
  const name = !isPropertyAccessExpression(specifier) && specifier.propertyName || specifier.name;
52188
- if (!isIdentifier(name)) {
52248
+ if (!isIdentifier(name) && name.kind !== 11 /* StringLiteral */) {
52189
52249
  return void 0;
52190
52250
  }
52191
- const suppressInteropError = name.escapedText === "default" /* Default */ && allowSyntheticDefaultImports;
52251
+ const nameText = moduleExportNameTextEscaped(name);
52252
+ const suppressInteropError = nameText === "default" /* Default */ && allowSyntheticDefaultImports;
52192
52253
  const targetSymbol = resolveESModuleSymbol(
52193
52254
  moduleSymbol,
52194
52255
  moduleSpecifier,
@@ -52197,7 +52258,7 @@ function createTypeChecker(host) {
52197
52258
  suppressInteropError
52198
52259
  );
52199
52260
  if (targetSymbol) {
52200
- if (name.escapedText) {
52261
+ if (nameText || name.kind === 11 /* StringLiteral */) {
52201
52262
  if (isShorthandAmbientModuleSymbol(moduleSymbol)) {
52202
52263
  return moduleSymbol;
52203
52264
  }
@@ -52205,16 +52266,16 @@ function createTypeChecker(host) {
52205
52266
  if (moduleSymbol && moduleSymbol.exports && moduleSymbol.exports.get("export=" /* ExportEquals */)) {
52206
52267
  symbolFromVariable = getPropertyOfType(
52207
52268
  getTypeOfSymbol(targetSymbol),
52208
- name.escapedText,
52269
+ nameText,
52209
52270
  /*skipObjectFunctionPropertyAugment*/
52210
52271
  true
52211
52272
  );
52212
52273
  } else {
52213
- symbolFromVariable = getPropertyOfVariable(targetSymbol, name.escapedText);
52274
+ symbolFromVariable = getPropertyOfVariable(targetSymbol, nameText);
52214
52275
  }
52215
52276
  symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias);
52216
- let symbolFromModule = getExportOfModule(targetSymbol, name, specifier, dontResolveAlias);
52217
- if (symbolFromModule === void 0 && name.escapedText === "default" /* Default */) {
52277
+ let symbolFromModule = getExportOfModule(targetSymbol, nameText, specifier, dontResolveAlias);
52278
+ if (symbolFromModule === void 0 && nameText === "default" /* Default */) {
52218
52279
  const file = (_a = moduleSymbol.declarations) == null ? void 0 : _a.find(isSourceFile);
52219
52280
  if (isOnlyImportableAsDefault(moduleSpecifier) || canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, moduleSpecifier)) {
52220
52281
  symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
@@ -52232,7 +52293,7 @@ function createTypeChecker(host) {
52232
52293
  var _a;
52233
52294
  const moduleName = getFullyQualifiedName(moduleSymbol, node);
52234
52295
  const declarationName = declarationNameToString(name);
52235
- const suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol);
52296
+ const suggestion = isIdentifier(name) ? getSuggestedSymbolForNonexistentModule(name, targetSymbol) : void 0;
52236
52297
  if (suggestion !== void 0) {
52237
52298
  const suggestionName = symbolToString(suggestion);
52238
52299
  const diagnostic = error2(name, Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName);
@@ -52254,7 +52315,7 @@ function createTypeChecker(host) {
52254
52315
  }
52255
52316
  function reportNonExportedMember(node, name, declarationName, moduleSymbol, moduleName) {
52256
52317
  var _a, _b;
52257
- const localSymbol = (_b = (_a = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _a.locals) == null ? void 0 : _b.get(name.escapedText);
52318
+ const localSymbol = (_b = (_a = tryCast(moduleSymbol.valueDeclaration, canHaveLocals)) == null ? void 0 : _a.locals) == null ? void 0 : _b.get(moduleExportNameTextEscaped(name));
52258
52319
  const exports2 = moduleSymbol.exports;
52259
52320
  if (localSymbol) {
52260
52321
  const exportedEqualsSymbol = exports2 == null ? void 0 : exports2.get("export=" /* ExportEquals */);
@@ -52286,7 +52347,7 @@ function createTypeChecker(host) {
52286
52347
  }
52287
52348
  }
52288
52349
  function getTargetOfImportSpecifier(node, dontResolveAlias) {
52289
- if (isImportSpecifier(node) && idText(node.propertyName || node.name) === "default" /* Default */) {
52350
+ if (isImportSpecifier(node) && moduleExportNameIsDefault(node.propertyName || node.name)) {
52290
52351
  const specifier = getModuleSpecifierForImportOrExport(node);
52291
52352
  const moduleSymbol = specifier && resolveExternalModuleName(node, specifier);
52292
52353
  if (moduleSymbol) {
@@ -52330,19 +52391,23 @@ function createTypeChecker(host) {
52330
52391
  }
52331
52392
  }
52332
52393
  function getTargetOfExportSpecifier(node, meaning, dontResolveAlias) {
52333
- if (idText(node.propertyName || node.name) === "default" /* Default */) {
52394
+ const name = node.propertyName || node.name;
52395
+ if (moduleExportNameIsDefault(name)) {
52334
52396
  const specifier = getModuleSpecifierForImportOrExport(node);
52335
52397
  const moduleSymbol = specifier && resolveExternalModuleName(node, specifier);
52336
52398
  if (moduleSymbol) {
52337
52399
  return getTargetofModuleDefault(moduleSymbol, node, !!dontResolveAlias);
52338
52400
  }
52339
52401
  }
52340
- const resolved = node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node, dontResolveAlias) : resolveEntityName(
52341
- node.propertyName || node.name,
52342
- meaning,
52343
- /*ignoreErrors*/
52344
- false,
52345
- dontResolveAlias
52402
+ const resolved = node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node, dontResolveAlias) : name.kind === 11 /* StringLiteral */ ? void 0 : (
52403
+ // Skip for invalid syntax like this: export { "x" }
52404
+ resolveEntityName(
52405
+ name,
52406
+ meaning,
52407
+ /*ignoreErrors*/
52408
+ false,
52409
+ dontResolveAlias
52410
+ )
52346
52411
  );
52347
52412
  markSymbolOfAliasDeclarationIfTypeOnly(
52348
52413
  node,
@@ -56392,7 +56457,7 @@ function createTypeChecker(host) {
56392
56457
  return enterNewScope(context, node, getParametersInScope(node), getTypeParametersInScope(node));
56393
56458
  }
56394
56459
  function tryVisitSimpleTypeNode(node) {
56395
- const innerNode = unwrapParenthesizedType(node);
56460
+ const innerNode = skipTypeParentheses(node);
56396
56461
  switch (innerNode.kind) {
56397
56462
  case 183 /* TypeReference */:
56398
56463
  return tryVisitTypeReference(innerNode);
@@ -56939,9 +57004,10 @@ function createTypeChecker(host) {
56939
57004
  if (index >= 0) {
56940
57005
  const exportDecl = statements[index];
56941
57006
  const replacements = mapDefined(exportDecl.exportClause.elements, (e) => {
56942
- if (!e.propertyName) {
57007
+ if (!e.propertyName && e.name.kind !== 11 /* StringLiteral */) {
57008
+ const name = e.name;
56943
57009
  const indices = indicesOf(statements);
56944
- const associatedIndices = filter(indices, (i) => nodeHasName(statements[i], e.name));
57010
+ const associatedIndices = filter(indices, (i) => nodeHasName(statements[i], name));
56945
57011
  if (length(associatedIndices) && every(associatedIndices, (i) => canHaveExportModifier(statements[i]))) {
56946
57012
  for (const index2 of associatedIndices) {
56947
57013
  statements[index2] = addExportModifier(statements[index2]);
@@ -57575,7 +57641,7 @@ function createTypeChecker(host) {
57575
57641
  function getSomeTargetNameFromDeclarations(declarations) {
57576
57642
  return firstDefined(declarations, (d) => {
57577
57643
  if (isImportSpecifier(d) || isExportSpecifier(d)) {
57578
- return idText(d.propertyName || d.name);
57644
+ return moduleExportNameTextUnescaped(d.propertyName || d.name);
57579
57645
  }
57580
57646
  if (isBinaryExpression(d) || isExportAssignment(d)) {
57581
57647
  const expression = isExportAssignment(d) ? d.expression : d.right;
@@ -57593,7 +57659,7 @@ function createTypeChecker(host) {
57593
57659
  });
57594
57660
  }
57595
57661
  function serializeAsAlias(symbol, localName, modifierFlags) {
57596
- var _a2, _b, _c, _d, _e, _f;
57662
+ var _a2, _b, _c, _d, _e;
57597
57663
  const node = getDeclarationOfAliasSymbol(symbol);
57598
57664
  if (!node) return Debug.fail();
57599
57665
  const target = getMergedSymbol(getTargetOfAliasDeclaration(
@@ -57791,8 +57857,11 @@ function createTypeChecker(host) {
57791
57857
  }
57792
57858
  case 281 /* ExportSpecifier */:
57793
57859
  const specifier = node.parent.parent.moduleSpecifier;
57794
- if (specifier && ((_f = node.propertyName) == null ? void 0 : _f.escapedText) === "default" /* Default */) {
57795
- verbatimTargetName = "default" /* Default */;
57860
+ if (specifier) {
57861
+ const propertyName = node.propertyName;
57862
+ if (propertyName && moduleExportNameIsDefault(propertyName)) {
57863
+ verbatimTargetName = "default" /* Default */;
57864
+ }
57796
57865
  }
57797
57866
  serializeExportSpecifier(
57798
57867
  unescapeLeadingUnderscores(symbol.escapedName),
@@ -58505,7 +58574,7 @@ function createTypeChecker(host) {
58505
58574
  }
58506
58575
  function collectLinkedAliases(node, setVisibility) {
58507
58576
  let exportSymbol;
58508
- if (node.parent && node.parent.kind === 277 /* ExportAssignment */) {
58577
+ if (node.kind !== 11 /* StringLiteral */ && node.parent && node.parent.kind === 277 /* ExportAssignment */) {
58509
58578
  exportSymbol = resolveName(
58510
58579
  node,
58511
58580
  node,
@@ -74078,9 +74147,10 @@ function createTypeChecker(host) {
74078
74147
  return;
74079
74148
  case 281 /* ExportSpecifier */:
74080
74149
  const exportDeclaration = node.parent.parent;
74081
- if (!node.isTypeOnly && !exportDeclaration.isTypeOnly && !exportDeclaration.moduleSpecifier) {
74150
+ const name = node.propertyName || node.name;
74151
+ if (!node.isTypeOnly && !exportDeclaration.isTypeOnly && !exportDeclaration.moduleSpecifier && name.kind !== 11 /* StringLiteral */) {
74082
74152
  const symbol = resolveEntityName(
74083
- node.propertyName || node.name,
74153
+ name,
74084
74154
  111551 /* Value */,
74085
74155
  /*ignoreErrors*/
74086
74156
  true,
@@ -74374,6 +74444,9 @@ function createTypeChecker(host) {
74374
74444
  function markExportSpecifierAliasReferenced(location) {
74375
74445
  if (!location.parent.parent.moduleSpecifier && !location.isTypeOnly && !location.parent.parent.isTypeOnly) {
74376
74446
  const exportedName = location.propertyName || location.name;
74447
+ if (exportedName.kind === 11 /* StringLiteral */) {
74448
+ return;
74449
+ }
74377
74450
  const symbol = resolveName(
74378
74451
  exportedName,
74379
74452
  exportedName.escapedText,
@@ -74388,7 +74461,7 @@ function createTypeChecker(host) {
74388
74461
  const target = symbol && (symbol.flags & 2097152 /* Alias */ ? resolveAlias(symbol) : symbol);
74389
74462
  if (!target || getSymbolFlags(target) & 111551 /* Value */) {
74390
74463
  markExportAsReferenced(location);
74391
- markIdentifierAliasReferenced(location.propertyName || location.name);
74464
+ markIdentifierAliasReferenced(exportedName);
74392
74465
  }
74393
74466
  }
74394
74467
  return;
@@ -87984,6 +88057,16 @@ function createTypeChecker(host) {
87984
88057
  }
87985
88058
  return true;
87986
88059
  }
88060
+ function checkModuleExportName(name, allowStringLiteral = true) {
88061
+ if (name === void 0 || name.kind !== 11 /* StringLiteral */) {
88062
+ return;
88063
+ }
88064
+ if (!allowStringLiteral) {
88065
+ grammarErrorOnNode(name, Diagnostics.Identifier_expected);
88066
+ } else if (moduleKind === 5 /* ES2015 */ || moduleKind === 6 /* ES2020 */) {
88067
+ grammarErrorOnNode(name, Diagnostics.String_literal_import_and_export_names_are_not_supported_when_the_module_flag_is_set_to_es2015_or_es2020);
88068
+ }
88069
+ }
87987
88070
  function checkAliasSymbol(node) {
87988
88071
  var _a, _b, _c, _d;
87989
88072
  let symbol = getSymbolOfDeclaration(node);
@@ -87995,7 +88078,7 @@ function createTypeChecker(host) {
87995
88078
  Debug.assert(node.kind !== 280 /* NamespaceExport */);
87996
88079
  if (node.kind === 281 /* ExportSpecifier */) {
87997
88080
  const diag2 = error2(errorNode, Diagnostics.Types_cannot_appear_in_export_declarations_in_JavaScript_files);
87998
- const alreadyExportedSymbol = (_b = (_a = getSourceFileOfNode(node).symbol) == null ? void 0 : _a.exports) == null ? void 0 : _b.get((node.propertyName || node.name).escapedText);
88081
+ const alreadyExportedSymbol = (_b = (_a = getSourceFileOfNode(node).symbol) == null ? void 0 : _a.exports) == null ? void 0 : _b.get(moduleExportNameTextEscaped(node.propertyName || node.name));
87999
88082
  if (alreadyExportedSymbol === target) {
88000
88083
  const exportingDeclaration = (_c = alreadyExportedSymbol.declarations) == null ? void 0 : _c.find(isJSDocNode);
88001
88084
  if (exportingDeclaration) {
@@ -88050,7 +88133,7 @@ function createTypeChecker(host) {
88050
88133
  if (compilerOptions.verbatimModuleSyntax) {
88051
88134
  Debug.assertIsDefined(node.name, "An ImportClause with a symbol should have a name");
88052
88135
  const message = compilerOptions.verbatimModuleSyntax && isInternalModuleImportEqualsDeclaration(node) ? Diagnostics.An_import_alias_cannot_resolve_to_a_type_or_type_only_declaration_when_verbatimModuleSyntax_is_enabled : isType ? Diagnostics._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled : Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled;
88053
- const name = idText(node.kind === 276 /* ImportSpecifier */ ? node.propertyName || node.name : node.name);
88136
+ const name = moduleExportNameTextUnescaped(node.kind === 276 /* ImportSpecifier */ ? node.propertyName || node.name : node.name);
88054
88137
  addTypeOnlyDeclarationRelatedInfo(
88055
88138
  error2(node, message, name),
88056
88139
  isType ? void 0 : typeOnlyAlias,
@@ -88064,7 +88147,7 @@ function createTypeChecker(host) {
88064
88147
  }
88065
88148
  case 281 /* ExportSpecifier */: {
88066
88149
  if (compilerOptions.verbatimModuleSyntax || getSourceFileOfNode(typeOnlyAlias) !== getSourceFileOfNode(node)) {
88067
- const name = idText(node.propertyName || node.name);
88150
+ const name = moduleExportNameTextUnescaped(node.propertyName || node.name);
88068
88151
  const diagnostic = isType ? error2(node, Diagnostics.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type, isolatedModulesLikeFlagName) : error2(node, Diagnostics._0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled, name, isolatedModulesLikeFlagName);
88069
88152
  addTypeOnlyDeclarationRelatedInfo(diagnostic, isType ? void 0 : typeOnlyAlias, name);
88070
88153
  break;
@@ -88114,8 +88197,11 @@ function createTypeChecker(host) {
88114
88197
  function checkImportBinding(node) {
88115
88198
  checkCollisionsForDeclarationName(node, node.name);
88116
88199
  checkAliasSymbol(node);
88117
- if (node.kind === 276 /* ImportSpecifier */ && idText(node.propertyName || node.name) === "default" && getESModuleInterop(compilerOptions) && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) < 4 /* System */) {
88118
- checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
88200
+ if (node.kind === 276 /* ImportSpecifier */) {
88201
+ checkModuleExportName(node.propertyName);
88202
+ if (moduleExportNameIsDefault(node.propertyName || node.name) && getESModuleInterop(compilerOptions) && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) < 4 /* System */) {
88203
+ checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
88204
+ }
88119
88205
  }
88120
88206
  }
88121
88207
  function checkImportAttributes(declaration) {
@@ -88236,6 +88322,7 @@ function createTypeChecker(host) {
88236
88322
  error2(node.moduleSpecifier, Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol));
88237
88323
  } else if (node.exportClause) {
88238
88324
  checkAliasSymbol(node.exportClause);
88325
+ checkModuleExportName(node.exportClause.name);
88239
88326
  }
88240
88327
  if (host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) < 4 /* System */) {
88241
88328
  if (node.exportClause) {
@@ -88266,6 +88353,9 @@ function createTypeChecker(host) {
88266
88353
  }
88267
88354
  function checkExportSpecifier(node) {
88268
88355
  checkAliasSymbol(node);
88356
+ const hasModuleSpecifier = node.parent.parent.moduleSpecifier !== void 0;
88357
+ checkModuleExportName(node.propertyName, hasModuleSpecifier);
88358
+ checkModuleExportName(node.name);
88269
88359
  if (getEmitDeclarations(compilerOptions)) {
88270
88360
  collectLinkedAliases(
88271
88361
  node.propertyName || node.name,
@@ -88273,8 +88363,11 @@ function createTypeChecker(host) {
88273
88363
  true
88274
88364
  );
88275
88365
  }
88276
- if (!node.parent.parent.moduleSpecifier) {
88366
+ if (!hasModuleSpecifier) {
88277
88367
  const exportedName = node.propertyName || node.name;
88368
+ if (exportedName.kind === 11 /* StringLiteral */) {
88369
+ return;
88370
+ }
88278
88371
  const symbol = resolveName(
88279
88372
  exportedName,
88280
88373
  exportedName.escapedText,
@@ -88290,7 +88383,7 @@ function createTypeChecker(host) {
88290
88383
  markLinkedReferences(node, 7 /* ExportSpecifier */);
88291
88384
  }
88292
88385
  } else {
88293
- if (getESModuleInterop(compilerOptions) && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) < 4 /* System */ && idText(node.propertyName || node.name) === "default") {
88386
+ if (getESModuleInterop(compilerOptions) && host.getEmitModuleFormatOfFile(getSourceFileOfNode(node)) < 4 /* System */ && moduleExportNameIsDefault(node.propertyName || node.name)) {
88294
88387
  checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
88295
88388
  }
88296
88389
  }
@@ -89445,7 +89538,11 @@ function createTypeChecker(host) {
89445
89538
  }
89446
89539
  function getExportSpecifierLocalTargetSymbol(node) {
89447
89540
  if (isExportSpecifier(node)) {
89448
- return node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node) : resolveEntityName(node.propertyName || node.name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */);
89541
+ const name = node.propertyName || node.name;
89542
+ return node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node) : name.kind === 11 /* StringLiteral */ ? void 0 : (
89543
+ // Skip for invalid syntax like this: export { "x" }
89544
+ resolveEntityName(name, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */)
89545
+ );
89449
89546
  } else {
89450
89547
  return resolveEntityName(node, 111551 /* Value */ | 788968 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */);
89451
89548
  }
@@ -90416,7 +90513,8 @@ function createTypeChecker(host) {
90416
90513
  resolveExternalModuleSymbol(sym);
90417
90514
  return !sym.exports ? [] : nodeBuilder.symbolTableToDeclarationStatements(sym.exports, node, flags, tracker);
90418
90515
  },
90419
- isImportRequiredByAugmentation
90516
+ isImportRequiredByAugmentation,
90517
+ isDefinitelyReferenceToGlobalSymbolObject
90420
90518
  };
90421
90519
  function isImportRequiredByAugmentation(node) {
90422
90520
  const file = getSourceFileOfNode(node);
@@ -92255,7 +92353,7 @@ function isDeclarationNameOrImportPropertyName(name) {
92255
92353
  switch (name.parent.kind) {
92256
92354
  case 276 /* ImportSpecifier */:
92257
92355
  case 281 /* ExportSpecifier */:
92258
- return isIdentifier(name);
92356
+ return isIdentifier(name) || name.kind === 11 /* StringLiteral */;
92259
92357
  default:
92260
92358
  return isDeclarationName(name);
92261
92359
  }
@@ -93500,7 +93598,7 @@ var visitEachChildTable = {
93500
93598
  return context.factory.updateImportSpecifier(
93501
93599
  node,
93502
93600
  node.isTypeOnly,
93503
- nodeVisitor(node.propertyName, visitor, isIdentifier),
93601
+ nodeVisitor(node.propertyName, visitor, isModuleExportName),
93504
93602
  Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier))
93505
93603
  );
93506
93604
  },
@@ -93531,8 +93629,8 @@ var visitEachChildTable = {
93531
93629
  return context.factory.updateExportSpecifier(
93532
93630
  node,
93533
93631
  node.isTypeOnly,
93534
- nodeVisitor(node.propertyName, visitor, isIdentifier),
93535
- Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier))
93632
+ nodeVisitor(node.propertyName, visitor, isModuleExportName),
93633
+ Debug.checkDefined(nodeVisitor(node.name, visitor, isModuleExportName))
93536
93634
  );
93537
93635
  },
93538
93636
  // Module references
@@ -94248,7 +94346,7 @@ function containsDefaultReference(node) {
94248
94346
  return some(node.elements, isNamedDefaultReference);
94249
94347
  }
94250
94348
  function isNamedDefaultReference(e) {
94251
- return e.propertyName !== void 0 ? e.propertyName.escapedText === "default" /* Default */ : e.name.escapedText === "default" /* Default */;
94349
+ return moduleExportNameIsDefault(e.propertyName || e.name);
94252
94350
  }
94253
94351
  function chainBundle(context, transformSourceFile) {
94254
94352
  return transformSourceFileOrBundle;
@@ -94324,9 +94422,10 @@ function collectExternalModuleInfo(context, sourceFile) {
94324
94422
  hasImportDefault || (hasImportDefault = containsDefaultReference(node.exportClause));
94325
94423
  } else {
94326
94424
  const name = node.exportClause.name;
94327
- if (!uniqueExports.get(idText(name))) {
94425
+ const nameText = moduleExportNameTextUnescaped(name);
94426
+ if (!uniqueExports.get(nameText)) {
94328
94427
  multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name);
94329
- uniqueExports.set(idText(name), true);
94428
+ uniqueExports.set(nameText, true);
94330
94429
  exportedNames = append(exportedNames, name);
94331
94430
  }
94332
94431
  hasImportStar = true;
@@ -94384,20 +94483,23 @@ function collectExternalModuleInfo(context, sourceFile) {
94384
94483
  return { externalImports, exportSpecifiers, exportEquals, hasExportStarsToExportValues, exportedBindings, exportedNames, exportedFunctions, externalHelpersImportDeclaration };
94385
94484
  function addExportedNamesForExportDeclaration(node) {
94386
94485
  for (const specifier of cast(node.exportClause, isNamedExports).elements) {
94387
- if (!uniqueExports.get(idText(specifier.name))) {
94486
+ const specifierNameText = moduleExportNameTextUnescaped(specifier.name);
94487
+ if (!uniqueExports.get(specifierNameText)) {
94388
94488
  const name = specifier.propertyName || specifier.name;
94389
- if (!node.moduleSpecifier) {
94390
- exportSpecifiers.add(name, specifier);
94391
- }
94392
- const decl = resolver.getReferencedImportDeclaration(name) || resolver.getReferencedValueDeclaration(name);
94393
- if (decl) {
94394
- if (decl.kind === 262 /* FunctionDeclaration */) {
94395
- addExportedFunctionDeclaration(decl, specifier.name, specifier.name.escapedText === "default" /* Default */);
94396
- continue;
94489
+ if (name.kind !== 11 /* StringLiteral */) {
94490
+ if (!node.moduleSpecifier) {
94491
+ exportSpecifiers.add(name, specifier);
94492
+ }
94493
+ const decl = resolver.getReferencedImportDeclaration(name) || resolver.getReferencedValueDeclaration(name);
94494
+ if (decl) {
94495
+ if (decl.kind === 262 /* FunctionDeclaration */) {
94496
+ addExportedFunctionDeclaration(decl, specifier.name, moduleExportNameIsDefault(specifier.name));
94497
+ continue;
94498
+ }
94499
+ multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(decl), specifier.name);
94397
94500
  }
94398
- multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(decl), specifier.name);
94399
94501
  }
94400
- uniqueExports.set(idText(specifier.name), true);
94502
+ uniqueExports.set(specifierNameText, true);
94401
94503
  exportedNames = append(exportedNames, specifier.name);
94402
94504
  }
94403
94505
  }
@@ -94411,9 +94513,10 @@ function collectExternalModuleInfo(context, sourceFile) {
94411
94513
  }
94412
94514
  } else {
94413
94515
  name ?? (name = node.name);
94414
- if (!uniqueExports.get(idText(name))) {
94516
+ const nameText = moduleExportNameTextUnescaped(name);
94517
+ if (!uniqueExports.get(nameText)) {
94415
94518
  multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name);
94416
- uniqueExports.set(idText(name), true);
94519
+ uniqueExports.set(nameText, true);
94417
94520
  }
94418
94521
  }
94419
94522
  }
@@ -111700,7 +111803,7 @@ function transformModule(context) {
111700
111803
  factory2.createExpressionStatement(
111701
111804
  reduceLeft(
111702
111805
  currentModuleInfo.exportedNames.slice(i, i + chunkSize),
111703
- (prev, nextId) => factory2.createAssignment(factory2.createPropertyAccessExpression(factory2.createIdentifier("exports"), factory2.createIdentifier(idText(nextId))), prev),
111806
+ (prev, nextId) => nextId.kind === 11 /* StringLiteral */ ? factory2.createAssignment(factory2.createElementAccessExpression(factory2.createIdentifier("exports"), factory2.createStringLiteral(nextId.text)), prev) : factory2.createAssignment(factory2.createPropertyAccessExpression(factory2.createIdentifier("exports"), factory2.createIdentifier(idText(nextId))), prev),
111704
111807
  factory2.createVoidZero()
111705
111808
  )
111706
111809
  )
@@ -112023,7 +112126,10 @@ function transformModule(context) {
112023
112126
  append(statements, createUnderscoreUnderscoreESModule());
112024
112127
  }
112025
112128
  if (some(currentModuleInfo.exportedNames)) {
112026
- append(statements, factory2.createExpressionStatement(reduceLeft(currentModuleInfo.exportedNames, (prev, nextId) => factory2.createAssignment(factory2.createPropertyAccessExpression(factory2.createIdentifier("exports"), factory2.createIdentifier(idText(nextId))), prev), factory2.createVoidZero())));
112129
+ append(
112130
+ statements,
112131
+ factory2.createExpressionStatement(reduceLeft(currentModuleInfo.exportedNames, (prev, nextId) => nextId.kind === 11 /* StringLiteral */ ? factory2.createAssignment(factory2.createElementAccessExpression(factory2.createIdentifier("exports"), factory2.createStringLiteral(nextId.text)), prev) : factory2.createAssignment(factory2.createPropertyAccessExpression(factory2.createIdentifier("exports"), factory2.createIdentifier(idText(nextId))), prev), factory2.createVoidZero()))
112132
+ );
112027
112133
  }
112028
112134
  for (const f of currentModuleInfo.exportedFunctions) {
112029
112135
  appendExportsOfHoistedDeclaration(statements, f);
@@ -112894,17 +113000,16 @@ function transformModule(context) {
112894
113000
  );
112895
113001
  }
112896
113002
  for (const specifier of node.exportClause.elements) {
112897
- const exportNeedsImportDefault = !!getESModuleInterop(compilerOptions) && !(getInternalEmitFlags(node) & 2 /* NeverApplyImportHelper */) && idText(specifier.propertyName || specifier.name) === "default";
112898
- const exportedValue = factory2.createPropertyAccessExpression(
112899
- exportNeedsImportDefault ? emitHelpers().createImportDefaultHelper(generatedName) : generatedName,
112900
- specifier.propertyName || specifier.name
112901
- );
113003
+ const specifierName = specifier.propertyName || specifier.name;
113004
+ const exportNeedsImportDefault = !!getESModuleInterop(compilerOptions) && !(getInternalEmitFlags(node) & 2 /* NeverApplyImportHelper */) && moduleExportNameIsDefault(specifierName);
113005
+ const target = exportNeedsImportDefault ? emitHelpers().createImportDefaultHelper(generatedName) : generatedName;
113006
+ const exportedValue = specifierName.kind === 11 /* StringLiteral */ ? factory2.createElementAccessExpression(target, specifierName) : factory2.createPropertyAccessExpression(target, specifierName);
112902
113007
  statements.push(
112903
113008
  setOriginalNode(
112904
113009
  setTextRange(
112905
113010
  factory2.createExpressionStatement(
112906
113011
  createExportExpression(
112907
- factory2.getExportName(specifier),
113012
+ specifier.name.kind === 11 /* StringLiteral */ ? factory2.cloneNode(specifier.name) : factory2.getExportName(specifier),
112908
113013
  exportedValue,
112909
113014
  /*location*/
112910
113015
  void 0,
@@ -112929,7 +113034,7 @@ function transformModule(context) {
112929
113034
  factory2.cloneNode(node.exportClause.name),
112930
113035
  getHelperExpressionForExport(
112931
113036
  node,
112932
- moduleKind !== 2 /* AMD */ ? createRequireCall2(node) : isExportNamespaceAsDefaultDeclaration(node) ? generatedName : factory2.createIdentifier(idText(node.exportClause.name))
113037
+ moduleKind !== 2 /* AMD */ ? createRequireCall2(node) : isExportNamespaceAsDefaultDeclaration(node) ? generatedName : node.exportClause.name.kind === 11 /* StringLiteral */ ? generatedName : factory2.createIdentifier(idText(node.exportClause.name))
112933
113038
  )
112934
113039
  )
112935
113040
  ),
@@ -113259,10 +113364,13 @@ function transformModule(context) {
113259
113364
  return statements;
113260
113365
  }
113261
113366
  function appendExportStatement(statements, seen, exportName, expression, location, allowComments, liveBinding) {
113262
- if (!seen.has(exportName)) {
113367
+ if (exportName.kind !== 11 /* StringLiteral */) {
113368
+ if (seen.has(exportName)) {
113369
+ return statements;
113370
+ }
113263
113371
  seen.set(exportName, true);
113264
- statements = append(statements, createExportStatement(exportName, expression, location, allowComments, liveBinding));
113265
113372
  }
113373
+ statements = append(statements, createExportStatement(exportName, expression, location, allowComments, liveBinding));
113266
113374
  return statements;
113267
113375
  }
113268
113376
  function createUnderscoreUnderscoreESModule() {
@@ -113332,7 +113440,10 @@ function transformModule(context) {
113332
113440
  ])
113333
113441
  ]
113334
113442
  ) : factory2.createAssignment(
113335
- factory2.createPropertyAccessExpression(
113443
+ name.kind === 11 /* StringLiteral */ ? factory2.createElementAccessExpression(
113444
+ factory2.createIdentifier("exports"),
113445
+ factory2.cloneNode(name)
113446
+ ) : factory2.createPropertyAccessExpression(
113336
113447
  factory2.createIdentifier("exports"),
113337
113448
  factory2.cloneNode(name)
113338
113449
  ),
@@ -113468,11 +113579,9 @@ function transformModule(context) {
113468
113579
  );
113469
113580
  } else if (isImportSpecifier(importDeclaration)) {
113470
113581
  const name = importDeclaration.propertyName || importDeclaration.name;
113582
+ const target = factory2.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.parent) || importDeclaration);
113471
113583
  return setTextRange(
113472
- factory2.createPropertyAccessExpression(
113473
- factory2.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.parent) || importDeclaration),
113474
- factory2.cloneNode(name)
113475
- ),
113584
+ name.kind === 11 /* StringLiteral */ ? factory2.createElementAccessExpression(target, factory2.cloneNode(name)) : factory2.createPropertyAccessExpression(target, factory2.cloneNode(name)),
113476
113585
  /*location*/
113477
113586
  node
113478
113587
  );
@@ -113760,7 +113869,7 @@ function transformSystemModule(context) {
113760
113869
  const exportedNames = [];
113761
113870
  if (moduleInfo.exportedNames) {
113762
113871
  for (const exportedLocalName of moduleInfo.exportedNames) {
113763
- if (exportedLocalName.escapedText === "default") {
113872
+ if (moduleExportNameIsDefault(exportedLocalName)) {
113764
113873
  continue;
113765
113874
  }
113766
113875
  exportedNames.push(
@@ -113938,10 +114047,10 @@ function transformSystemModule(context) {
113938
114047
  for (const e of entry.exportClause.elements) {
113939
114048
  properties.push(
113940
114049
  factory2.createPropertyAssignment(
113941
- factory2.createStringLiteral(idText(e.name)),
114050
+ factory2.createStringLiteral(moduleExportNameTextUnescaped(e.name)),
113942
114051
  factory2.createElementAccessExpression(
113943
114052
  parameterName,
113944
- factory2.createStringLiteral(idText(e.propertyName || e.name))
114053
+ factory2.createStringLiteral(moduleExportNameTextUnescaped(e.propertyName || e.name))
113945
114054
  )
113946
114055
  )
113947
114056
  );
@@ -113968,7 +114077,7 @@ function transformSystemModule(context) {
113968
114077
  /*typeArguments*/
113969
114078
  void 0,
113970
114079
  [
113971
- factory2.createStringLiteral(idText(entry.exportClause.name)),
114080
+ factory2.createStringLiteral(moduleExportNameTextUnescaped(entry.exportClause.name)),
113972
114081
  parameterName
113973
114082
  ]
113974
114083
  )
@@ -114308,7 +114417,7 @@ function transformSystemModule(context) {
114308
114417
  const exportSpecifiers = moduleInfo.exportSpecifiers.get(name);
114309
114418
  if (exportSpecifiers) {
114310
114419
  for (const exportSpecifier of exportSpecifiers) {
114311
- if (exportSpecifier.name.escapedText !== excludeName) {
114420
+ if (moduleExportNameTextUnescaped(exportSpecifier.name) !== excludeName) {
114312
114421
  statements = appendExportStatement(statements, exportSpecifier.name, name);
114313
114422
  }
114314
114423
  }
@@ -114729,13 +114838,12 @@ function transformSystemModule(context) {
114729
114838
  node
114730
114839
  );
114731
114840
  } else if (isImportSpecifier(importDeclaration)) {
114841
+ const importedName = importDeclaration.propertyName || importDeclaration.name;
114842
+ const target = factory2.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.parent) || importDeclaration);
114732
114843
  return setTextRange(
114733
114844
  factory2.createPropertyAssignment(
114734
114845
  factory2.cloneNode(name),
114735
- factory2.createPropertyAccessExpression(
114736
- factory2.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.parent) || importDeclaration),
114737
- factory2.cloneNode(importDeclaration.propertyName || importDeclaration.name)
114738
- )
114846
+ importedName.kind === 11 /* StringLiteral */ ? factory2.createElementAccessExpression(target, factory2.cloneNode(importedName)) : factory2.createPropertyAccessExpression(target, factory2.cloneNode(importedName))
114739
114847
  ),
114740
114848
  /*location*/
114741
114849
  node
@@ -114778,11 +114886,10 @@ function transformSystemModule(context) {
114778
114886
  node
114779
114887
  );
114780
114888
  } else if (isImportSpecifier(importDeclaration)) {
114889
+ const importedName = importDeclaration.propertyName || importDeclaration.name;
114890
+ const target = factory2.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.parent) || importDeclaration);
114781
114891
  return setTextRange(
114782
- factory2.createPropertyAccessExpression(
114783
- factory2.getGeneratedNameForNode(((_b = (_a = importDeclaration.parent) == null ? void 0 : _a.parent) == null ? void 0 : _b.parent) || importDeclaration),
114784
- factory2.cloneNode(importDeclaration.propertyName || importDeclaration.name)
114785
- ),
114892
+ importedName.kind === 11 /* StringLiteral */ ? factory2.createElementAccessExpression(target, factory2.cloneNode(importedName)) : factory2.createPropertyAccessExpression(target, factory2.cloneNode(importedName)),
114786
114893
  /*location*/
114787
114894
  node
114788
114895
  );
@@ -116373,15 +116480,17 @@ function transformDeclarations(context) {
116373
116480
  if (isDeclarationAndNotVisible(input)) return;
116374
116481
  if (hasDynamicName(input)) {
116375
116482
  if (isolatedDeclarations) {
116376
- if (isClassDeclaration(input.parent) || isObjectLiteralExpression(input.parent)) {
116377
- context.addDiagnostic(createDiagnosticForNode(input, Diagnostics.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations));
116378
- return;
116379
- } else if (
116380
- // Type declarations just need to double-check that the input computed name is an entity name expression
116381
- (isInterfaceDeclaration(input.parent) || isTypeLiteralNode(input.parent)) && !isEntityNameExpression(input.name.expression)
116382
- ) {
116383
- context.addDiagnostic(createDiagnosticForNode(input, Diagnostics.Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations));
116384
- return;
116483
+ if (!resolver.isDefinitelyReferenceToGlobalSymbolObject(input.name.expression)) {
116484
+ if (isClassDeclaration(input.parent) || isObjectLiteralExpression(input.parent)) {
116485
+ context.addDiagnostic(createDiagnosticForNode(input, Diagnostics.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations));
116486
+ return;
116487
+ } else if (
116488
+ // Type declarations just need to double-check that the input computed name is an entity name expression
116489
+ (isInterfaceDeclaration(input.parent) || isTypeLiteralNode(input.parent)) && !isEntityNameExpression(input.name.expression)
116490
+ ) {
116491
+ context.addDiagnostic(createDiagnosticForNode(input, Diagnostics.Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations));
116492
+ return;
116493
+ }
116385
116494
  }
116386
116495
  } else if (!resolver.isLateBound(getParseTreeNode(input)) || !isEntityNameExpression(input.name.expression)) {
116387
116496
  return;
@@ -118008,10 +118117,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
118008
118117
  emitSkipped = true;
118009
118118
  return;
118010
118119
  }
118011
- const buildInfo = host.getBuildInfo() || createBuildInfo(
118012
- /*program*/
118013
- void 0
118014
- );
118120
+ const buildInfo = host.getBuildInfo() || { version };
118015
118121
  writeFile(
118016
118122
  host,
118017
118123
  emitterDiagnostics,
@@ -118294,9 +118400,6 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
118294
118400
  return encodeURI(sourceMapFile);
118295
118401
  }
118296
118402
  }
118297
- function createBuildInfo(program) {
118298
- return { program, version };
118299
- }
118300
118403
  function getBuildInfoText(buildInfo) {
118301
118404
  return JSON.stringify(buildInfo);
118302
118405
  }
@@ -118341,7 +118444,8 @@ var notImplementedResolver = {
118341
118444
  getJsxFragmentFactoryEntity: notImplemented,
118342
118445
  isBindingCapturedByNode: notImplemented,
118343
118446
  getDeclarationStatementsForSourceFile: notImplemented,
118344
- isImportRequiredByAugmentation: notImplemented
118447
+ isImportRequiredByAugmentation: notImplemented,
118448
+ isDefinitelyReferenceToGlobalSymbolObject: notImplemented
118345
118449
  };
118346
118450
  var createPrinterWithDefaults = /* @__PURE__ */ memoize(() => createPrinter({}));
118347
118451
  var createPrinterWithRemoveComments = /* @__PURE__ */ memoize(() => createPrinter({ removeComments: true }));
@@ -123082,7 +123186,7 @@ function isIgnoredFileFromWildCardWatching({
123082
123186
  }
123083
123187
  return false;
123084
123188
  function hasSourceFile(file) {
123085
- return realProgram ? !!realProgram.getSourceFileByPath(file) : builderProgram ? builderProgram.getState().fileInfos.has(file) : !!find(program, (rootFile) => toPath3(rootFile) === file);
123189
+ return realProgram ? !!realProgram.getSourceFileByPath(file) : builderProgram ? builderProgram.state.fileInfos.has(file) : !!find(program, (rootFile) => toPath3(rootFile) === file);
123086
123190
  }
123087
123191
  function isSupportedScriptKind() {
123088
123192
  if (!getScriptKind2) return false;
@@ -123103,9 +123207,6 @@ function isIgnoredFileFromWildCardWatching({
123103
123207
  }
123104
123208
  }
123105
123209
  }
123106
- function isBuilderProgram(program) {
123107
- return !!program.getState;
123108
- }
123109
123210
  function isEmittedFileOfProgram(program, file) {
123110
123211
  if (!program) {
123111
123212
  return false;
@@ -127729,6 +127830,13 @@ var BuilderFileEmit = /* @__PURE__ */ ((BuilderFileEmit2) => {
127729
127830
  BuilderFileEmit2[BuilderFileEmit2["All"] = 31] = "All";
127730
127831
  return BuilderFileEmit2;
127731
127832
  })(BuilderFileEmit || {});
127833
+ function isBuilderProgramStateWithDefinedProgram(state) {
127834
+ return state.program !== void 0;
127835
+ }
127836
+ function toBuilderProgramStateWithDefinedProgram(state) {
127837
+ Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
127838
+ return state;
127839
+ }
127732
127840
  function getBuilderFileEmit(options) {
127733
127841
  let result = 1 /* Js */;
127734
127842
  if (options.sourceMap) result = result | 2 /* JsMap */;
@@ -127993,7 +128101,11 @@ function getNextAffectedFile(state, cancellationToken, host) {
127993
128101
  const affectedFile = affectedFiles[affectedFilesIndex];
127994
128102
  if (!seenAffectedFiles.has(affectedFile.resolvedPath)) {
127995
128103
  state.affectedFilesIndex = affectedFilesIndex;
127996
- addToAffectedFilesPendingEmit(state, affectedFile.resolvedPath, getBuilderFileEmit(state.compilerOptions));
128104
+ addToAffectedFilesPendingEmit(
128105
+ state,
128106
+ affectedFile.resolvedPath,
128107
+ getBuilderFileEmit(state.compilerOptions)
128108
+ );
127997
128109
  handleDtsMayChangeOfAffectedFile(
127998
128110
  state,
127999
128111
  affectedFile,
@@ -128013,12 +128125,11 @@ function getNextAffectedFile(state, cancellationToken, host) {
128013
128125
  if (nextKey.done) {
128014
128126
  return void 0;
128015
128127
  }
128016
- const program = Debug.checkDefined(state.program);
128017
- const compilerOptions = program.getCompilerOptions();
128018
- if (compilerOptions.outFile) return program;
128128
+ const compilerOptions = state.program.getCompilerOptions();
128129
+ if (compilerOptions.outFile) return state.program;
128019
128130
  state.affectedFiles = BuilderState.getFilesAffectedByWithOldState(
128020
128131
  state,
128021
- program,
128132
+ state.program,
128022
128133
  nextKey.value,
128023
128134
  cancellationToken,
128024
128135
  host
@@ -128079,9 +128190,8 @@ function getNextPendingEmitDiagnosticsFile(state) {
128079
128190
  function removeDiagnosticsOfLibraryFiles(state) {
128080
128191
  if (!state.cleanedDiagnosticsOfLibFiles) {
128081
128192
  state.cleanedDiagnosticsOfLibFiles = true;
128082
- const program = Debug.checkDefined(state.program);
128083
- const options = program.getCompilerOptions();
128084
- forEach(program.getSourceFiles(), (f) => program.isSourceFileDefaultLibrary(f) && !skipTypeChecking(f, options, program) && removeSemanticDiagnosticsOf(state, f.resolvedPath));
128193
+ const options = state.program.getCompilerOptions();
128194
+ forEach(state.program.getSourceFiles(), (f) => state.program.isSourceFileDefaultLibrary(f) && !skipTypeChecking(f, options, state.program) && removeSemanticDiagnosticsOf(state, f.resolvedPath));
128085
128195
  }
128086
128196
  }
128087
128197
  function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken, host) {
@@ -128090,7 +128200,7 @@ function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken
128090
128200
  removeDiagnosticsOfLibraryFiles(state);
128091
128201
  BuilderState.updateShapeSignature(
128092
128202
  state,
128093
- Debug.checkDefined(state.program),
128203
+ state.program,
128094
128204
  affectedFile,
128095
128205
  cancellationToken,
128096
128206
  host
@@ -128108,12 +128218,11 @@ function handleDtsMayChangeOfAffectedFile(state, affectedFile, cancellationToken
128108
128218
  function handleDtsMayChangeOf(state, path, invalidateJsFiles, cancellationToken, host) {
128109
128219
  removeSemanticDiagnosticsOf(state, path);
128110
128220
  if (!state.changedFilesSet.has(path)) {
128111
- const program = Debug.checkDefined(state.program);
128112
- const sourceFile = program.getSourceFileByPath(path);
128221
+ const sourceFile = state.program.getSourceFileByPath(path);
128113
128222
  if (sourceFile) {
128114
128223
  BuilderState.updateShapeSignature(
128115
128224
  state,
128116
- program,
128225
+ state.program,
128117
128226
  sourceFile,
128118
128227
  cancellationToken,
128119
128228
  host,
@@ -128121,9 +128230,17 @@ function handleDtsMayChangeOf(state, path, invalidateJsFiles, cancellationToken,
128121
128230
  true
128122
128231
  );
128123
128232
  if (invalidateJsFiles) {
128124
- addToAffectedFilesPendingEmit(state, path, getBuilderFileEmit(state.compilerOptions));
128233
+ addToAffectedFilesPendingEmit(
128234
+ state,
128235
+ path,
128236
+ getBuilderFileEmit(state.compilerOptions)
128237
+ );
128125
128238
  } else if (getEmitDeclarations(state.compilerOptions)) {
128126
- addToAffectedFilesPendingEmit(state, path, state.compilerOptions.declarationMap ? 24 /* AllDts */ : 8 /* Dts */);
128239
+ addToAffectedFilesPendingEmit(
128240
+ state,
128241
+ path,
128242
+ state.compilerOptions.declarationMap ? 24 /* AllDts */ : 8 /* Dts */
128243
+ );
128127
128244
  }
128128
128245
  }
128129
128246
  }
@@ -128190,7 +128307,7 @@ function handleDtsMayChangeOfReferencingExportOfAffectedFile(state, affectedFile
128190
128307
  host
128191
128308
  );
128192
128309
  if (isChangedSignature(state, currentPath)) {
128193
- const currentSourceFile = Debug.checkDefined(state.program).getSourceFileByPath(currentPath);
128310
+ const currentSourceFile = state.program.getSourceFileByPath(currentPath);
128194
128311
  queue.push(...BuilderState.getReferencedByPaths(state, currentSourceFile.resolvedPath));
128195
128312
  }
128196
128313
  }
@@ -128239,7 +128356,7 @@ function handleDtsMayChangeOfFileAndExportsOfFile(state, filePath, invalidateJsF
128239
128356
  function getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile) {
128240
128357
  return concatenate(
128241
128358
  getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile),
128242
- Debug.checkDefined(state.program).getProgramDiagnostics(sourceFile)
128359
+ state.program.getProgramDiagnostics(sourceFile)
128243
128360
  );
128244
128361
  }
128245
128362
  function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationToken, semanticDiagnosticsPerFile) {
@@ -128249,17 +128366,20 @@ function getBinderAndCheckerDiagnosticsOfFile(state, sourceFile, cancellationTok
128249
128366
  if (cachedDiagnostics) {
128250
128367
  return filterSemanticDiagnostics(cachedDiagnostics, state.compilerOptions);
128251
128368
  }
128252
- const diagnostics = Debug.checkDefined(state.program).getBindAndCheckDiagnostics(sourceFile, cancellationToken);
128369
+ const diagnostics = state.program.getBindAndCheckDiagnostics(sourceFile, cancellationToken);
128253
128370
  semanticDiagnosticsPerFile.set(path, diagnostics);
128254
128371
  return filterSemanticDiagnostics(diagnostics, state.compilerOptions);
128255
128372
  }
128256
- function isProgramBundleEmitBuildInfo(info) {
128373
+ function isIncrementalBundleEmitBuildInfo(info) {
128257
128374
  var _a;
128258
128375
  return !!((_a = info.options) == null ? void 0 : _a.outFile);
128259
128376
  }
128377
+ function isIncrementalBuildInfo(info) {
128378
+ return !!info.fileNames;
128379
+ }
128260
128380
  function getBuildInfo2(state) {
128261
128381
  var _a, _b;
128262
- const currentDirectory = Debug.checkDefined(state.program).getCurrentDirectory();
128382
+ const currentDirectory = state.program.getCurrentDirectory();
128263
128383
  const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions), currentDirectory));
128264
128384
  const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : void 0;
128265
128385
  const fileNames = [];
@@ -128272,14 +128392,14 @@ function getBuildInfo2(state) {
128272
128392
  tryAddRoot(key, fileId);
128273
128393
  return value.impliedFormat ? { version: value.version, impliedFormat: value.impliedFormat, signature: void 0, affectsGlobalScope: void 0 } : value.version;
128274
128394
  });
128275
- const program2 = {
128395
+ return {
128276
128396
  fileNames,
128277
128397
  fileInfos: fileInfos2,
128278
128398
  root,
128279
128399
  resolvedRoot: toResolvedRoot(),
128280
- options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions),
128281
- semanticDiagnosticsPerFile: convertToProgramBuildInfoDiagnostics(),
128282
- emitDiagnosticsPerFile: convertToProgramBuildInfoEmitDiagnostics(),
128400
+ options: toIncrementalBuildInfoCompilerOptions(state.compilerOptions),
128401
+ semanticDiagnosticsPerFile: toIncrementalBuildInfoDiagnostics(),
128402
+ emitDiagnosticsPerFile: toIncrementalBuildInfoEmitDiagnostics(),
128283
128403
  changeFileSet: toChangeFileSet(),
128284
128404
  outSignature: state.outSignature,
128285
128405
  latestChangedDtsFile,
@@ -128289,10 +128409,10 @@ function getBuildInfo2(state) {
128289
128409
  // Pending emit is same as deteremined by compilerOptions
128290
128410
  state.programEmitPending
128291
128411
  )
128292
- )
128412
+ ),
128293
128413
  // Actual value
128414
+ version
128294
128415
  };
128295
- return createBuildInfo(program2);
128296
128416
  }
128297
128417
  let fileIdsList;
128298
128418
  let fileNamesToFileIdListId;
@@ -128347,7 +128467,7 @@ function getBuildInfo2(state) {
128347
128467
  toFileIdListId(state.referencedMap.getValues(key))
128348
128468
  ]);
128349
128469
  }
128350
- const semanticDiagnosticsPerFile = convertToProgramBuildInfoDiagnostics();
128470
+ const semanticDiagnosticsPerFile = toIncrementalBuildInfoDiagnostics();
128351
128471
  let affectedFilesPendingEmit;
128352
128472
  if ((_b = state.affectedFilesPendingEmit) == null ? void 0 : _b.size) {
128353
128473
  const fullEmitForOptions = getBuilderFileEmit(state.compilerOptions);
@@ -128371,22 +128491,22 @@ function getBuildInfo2(state) {
128371
128491
  }
128372
128492
  }
128373
128493
  }
128374
- const program = {
128494
+ return {
128375
128495
  fileNames,
128496
+ fileIdsList,
128376
128497
  fileInfos,
128377
128498
  root,
128378
128499
  resolvedRoot: toResolvedRoot(),
128379
- options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions),
128380
- fileIdsList,
128500
+ options: toIncrementalBuildInfoCompilerOptions(state.compilerOptions),
128381
128501
  referencedMap,
128382
128502
  semanticDiagnosticsPerFile,
128383
- emitDiagnosticsPerFile: convertToProgramBuildInfoEmitDiagnostics(),
128503
+ emitDiagnosticsPerFile: toIncrementalBuildInfoEmitDiagnostics(),
128384
128504
  affectedFilesPendingEmit,
128385
128505
  changeFileSet: toChangeFileSet(),
128386
128506
  emitSignatures,
128387
- latestChangedDtsFile
128507
+ latestChangedDtsFile,
128508
+ version
128388
128509
  };
128389
- return createBuildInfo(program);
128390
128510
  function relativeToBuildInfoEnsuringAbsolutePath(path) {
128391
128511
  return relativeToBuildInfo(getNormalizedAbsolutePath(path, currentDirectory));
128392
128512
  }
@@ -128434,13 +128554,13 @@ function getBuildInfo2(state) {
128434
128554
  });
128435
128555
  return result;
128436
128556
  }
128437
- function convertToProgramBuildInfoCompilerOptions(options) {
128557
+ function toIncrementalBuildInfoCompilerOptions(options) {
128438
128558
  let result;
128439
128559
  const { optionsNameMap } = getOptionsNameMap();
128440
128560
  for (const name of getOwnKeys(options).sort(compareStringsCaseSensitive)) {
128441
128561
  const optionInfo = optionsNameMap.get(name.toLowerCase());
128442
128562
  if (optionInfo == null ? void 0 : optionInfo.affectsBuildInfo) {
128443
- (result || (result = {}))[name] = convertToReusableCompilerOptionValue(
128563
+ (result || (result = {}))[name] = toReusableCompilerOptionValue(
128444
128564
  optionInfo,
128445
128565
  options[name]
128446
128566
  );
@@ -128448,7 +128568,7 @@ function getBuildInfo2(state) {
128448
128568
  }
128449
128569
  return result;
128450
128570
  }
128451
- function convertToReusableCompilerOptionValue(option, value) {
128571
+ function toReusableCompilerOptionValue(option, value) {
128452
128572
  if (option) {
128453
128573
  Debug.assert(option.type !== "listOrElement");
128454
128574
  if (option.type === "list") {
@@ -128462,7 +128582,7 @@ function getBuildInfo2(state) {
128462
128582
  }
128463
128583
  return value;
128464
128584
  }
128465
- function convertToProgramBuildInfoDiagnostics() {
128585
+ function toIncrementalBuildInfoDiagnostics() {
128466
128586
  let result;
128467
128587
  state.fileInfos.forEach((_value, key) => {
128468
128588
  const value = state.semanticDiagnosticsPerFile.get(key);
@@ -128471,13 +128591,13 @@ function getBuildInfo2(state) {
128471
128591
  } else if (value.length) {
128472
128592
  result = append(result, [
128473
128593
  toFileId(key),
128474
- convertToReusableDiagnostics(value, key)
128594
+ toReusableDiagnostic(value, key)
128475
128595
  ]);
128476
128596
  }
128477
128597
  });
128478
128598
  return result;
128479
128599
  }
128480
- function convertToProgramBuildInfoEmitDiagnostics() {
128600
+ function toIncrementalBuildInfoEmitDiagnostics() {
128481
128601
  var _a2;
128482
128602
  let result;
128483
128603
  if (!((_a2 = state.emitDiagnosticsPerFile) == null ? void 0 : _a2.size)) return result;
@@ -128485,51 +128605,51 @@ function getBuildInfo2(state) {
128485
128605
  const value = state.emitDiagnosticsPerFile.get(key);
128486
128606
  result = append(result, [
128487
128607
  toFileId(key),
128488
- convertToReusableDiagnostics(value, key)
128608
+ toReusableDiagnostic(value, key)
128489
128609
  ]);
128490
128610
  }
128491
128611
  return result;
128492
128612
  }
128493
- function convertToReusableDiagnostics(diagnostics, diagnosticFilePath) {
128613
+ function toReusableDiagnostic(diagnostics, diagnosticFilePath) {
128494
128614
  Debug.assert(!!diagnostics.length);
128495
128615
  return diagnostics.map((diagnostic) => {
128496
- const result = convertToReusableDiagnosticRelatedInformation(diagnostic, diagnosticFilePath);
128616
+ const result = toReusableDiagnosticRelatedInformation(diagnostic, diagnosticFilePath);
128497
128617
  result.reportsUnnecessary = diagnostic.reportsUnnecessary;
128498
128618
  result.reportDeprecated = diagnostic.reportsDeprecated;
128499
128619
  result.source = diagnostic.source;
128500
128620
  result.skippedOn = diagnostic.skippedOn;
128501
128621
  const { relatedInformation } = diagnostic;
128502
- result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map((r) => convertToReusableDiagnosticRelatedInformation(r, diagnosticFilePath)) : [] : void 0;
128622
+ result.relatedInformation = relatedInformation ? relatedInformation.length ? relatedInformation.map((r) => toReusableDiagnosticRelatedInformation(r, diagnosticFilePath)) : [] : void 0;
128503
128623
  return result;
128504
128624
  });
128505
128625
  }
128506
- function convertToReusableDiagnosticRelatedInformation(diagnostic, diagnosticFilePath) {
128626
+ function toReusableDiagnosticRelatedInformation(diagnostic, diagnosticFilePath) {
128507
128627
  const { file } = diagnostic;
128508
128628
  return {
128509
128629
  ...diagnostic,
128510
128630
  file: file ? file.resolvedPath === diagnosticFilePath ? void 0 : relativeToBuildInfo(file.resolvedPath) : false,
128511
- messageText: isString(diagnostic.messageText) ? diagnostic.messageText : convertToReusableDiagnosticMessageChain(diagnostic.messageText)
128631
+ messageText: isString(diagnostic.messageText) ? diagnostic.messageText : toReusableDiagnosticMessageChain(diagnostic.messageText)
128512
128632
  };
128513
128633
  }
128514
- function convertToReusableDiagnosticMessageChain(chain) {
128634
+ function toReusableDiagnosticMessageChain(chain) {
128515
128635
  if (chain.repopulateInfo) {
128516
128636
  return {
128517
128637
  info: chain.repopulateInfo(),
128518
- next: convertToReusableDiagnosticMessageChainArray(chain.next)
128638
+ next: toReusableDiagnosticMessageChainArray(chain.next)
128519
128639
  };
128520
128640
  }
128521
- const next = convertToReusableDiagnosticMessageChainArray(chain.next);
128641
+ const next = toReusableDiagnosticMessageChainArray(chain.next);
128522
128642
  return next === chain.next ? chain : { ...chain, next };
128523
128643
  }
128524
- function convertToReusableDiagnosticMessageChainArray(array) {
128644
+ function toReusableDiagnosticMessageChainArray(array) {
128525
128645
  if (!array) return array;
128526
128646
  return forEach(array, (chain, index) => {
128527
- const reusable = convertToReusableDiagnosticMessageChain(chain);
128647
+ const reusable = toReusableDiagnosticMessageChain(chain);
128528
128648
  if (chain === reusable) return void 0;
128529
128649
  const result = index > 0 ? array.slice(0, index - 1) : [];
128530
128650
  result.push(reusable);
128531
128651
  for (let i = index + 1; i < array.length; i++) {
128532
- result.push(convertToReusableDiagnosticMessageChain(array[i]));
128652
+ result.push(toReusableDiagnosticMessageChain(array[i]));
128533
128653
  }
128534
128654
  return result;
128535
128655
  }) || array;
@@ -128606,24 +128726,27 @@ function computeSignature(text, host, data) {
128606
128726
  return (host.createHash ?? generateDjb2Hash)(getTextHandlingSourceMapForSignature(text, data));
128607
128727
  }
128608
128728
  function createBuilderProgram(kind, { newProgram, host, oldProgram, configFileParsingDiagnostics }) {
128609
- let oldState = oldProgram && oldProgram.getState();
128729
+ let oldState = oldProgram && oldProgram.state;
128610
128730
  if (oldState && newProgram === oldState.program && configFileParsingDiagnostics === newProgram.getConfigFileParsingDiagnostics()) {
128611
128731
  newProgram = void 0;
128612
128732
  oldState = void 0;
128613
128733
  return oldProgram;
128614
128734
  }
128615
128735
  const state = createBuilderProgramState(newProgram, oldState);
128616
- newProgram.getBuildInfo = () => getBuildInfo2(state);
128736
+ newProgram.getBuildInfo = () => getBuildInfo2(toBuilderProgramStateWithDefinedProgram(state));
128617
128737
  newProgram = void 0;
128618
128738
  oldProgram = void 0;
128619
128739
  oldState = void 0;
128620
- const getState = () => state;
128621
- const builderProgram = createRedirectedBuilderProgram(getState, configFileParsingDiagnostics);
128622
- builderProgram.getState = getState;
128740
+ const builderProgram = createRedirectedBuilderProgram(state, configFileParsingDiagnostics);
128741
+ builderProgram.state = state;
128623
128742
  builderProgram.saveEmitState = () => backupBuilderProgramEmitState(state);
128624
128743
  builderProgram.restoreEmitState = (saved) => restoreBuilderProgramEmitState(state, saved);
128625
128744
  builderProgram.hasChangedEmitSignature = () => !!state.hasChangedEmitSignature;
128626
- builderProgram.getAllDependencies = (sourceFile) => BuilderState.getAllDependencies(state, Debug.checkDefined(state.program), sourceFile);
128745
+ builderProgram.getAllDependencies = (sourceFile) => BuilderState.getAllDependencies(
128746
+ state,
128747
+ Debug.checkDefined(state.program),
128748
+ sourceFile
128749
+ );
128627
128750
  builderProgram.getSemanticDiagnostics = getSemanticDiagnostics;
128628
128751
  builderProgram.emit = emit;
128629
128752
  builderProgram.releaseProgram = () => releaseCache(state);
@@ -128638,8 +128761,12 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
128638
128761
  }
128639
128762
  return builderProgram;
128640
128763
  function emitBuildInfo(writeFile2, cancellationToken) {
128764
+ Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
128641
128765
  if (state.buildInfoEmitPending) {
128642
- const result = Debug.checkDefined(state.program).emitBuildInfo(writeFile2 || maybeBind(host, host.writeFile), cancellationToken);
128766
+ const result = state.program.emitBuildInfo(
128767
+ writeFile2 || maybeBind(host, host.writeFile),
128768
+ cancellationToken
128769
+ );
128643
128770
  state.buildInfoEmitPending = false;
128644
128771
  return result;
128645
128772
  }
@@ -128647,6 +128774,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
128647
128774
  }
128648
128775
  function emitNextAffectedFile(writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) {
128649
128776
  var _a, _b, _c, _d;
128777
+ Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
128650
128778
  let affected = getNextAffectedFile(state, cancellationToken, host);
128651
128779
  const programEmitKind = getBuilderFileEmit(state.compilerOptions);
128652
128780
  let emitKind = emitOnlyDtsFiles ? programEmitKind & 24 /* AllDts */ : programEmitKind;
@@ -128687,7 +128815,10 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
128687
128815
  if (!affected) {
128688
128816
  if (!state.buildInfoEmitPending) return void 0;
128689
128817
  const affected2 = state.program;
128690
- const result2 = affected2.emitBuildInfo(writeFile2 || maybeBind(host, host.writeFile), cancellationToken);
128818
+ const result2 = affected2.emitBuildInfo(
128819
+ writeFile2 || maybeBind(host, host.writeFile),
128820
+ cancellationToken
128821
+ );
128691
128822
  state.buildInfoEmitPending = false;
128692
128823
  return { result: result2, affected: affected2 };
128693
128824
  }
@@ -128735,6 +128866,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
128735
128866
  return { result, affected };
128736
128867
  }
128737
128868
  function getWriteFileCallback(writeFile2, customTransformers) {
128869
+ Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
128738
128870
  if (!getEmitDeclarations(state.compilerOptions)) return writeFile2 || maybeBind(host, host.writeFile);
128739
128871
  return (fileName, text, writeByteOrderMark, onError, sourceFiles, data) => {
128740
128872
  var _a, _b, _c;
@@ -128801,6 +128933,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
128801
128933
  };
128802
128934
  }
128803
128935
  function emit(targetSourceFile, writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers) {
128936
+ Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
128804
128937
  if (kind === 1 /* EmitAndSemanticDiagnosticsBuilderProgram */) {
128805
128938
  assertSourceFileOkWithoutNextAffectedCall(state, targetSourceFile);
128806
128939
  }
@@ -128813,7 +128946,12 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
128813
128946
  let diagnostics;
128814
128947
  let emittedFiles = [];
128815
128948
  let affectedEmitResult;
128816
- while (affectedEmitResult = emitNextAffectedFile(writeFile2, cancellationToken, emitOnlyDtsFiles, customTransformers)) {
128949
+ while (affectedEmitResult = emitNextAffectedFile(
128950
+ writeFile2,
128951
+ cancellationToken,
128952
+ emitOnlyDtsFiles,
128953
+ customTransformers
128954
+ )) {
128817
128955
  emitSkipped = emitSkipped || affectedEmitResult.result.emitSkipped;
128818
128956
  diagnostics = addRange(diagnostics, affectedEmitResult.result.diagnostics);
128819
128957
  emittedFiles = addRange(emittedFiles, affectedEmitResult.result.emittedFiles);
@@ -128829,7 +128967,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
128829
128967
  clearAffectedFilesPendingEmit(state, emitOnlyDtsFiles);
128830
128968
  }
128831
128969
  }
128832
- return Debug.checkDefined(state.program).emit(
128970
+ return state.program.emit(
128833
128971
  targetSourceFile,
128834
128972
  getWriteFileCallback(writeFile2, customTransformers),
128835
128973
  cancellationToken,
@@ -128838,6 +128976,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
128838
128976
  );
128839
128977
  }
128840
128978
  function getSemanticDiagnosticsOfNextAffectedFile(cancellationToken, ignoreSourceFile) {
128979
+ Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
128841
128980
  while (true) {
128842
128981
  const affected = getNextAffectedFile(state, cancellationToken, host);
128843
128982
  let result;
@@ -128875,6 +129014,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
128875
129014
  }
128876
129015
  }
128877
129016
  function getSemanticDiagnostics(sourceFile, cancellationToken) {
129017
+ Debug.assert(isBuilderProgramStateWithDefinedProgram(state));
128878
129018
  assertSourceFileOkWithoutNextAffectedCall(state, sourceFile);
128879
129019
  if (sourceFile) {
128880
129020
  return getSemanticDiagnosticsOfFile(state, sourceFile, cancellationToken);
@@ -128885,7 +129025,7 @@ function createBuilderProgram(kind, { newProgram, host, oldProgram, configFilePa
128885
129025
  if (affectedResult.affected === state.program) return affectedResult.result;
128886
129026
  }
128887
129027
  let diagnostics;
128888
- for (const sourceFile2 of Debug.checkDefined(state.program).getSourceFiles()) {
129028
+ for (const sourceFile2 of state.program.getSourceFiles()) {
128889
129029
  diagnostics = addRange(diagnostics, getSemanticDiagnosticsOfFile(state, sourceFile2, cancellationToken));
128890
129030
  }
128891
129031
  return diagnostics || emptyArray;
@@ -128906,43 +129046,42 @@ function toBuilderFileEmit(value, fullEmitForOptions) {
128906
129046
  function toProgramEmitPending(value, options) {
128907
129047
  return !value ? getBuilderFileEmit(options || {}) : value;
128908
129048
  }
128909
- function createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, host) {
129049
+ function createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath, host) {
128910
129050
  var _a, _b, _c, _d;
128911
- const program = buildInfo.program;
128912
129051
  const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
128913
129052
  const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
128914
129053
  let state;
128915
- const filePaths = (_a = program.fileNames) == null ? void 0 : _a.map(toPathInBuildInfoDirectory);
129054
+ const filePaths = (_a = buildInfo.fileNames) == null ? void 0 : _a.map(toPathInBuildInfoDirectory);
128916
129055
  let filePathsSetList;
128917
- const latestChangedDtsFile = program.latestChangedDtsFile ? toAbsolutePath(program.latestChangedDtsFile) : void 0;
129056
+ const latestChangedDtsFile = buildInfo.latestChangedDtsFile ? toAbsolutePath(buildInfo.latestChangedDtsFile) : void 0;
128918
129057
  const fileInfos = /* @__PURE__ */ new Map();
128919
- const changedFilesSet = new Set(map(program.changeFileSet, toFilePath));
128920
- if (isProgramBundleEmitBuildInfo(program)) {
128921
- program.fileInfos.forEach((fileInfo, index) => {
129058
+ const changedFilesSet = new Set(map(buildInfo.changeFileSet, toFilePath));
129059
+ if (isIncrementalBundleEmitBuildInfo(buildInfo)) {
129060
+ buildInfo.fileInfos.forEach((fileInfo, index) => {
128922
129061
  const path = toFilePath(index + 1);
128923
129062
  fileInfos.set(path, isString(fileInfo) ? { version: fileInfo, signature: void 0, affectsGlobalScope: void 0, impliedFormat: void 0 } : fileInfo);
128924
129063
  });
128925
129064
  state = {
128926
129065
  fileInfos,
128927
- compilerOptions: program.options ? convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
128928
- semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(program.semanticDiagnosticsPerFile),
128929
- emitDiagnosticsPerFile: toPerFileEmitDiagnostics(program.emitDiagnosticsPerFile),
129066
+ compilerOptions: buildInfo.options ? convertToOptionsWithAbsolutePaths(buildInfo.options, toAbsolutePath) : {},
129067
+ semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(buildInfo.semanticDiagnosticsPerFile),
129068
+ emitDiagnosticsPerFile: toPerFileEmitDiagnostics(buildInfo.emitDiagnosticsPerFile),
128930
129069
  hasReusableDiagnostic: true,
128931
129070
  changedFilesSet,
128932
129071
  latestChangedDtsFile,
128933
- outSignature: program.outSignature,
128934
- programEmitPending: program.pendingEmit === void 0 ? void 0 : toProgramEmitPending(program.pendingEmit, program.options)
129072
+ outSignature: buildInfo.outSignature,
129073
+ programEmitPending: buildInfo.pendingEmit === void 0 ? void 0 : toProgramEmitPending(buildInfo.pendingEmit, buildInfo.options)
128935
129074
  };
128936
129075
  } else {
128937
- filePathsSetList = (_b = program.fileIdsList) == null ? void 0 : _b.map((fileIds) => new Set(fileIds.map(toFilePath)));
128938
- const emitSignatures = ((_c = program.options) == null ? void 0 : _c.composite) && !program.options.outFile ? /* @__PURE__ */ new Map() : void 0;
128939
- program.fileInfos.forEach((fileInfo, index) => {
129076
+ filePathsSetList = (_b = buildInfo.fileIdsList) == null ? void 0 : _b.map((fileIds) => new Set(fileIds.map(toFilePath)));
129077
+ const emitSignatures = ((_c = buildInfo.options) == null ? void 0 : _c.composite) && !buildInfo.options.outFile ? /* @__PURE__ */ new Map() : void 0;
129078
+ buildInfo.fileInfos.forEach((fileInfo, index) => {
128940
129079
  const path = toFilePath(index + 1);
128941
129080
  const stateFileInfo = toBuilderStateFileInfoForMultiEmit(fileInfo);
128942
129081
  fileInfos.set(path, stateFileInfo);
128943
129082
  if (emitSignatures && stateFileInfo.signature) emitSignatures.set(path, stateFileInfo.signature);
128944
129083
  });
128945
- (_d = program.emitSignatures) == null ? void 0 : _d.forEach((value) => {
129084
+ (_d = buildInfo.emitSignatures) == null ? void 0 : _d.forEach((value) => {
128946
129085
  if (isNumber(value)) emitSignatures.delete(toFilePath(value));
128947
129086
  else {
128948
129087
  const key = toFilePath(value[0]);
@@ -128955,22 +129094,22 @@ function createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, hos
128955
129094
  );
128956
129095
  }
128957
129096
  });
128958
- const fullEmitForOptions = program.affectedFilesPendingEmit ? getBuilderFileEmit(program.options || {}) : void 0;
129097
+ const fullEmitForOptions = buildInfo.affectedFilesPendingEmit ? getBuilderFileEmit(buildInfo.options || {}) : void 0;
128959
129098
  state = {
128960
129099
  fileInfos,
128961
- compilerOptions: program.options ? convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
128962
- referencedMap: toManyToManyPathMap(program.referencedMap, program.options ?? {}),
128963
- semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(program.semanticDiagnosticsPerFile),
128964
- emitDiagnosticsPerFile: toPerFileEmitDiagnostics(program.emitDiagnosticsPerFile),
129100
+ compilerOptions: buildInfo.options ? convertToOptionsWithAbsolutePaths(buildInfo.options, toAbsolutePath) : {},
129101
+ referencedMap: toManyToManyPathMap(buildInfo.referencedMap, buildInfo.options ?? {}),
129102
+ semanticDiagnosticsPerFile: toPerFileSemanticDiagnostics(buildInfo.semanticDiagnosticsPerFile),
129103
+ emitDiagnosticsPerFile: toPerFileEmitDiagnostics(buildInfo.emitDiagnosticsPerFile),
128965
129104
  hasReusableDiagnostic: true,
128966
- affectedFilesPendingEmit: program.affectedFilesPendingEmit && arrayToMap(program.affectedFilesPendingEmit, (value) => toFilePath(isNumber(value) ? value : value[0]), (value) => toBuilderFileEmit(value, fullEmitForOptions)),
129105
+ affectedFilesPendingEmit: buildInfo.affectedFilesPendingEmit && arrayToMap(buildInfo.affectedFilesPendingEmit, (value) => toFilePath(isNumber(value) ? value : value[0]), (value) => toBuilderFileEmit(value, fullEmitForOptions)),
128967
129106
  changedFilesSet,
128968
129107
  latestChangedDtsFile,
128969
129108
  emitSignatures: (emitSignatures == null ? void 0 : emitSignatures.size) ? emitSignatures : void 0
128970
129109
  };
128971
129110
  }
128972
129111
  return {
128973
- getState: () => state,
129112
+ state,
128974
129113
  saveEmitState: noop,
128975
129114
  restoreEmitState: noop,
128976
129115
  getProgram: notImplemented,
@@ -129064,15 +129203,15 @@ function getBuildInfoFileVersionMap(program, buildInfoPath, host) {
129064
129203
  }
129065
129204
  }
129066
129205
  }
129067
- function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics) {
129206
+ function createRedirectedBuilderProgram(state, configFileParsingDiagnostics) {
129068
129207
  return {
129069
- getState: notImplemented,
129208
+ state: void 0,
129070
129209
  saveEmitState: noop,
129071
129210
  restoreEmitState: noop,
129072
129211
  getProgram,
129073
- getProgramOrUndefined: () => getState().program,
129074
- releaseProgram: () => getState().program = void 0,
129075
- getCompilerOptions: () => getState().compilerOptions,
129212
+ getProgramOrUndefined: () => state.program,
129213
+ releaseProgram: () => state.program = void 0,
129214
+ getCompilerOptions: () => state.compilerOptions,
129076
129215
  getSourceFile: (fileName) => getProgram().getSourceFile(fileName),
129077
129216
  getSourceFiles: () => getProgram().getSourceFiles(),
129078
129217
  getOptionsDiagnostics: (cancellationToken) => getProgram().getOptionsDiagnostics(cancellationToken),
@@ -129088,20 +129227,50 @@ function createRedirectedBuilderProgram(getState, configFileParsingDiagnostics)
129088
129227
  close: noop
129089
129228
  };
129090
129229
  function getProgram() {
129091
- return Debug.checkDefined(getState().program);
129230
+ return Debug.checkDefined(state.program);
129092
129231
  }
129093
129232
  }
129094
129233
 
129095
129234
  // src/compiler/builderPublic.ts
129096
129235
  function createSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) {
129097
- return createBuilderProgram(0 /* SemanticDiagnosticsBuilderProgram */, getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences));
129236
+ return createBuilderProgram(
129237
+ 0 /* SemanticDiagnosticsBuilderProgram */,
129238
+ getBuilderCreationParameters(
129239
+ newProgramOrRootNames,
129240
+ hostOrOptions,
129241
+ oldProgramOrHost,
129242
+ configFileParsingDiagnosticsOrOldProgram,
129243
+ configFileParsingDiagnostics,
129244
+ projectReferences
129245
+ )
129246
+ );
129098
129247
  }
129099
129248
  function createEmitAndSemanticDiagnosticsBuilderProgram(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) {
129100
- return createBuilderProgram(1 /* EmitAndSemanticDiagnosticsBuilderProgram */, getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences));
129249
+ return createBuilderProgram(
129250
+ 1 /* EmitAndSemanticDiagnosticsBuilderProgram */,
129251
+ getBuilderCreationParameters(
129252
+ newProgramOrRootNames,
129253
+ hostOrOptions,
129254
+ oldProgramOrHost,
129255
+ configFileParsingDiagnosticsOrOldProgram,
129256
+ configFileParsingDiagnostics,
129257
+ projectReferences
129258
+ )
129259
+ );
129101
129260
  }
129102
129261
  function createAbstractBuilder(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences) {
129103
- const { newProgram, configFileParsingDiagnostics: newConfigFileParsingDiagnostics } = getBuilderCreationParameters(newProgramOrRootNames, hostOrOptions, oldProgramOrHost, configFileParsingDiagnosticsOrOldProgram, configFileParsingDiagnostics, projectReferences);
129104
- return createRedirectedBuilderProgram(() => ({ program: newProgram, compilerOptions: newProgram.getCompilerOptions() }), newConfigFileParsingDiagnostics);
129262
+ const { newProgram, configFileParsingDiagnostics: newConfigFileParsingDiagnostics } = getBuilderCreationParameters(
129263
+ newProgramOrRootNames,
129264
+ hostOrOptions,
129265
+ oldProgramOrHost,
129266
+ configFileParsingDiagnosticsOrOldProgram,
129267
+ configFileParsingDiagnostics,
129268
+ projectReferences
129269
+ );
129270
+ return createRedirectedBuilderProgram(
129271
+ { program: newProgram, compilerOptions: newProgram.getCompilerOptions() },
129272
+ newConfigFileParsingDiagnostics
129273
+ );
129105
129274
  }
129106
129275
 
129107
129276
  // src/compiler/resolutionCache.ts
@@ -130376,13 +130545,13 @@ function createTabularErrorsDisplay(filesInError, host) {
130376
130545
  });
130377
130546
  return tabularData;
130378
130547
  }
130379
- function isBuilderProgram2(program) {
130380
- return !!program.getState;
130548
+ function isBuilderProgram(program) {
130549
+ return !!program.state;
130381
130550
  }
130382
130551
  function listFiles(program, write) {
130383
130552
  const options = program.getCompilerOptions();
130384
130553
  if (options.explainFiles) {
130385
- explainFiles(isBuilderProgram2(program) ? program.getProgram() : program, write);
130554
+ explainFiles(isBuilderProgram(program) ? program.getProgram() : program, write);
130386
130555
  } else if (options.listFiles || options.listFilesOnly) {
130387
130556
  forEach(program.getSourceFiles(), (file) => {
130388
130557
  write(file.fileName);
@@ -130882,8 +131051,8 @@ function readBuilderProgram(compilerOptions, host) {
130882
131051
  if (!content) return void 0;
130883
131052
  buildInfo = getBuildInfo(buildInfoPath, content);
130884
131053
  }
130885
- if (!buildInfo || buildInfo.version !== version || !buildInfo.program) return void 0;
130886
- return createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, host);
131054
+ if (!buildInfo || buildInfo.version !== version || !isIncrementalBuildInfo(buildInfo)) return void 0;
131055
+ return createBuilderProgramUsingIncrementalBuildInfo(buildInfo, buildInfoPath, host);
130887
131056
  }
130888
131057
  function createIncrementalCompilerHost(options, system = sys) {
130889
131058
  const host = createCompilerHostWorker(
@@ -132648,7 +132817,7 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
132648
132817
  let oldestOutputFileName;
132649
132818
  let oldestOutputFileTime = maximumDate;
132650
132819
  let buildInfoTime;
132651
- let buildInfoProgram;
132820
+ let incrementalBuildInfo;
132652
132821
  let buildInfoVersionMap;
132653
132822
  if (buildInfoPath) {
132654
132823
  const buildInfoCacheEntry2 = getBuildInfoCacheEntry(state, buildInfoPath, resolvedPath);
@@ -132673,26 +132842,26 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
132673
132842
  fileName: buildInfoPath
132674
132843
  };
132675
132844
  }
132676
- if (buildInfo.program && buildInfo.version !== version) {
132845
+ if (isIncrementalBuildInfo(buildInfo) && buildInfo.version !== version) {
132677
132846
  return {
132678
132847
  type: 13 /* TsVersionOutputOfDate */,
132679
132848
  version: buildInfo.version
132680
132849
  };
132681
132850
  }
132682
- if (buildInfo.program) {
132683
- if (((_a = buildInfo.program.changeFileSet) == null ? void 0 : _a.length) || (!project.options.noEmit ? ((_b = buildInfo.program.affectedFilesPendingEmit) == null ? void 0 : _b.length) || ((_c = buildInfo.program.emitDiagnosticsPerFile) == null ? void 0 : _c.length) || buildInfo.program.pendingEmit !== void 0 : (_d = buildInfo.program.semanticDiagnosticsPerFile) == null ? void 0 : _d.length)) {
132851
+ if (isIncrementalBuildInfo(buildInfo)) {
132852
+ if (((_a = buildInfo.changeFileSet) == null ? void 0 : _a.length) || (!project.options.noEmit ? ((_b = buildInfo.affectedFilesPendingEmit) == null ? void 0 : _b.length) || ((_c = buildInfo.emitDiagnosticsPerFile) == null ? void 0 : _c.length) || buildInfo.pendingEmit !== void 0 : (_d = buildInfo.semanticDiagnosticsPerFile) == null ? void 0 : _d.length)) {
132684
132853
  return {
132685
132854
  type: 7 /* OutOfDateBuildInfo */,
132686
132855
  buildInfoFile: buildInfoPath
132687
132856
  };
132688
132857
  }
132689
- if (!project.options.noEmit && getPendingEmitKind(project.options, buildInfo.program.options || {})) {
132858
+ if (!project.options.noEmit && getPendingEmitKind(project.options, buildInfo.options || {})) {
132690
132859
  return {
132691
132860
  type: 8 /* OutOfDateOptions */,
132692
132861
  buildInfoFile: buildInfoPath
132693
132862
  };
132694
132863
  }
132695
- buildInfoProgram = buildInfo.program;
132864
+ incrementalBuildInfo = buildInfo;
132696
132865
  }
132697
132866
  oldestOutputFileTime = buildInfoTime;
132698
132867
  oldestOutputFileName = buildInfoPath;
@@ -132709,12 +132878,12 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
132709
132878
  reason: `${inputFile} does not exist`
132710
132879
  };
132711
132880
  }
132712
- const inputPath = buildInfoProgram ? toPath2(state, inputFile) : void 0;
132881
+ const inputPath = incrementalBuildInfo ? toPath2(state, inputFile) : void 0;
132713
132882
  if (buildInfoTime && buildInfoTime < inputTime) {
132714
132883
  let version2;
132715
132884
  let currentVersion;
132716
- if (buildInfoProgram) {
132717
- if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
132885
+ if (incrementalBuildInfo) {
132886
+ if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(incrementalBuildInfo, buildInfoPath, host);
132718
132887
  const resolvedInputPath = buildInfoVersionMap.roots.get(inputPath);
132719
132888
  version2 = buildInfoVersionMap.fileInfos.get(resolvedInputPath ?? inputPath);
132720
132889
  const text = version2 ? state.readFileWithCache(resolvedInputPath ?? inputFile) : void 0;
@@ -132733,10 +132902,10 @@ function getUpToDateStatusWorker(state, project, resolvedPath) {
132733
132902
  newestInputFileName = inputFile;
132734
132903
  newestInputFileTime = inputTime;
132735
132904
  }
132736
- if (buildInfoProgram) seenRoots.add(inputPath);
132905
+ if (incrementalBuildInfo) seenRoots.add(inputPath);
132737
132906
  }
132738
- if (buildInfoProgram) {
132739
- if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(buildInfoProgram, buildInfoPath, host);
132907
+ if (incrementalBuildInfo) {
132908
+ if (!buildInfoVersionMap) buildInfoVersionMap = getBuildInfoFileVersionMap(incrementalBuildInfo, buildInfoPath, host);
132740
132909
  const existingRoot = forEachEntry(
132741
132910
  buildInfoVersionMap.roots,
132742
132911
  // File was root file when project was built but its not any more
@@ -132883,7 +133052,7 @@ function getLatestChangedDtsTime(state, options, resolvedConfigPath) {
132883
133052
  if (!options.composite) return void 0;
132884
133053
  const entry = Debug.checkDefined(state.buildInfoCache.get(resolvedConfigPath));
132885
133054
  if (entry.latestChangedDtsTime !== void 0) return entry.latestChangedDtsTime || void 0;
132886
- const latestChangedDtsTime = entry.buildInfo && entry.buildInfo.program && entry.buildInfo.program.latestChangedDtsFile ? state.host.getModifiedTime(getNormalizedAbsolutePath(entry.buildInfo.program.latestChangedDtsFile, getDirectoryPath(entry.path))) : void 0;
133055
+ const latestChangedDtsTime = entry.buildInfo && isIncrementalBuildInfo(entry.buildInfo) && entry.buildInfo.latestChangedDtsFile ? state.host.getModifiedTime(getNormalizedAbsolutePath(entry.buildInfo.latestChangedDtsFile, getDirectoryPath(entry.path))) : void 0;
132887
133056
  entry.latestChangedDtsTime = latestChangedDtsTime || false;
132888
133057
  return latestChangedDtsTime;
132889
133058
  }
@@ -134853,7 +135022,7 @@ function createSyntacticTypeNodeBuilder(options, resolver) {
134853
135022
  expression,
134854
135023
  /*includeBigInt*/
134855
135024
  false
134856
- )) {
135025
+ ) && !resolver.isDefinitelyReferenceToGlobalSymbolObject(expression)) {
134857
135026
  context.tracker.reportInferenceFallback(prop.name);
134858
135027
  result = false;
134859
135028
  }
@@ -136961,12 +137130,12 @@ function isInReferenceCommentWorker(sourceFile, position, shouldBeReference) {
136961
137130
  );
136962
137131
  return !!range && shouldBeReference === tripleSlashDirectivePrefixRegex.test(sourceFile.text.substring(range.pos, range.end));
136963
137132
  }
136964
- function getReplacementSpanForContextToken(contextToken) {
137133
+ function getReplacementSpanForContextToken(contextToken, position) {
136965
137134
  if (!contextToken) return void 0;
136966
137135
  switch (contextToken.kind) {
136967
137136
  case 11 /* StringLiteral */:
136968
137137
  case 15 /* NoSubstitutionTemplateLiteral */:
136969
- return createTextSpanFromStringLiteralLikeContent(contextToken);
137138
+ return createTextSpanFromStringLiteralLikeContent(contextToken, position);
136970
137139
  default:
136971
137140
  return createTextSpanFromNode(contextToken);
136972
137141
  }
@@ -136974,11 +137143,11 @@ function getReplacementSpanForContextToken(contextToken) {
136974
137143
  function createTextSpanFromNode(node, sourceFile, endNode2) {
136975
137144
  return createTextSpanFromBounds(node.getStart(sourceFile), (endNode2 || node).getEnd());
136976
137145
  }
136977
- function createTextSpanFromStringLiteralLikeContent(node) {
137146
+ function createTextSpanFromStringLiteralLikeContent(node, position) {
136978
137147
  let replacementEnd = node.getEnd() - 1;
136979
137148
  if (node.isUnterminated) {
136980
137149
  if (node.getStart() === replacementEnd) return void 0;
136981
- replacementEnd = node.getEnd();
137150
+ replacementEnd = Math.min(position, node.getEnd());
136982
137151
  }
136983
137152
  return createTextSpanFromBounds(node.getStart() + 1, replacementEnd);
136984
137153
  }
@@ -143091,9 +143260,9 @@ function doChangeNamedToNamespaceOrDefault(sourceFile, program, changes, toConve
143091
143260
  const namespaceImportName = namespaceNameConflicts ? getUniqueName(preferredName, sourceFile) : preferredName;
143092
143261
  const neededNamedImports = /* @__PURE__ */ new Set();
143093
143262
  for (const element of toConvert.elements) {
143094
- const propertyName = (element.propertyName || element.name).text;
143263
+ const propertyName = element.propertyName || element.name;
143095
143264
  ts_FindAllReferences_exports.Core.eachSymbolReferenceInFile(element.name, checker, sourceFile, (id) => {
143096
- const access = factory.createPropertyAccessExpression(factory.createIdentifier(namespaceImportName), propertyName);
143265
+ const access = propertyName.kind === 11 /* StringLiteral */ ? factory.createElementAccessExpression(factory.createIdentifier(namespaceImportName), factory.cloneNode(propertyName)) : factory.createPropertyAccessExpression(factory.createIdentifier(namespaceImportName), factory.cloneNode(propertyName));
143097
143266
  if (isShorthandPropertyAssignment(id.parent)) {
143098
143267
  changes.replaceNode(sourceFile, id.parent, factory.createPropertyAssignment(id.text, access));
143099
143268
  } else if (isExportSpecifier(id.parent)) {
@@ -143109,7 +143278,7 @@ function doChangeNamedToNamespaceOrDefault(sourceFile, program, changes, toConve
143109
143278
  shouldUseDefault ? factory.createIdentifier(namespaceImportName) : factory.createNamespaceImport(factory.createIdentifier(namespaceImportName))
143110
143279
  );
143111
143280
  if (neededNamedImports.size && isImportDeclaration(importDecl)) {
143112
- const newNamedImports = arrayFrom(neededNamedImports.values(), (element) => factory.createImportSpecifier(element.isTypeOnly, element.propertyName && factory.createIdentifier(element.propertyName.text), factory.createIdentifier(element.name.text)));
143281
+ const newNamedImports = arrayFrom(neededNamedImports.values(), (element) => factory.createImportSpecifier(element.isTypeOnly, element.propertyName && factory.cloneNode(element.propertyName), factory.cloneNode(element.name)));
143113
143282
  changes.insertNodeAfter(sourceFile, toConvert.parent.parent, createImport(
143114
143283
  importDecl,
143115
143284
  /*defaultImportName*/
@@ -163408,7 +163577,7 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
163408
163577
  var _a, _b;
163409
163578
  let insertText;
163410
163579
  let filterText;
163411
- let replacementSpan = getReplacementSpanForContextToken(replacementToken);
163580
+ let replacementSpan = getReplacementSpanForContextToken(replacementToken, position);
163412
163581
  let data;
163413
163582
  let isSnippet;
163414
163583
  let source = getSourceFromOrigin(origin);
@@ -163525,10 +163694,18 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
163525
163694
  hasAction = !importStatementCompletion;
163526
163695
  }
163527
163696
  const parentNamedImportOrExport = findAncestor(location, isNamedImportsOrExports);
163528
- if ((parentNamedImportOrExport == null ? void 0 : parentNamedImportOrExport.kind) === 275 /* NamedImports */) {
163529
- const possibleToken = stringToToken(name);
163530
- if (parentNamedImportOrExport && possibleToken && (possibleToken === 135 /* AwaitKeyword */ || isNonContextualKeyword(possibleToken))) {
163531
- insertText = `${name} as ${name}_`;
163697
+ if (parentNamedImportOrExport) {
163698
+ const languageVersion = getEmitScriptTarget(host.getCompilationSettings());
163699
+ if (!isIdentifierText(name, languageVersion)) {
163700
+ insertText = JSON.stringify(name);
163701
+ if (parentNamedImportOrExport.kind === 275 /* NamedImports */) {
163702
+ insertText += " as " + generateIdentifierForArbitraryString(name, languageVersion);
163703
+ }
163704
+ } else if (parentNamedImportOrExport.kind === 275 /* NamedImports */) {
163705
+ const possibleToken = stringToToken(name);
163706
+ if (possibleToken && (possibleToken === 135 /* AwaitKeyword */ || isNonContextualKeyword(possibleToken))) {
163707
+ insertText = `${name} as ${name}_`;
163708
+ }
163532
163709
  }
163533
163710
  }
163534
163711
  return {
@@ -163551,6 +163728,23 @@ function createCompletionEntry(symbol, sortText, replacementToken, contextToken,
163551
163728
  ...includeSymbol ? { symbol } : void 0
163552
163729
  };
163553
163730
  }
163731
+ function generateIdentifierForArbitraryString(text, languageVersion) {
163732
+ let needsUnderscore = false;
163733
+ let identifier = "";
163734
+ let ch;
163735
+ for (let i = 0; i < text.length; i += ch !== void 0 && ch >= 65536 ? 2 : 1) {
163736
+ ch = text.codePointAt(i);
163737
+ if (ch !== void 0 && (i === 0 ? isIdentifierStart(ch, languageVersion) : isIdentifierPart(ch, languageVersion))) {
163738
+ if (needsUnderscore) identifier += "_";
163739
+ identifier += String.fromCodePoint(ch);
163740
+ needsUnderscore = false;
163741
+ } else {
163742
+ needsUnderscore = true;
163743
+ }
163744
+ }
163745
+ if (needsUnderscore) identifier += "_";
163746
+ return identifier || "_";
163747
+ }
163554
163748
  function isClassLikeMemberCompletion(symbol, location, sourceFile) {
163555
163749
  if (isInJSFile(location)) {
163556
163750
  return false;
@@ -165382,7 +165576,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
165382
165576
  completionKind = 3 /* MemberLike */;
165383
165577
  isNewIdentifierLocation = false;
165384
165578
  const exports2 = typeChecker.getExportsAndPropertiesOfModule(moduleSpecifierSymbol);
165385
- const existing = new Set(namedImportsOrExports.elements.filter((n) => !isCurrentlyEditingNode(n)).map((n) => (n.propertyName || n.name).escapedText));
165579
+ const existing = new Set(namedImportsOrExports.elements.filter((n) => !isCurrentlyEditingNode(n)).map((n) => moduleExportNameTextEscaped(n.propertyName || n.name)));
165386
165580
  const uniques = exports2.filter((e) => e.escapedName !== "default" /* Default */ && !existing.has(e.escapedName));
165387
165581
  symbols = concatenate(symbols, uniques);
165388
165582
  if (!uniques.length) {
@@ -165873,6 +166067,9 @@ function getCompletionEntryDisplayNameForSymbol(symbol, target, origin, kind, js
165873
166067
  if (isIdentifierText(name, target, jsxIdentifierExpected ? 1 /* JSX */ : 0 /* Standard */) || symbol.valueDeclaration && isPrivateIdentifierClassElementDeclaration(symbol.valueDeclaration)) {
165874
166068
  return validNameResult;
165875
166069
  }
166070
+ if (symbol.flags & 2097152 /* Alias */) {
166071
+ return { name, needsConvertPropertyAccess: true };
166072
+ }
165876
166073
  switch (kind) {
165877
166074
  case 3 /* MemberLike */:
165878
166075
  return originIsComputedPropertyName(origin) ? { name: origin.symbolName, needsConvertPropertyAccess: false } : void 0;
@@ -166402,7 +166599,7 @@ function convertStringLiteralCompletions(completion, contextToken, sourceFile, h
166402
166599
  if (completion === void 0) {
166403
166600
  return void 0;
166404
166601
  }
166405
- const optionalReplacementSpan = createTextSpanFromStringLiteralLikeContent(contextToken);
166602
+ const optionalReplacementSpan = createTextSpanFromStringLiteralLikeContent(contextToken, position);
166406
166603
  switch (completion.kind) {
166407
166604
  case 0 /* Paths */:
166408
166605
  return convertPathCompletions(completion.paths);
@@ -166456,7 +166653,7 @@ function convertStringLiteralCompletions(completion, contextToken, sourceFile, h
166456
166653
  kindModifiers: "" /* none */,
166457
166654
  kind: "string" /* string */,
166458
166655
  sortText: SortText.LocationPriority,
166459
- replacementSpan: getReplacementSpanForContextToken(contextToken)
166656
+ replacementSpan: getReplacementSpanForContextToken(contextToken, position)
166460
166657
  }));
166461
166658
  return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: completion.isNewIdentifier, optionalReplacementSpan, entries };
166462
166659
  }
@@ -166568,6 +166765,21 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, program,
166568
166765
  }
166569
166766
  const literals = contextualTypes.types.filter((literal) => !tracker.hasValue(literal.value));
166570
166767
  return { kind: 2 /* Types */, types: literals, isNewIdentifier: false };
166768
+ case 276 /* ImportSpecifier */:
166769
+ case 281 /* ExportSpecifier */:
166770
+ const specifier = parent2;
166771
+ if (specifier.propertyName && node !== specifier.propertyName) {
166772
+ return;
166773
+ }
166774
+ const namedImportsOrExports = specifier.parent;
166775
+ const { moduleSpecifier } = namedImportsOrExports.kind === 275 /* NamedImports */ ? namedImportsOrExports.parent.parent : namedImportsOrExports.parent;
166776
+ if (!moduleSpecifier) return;
166777
+ const moduleSpecifierSymbol = typeChecker.getSymbolAtLocation(moduleSpecifier);
166778
+ if (!moduleSpecifierSymbol) return;
166779
+ const exports2 = typeChecker.getExportsAndPropertiesOfModule(moduleSpecifierSymbol);
166780
+ const existing = new Set(namedImportsOrExports.elements.map((n) => moduleExportNameTextEscaped(n.propertyName || n.name)));
166781
+ const uniques = exports2.filter((e) => e.escapedName !== "default" /* Default */ && !existing.has(e.escapedName));
166782
+ return { kind: 1 /* Properties */, symbols: uniques, hasIndexSignature: false };
166571
166783
  default:
166572
166784
  return fromContextualType() || fromContextualType(0 /* None */);
166573
166785
  }
@@ -167538,12 +167750,12 @@ function getSearchesFromDirectImports(directImports, exportSymbol, exportKind, c
167538
167750
  }
167539
167751
  for (const element of namedBindings.elements) {
167540
167752
  const { name, propertyName } = element;
167541
- if (!isNameMatch((propertyName || name).escapedText)) {
167753
+ if (!isNameMatch(moduleExportNameTextEscaped(propertyName || name))) {
167542
167754
  continue;
167543
167755
  }
167544
167756
  if (propertyName) {
167545
167757
  singleReferences.push(propertyName);
167546
- if (!isForRename || name.escapedText === exportSymbol.escapedName) {
167758
+ if (!isForRename || moduleExportNameTextEscaped(name) === exportSymbol.escapedName) {
167547
167759
  addSearch(name, checker.getSymbolAtLocation(name));
167548
167760
  }
167549
167761
  } else {
@@ -168801,8 +169013,8 @@ var Core;
168801
169013
  function shouldAddSingleReference(singleRef, state) {
168802
169014
  if (!hasMatchingMeaning(singleRef, state)) return false;
168803
169015
  if (state.options.use !== 2 /* Rename */) return true;
168804
- if (!isIdentifier(singleRef)) return false;
168805
- return !(isImportOrExportSpecifier(singleRef.parent) && singleRef.escapedText === "default" /* Default */);
169016
+ if (!isIdentifier(singleRef) && !isImportOrExportSpecifier(singleRef.parent)) return false;
169017
+ return !(isImportOrExportSpecifier(singleRef.parent) && moduleExportNameIsDefault(singleRef));
168806
169018
  }
168807
169019
  function searchForImportedSymbol(symbol, state) {
168808
169020
  if (!symbol.declarations) return;
@@ -168964,7 +169176,7 @@ var Core;
168964
169176
  case 15 /* NoSubstitutionTemplateLiteral */:
168965
169177
  case 11 /* StringLiteral */: {
168966
169178
  const str = node;
168967
- return (isLiteralNameOfPropertyDeclarationOrIndexAccess(str) || isNameOfModuleDeclaration(node) || isExpressionOfExternalModuleImportEqualsDeclaration(node) || isCallExpression(node.parent) && isBindableObjectDefinePropertyCall(node.parent) && node.parent.arguments[1] === node) && str.text.length === searchSymbolName.length;
169179
+ return str.text.length === searchSymbolName.length && (isLiteralNameOfPropertyDeclarationOrIndexAccess(str) || isNameOfModuleDeclaration(node) || isExpressionOfExternalModuleImportEqualsDeclaration(node) || isCallExpression(node.parent) && isBindableObjectDefinePropertyCall(node.parent) && node.parent.arguments[1] === node || isImportOrExportSpecifier(node.parent));
168968
169180
  }
168969
169181
  case 9 /* NumericLiteral */:
168970
169182
  return isLiteralNameOfPropertyDeclarationOrIndexAccess(node) && node.text.length === searchSymbolName.length;
@@ -169030,7 +169242,7 @@ var Core;
169030
169242
  return;
169031
169243
  }
169032
169244
  if (isExportSpecifier(parent2)) {
169033
- Debug.assert(referenceLocation.kind === 80 /* Identifier */);
169245
+ Debug.assert(referenceLocation.kind === 80 /* Identifier */ || referenceLocation.kind === 11 /* StringLiteral */);
169034
169246
  getReferencesAtExportSpecifier(referenceLocation, referenceSymbol, parent2, search, state, addReferencesHere);
169035
169247
  return;
169036
169248
  }
@@ -169080,7 +169292,7 @@ var Core;
169080
169292
  return;
169081
169293
  }
169082
169294
  if (!propertyName) {
169083
- if (!(state.options.use === 2 /* Rename */ && name.escapedText === "default" /* Default */)) {
169295
+ if (!(state.options.use === 2 /* Rename */ && moduleExportNameIsDefault(name))) {
169084
169296
  addRef();
169085
169297
  }
169086
169298
  } else if (referenceLocation === propertyName) {
@@ -169096,7 +169308,7 @@ var Core;
169096
169308
  }
169097
169309
  }
169098
169310
  if (!isForRenameWithPrefixAndSuffixText(state.options) || alwaysGetReferences) {
169099
- const isDefaultExport = referenceLocation.escapedText === "default" || exportSpecifier.name.escapedText === "default";
169311
+ const isDefaultExport = moduleExportNameIsDefault(referenceLocation) || moduleExportNameIsDefault(exportSpecifier.name);
169100
169312
  const exportKind = isDefaultExport ? 1 /* Default */ : 0 /* Named */;
169101
169313
  const exportSymbol = Debug.checkDefined(exportSpecifier.symbol);
169102
169314
  const exportInfo = getExportInfo(exportSymbol, exportKind, state.checker);
@@ -170053,7 +170265,7 @@ function getSymbol(node, checker, stopAtAlias) {
170053
170265
  return { symbol, failedAliasResolution };
170054
170266
  }
170055
170267
  function shouldSkipAlias(node, declaration) {
170056
- if (node.kind !== 80 /* Identifier */) {
170268
+ if (node.kind !== 80 /* Identifier */ && (node.kind !== 11 /* StringLiteral */ || !isImportOrExportSpecifier(node.parent))) {
170057
170269
  return false;
170058
170270
  }
170059
170271
  if (node.parent === declaration) {
@@ -172066,7 +172278,7 @@ function hasModuleDeclarationMatchingSpecifier(sourceFile, moduleSpecifier) {
172066
172278
  return isString(moduleSpecifierText) && some(sourceFile.moduleAugmentations, (moduleName) => isStringLiteral(moduleName) && moduleName.text === moduleSpecifierText);
172067
172279
  }
172068
172280
  function getNewImportSpecifiers(namedImports) {
172069
- return flatMap(namedImports, (namedImport) => map(tryGetNamedBindingElements(namedImport), (importSpecifier) => importSpecifier.name && importSpecifier.propertyName && importSpecifier.name.escapedText === importSpecifier.propertyName.escapedText ? factory.updateImportSpecifier(
172281
+ return flatMap(namedImports, (namedImport) => map(tryGetNamedBindingElements(namedImport), (importSpecifier) => importSpecifier.name && importSpecifier.propertyName && moduleExportNameTextEscaped(importSpecifier.name) === moduleExportNameTextEscaped(importSpecifier.propertyName) ? factory.updateImportSpecifier(
172070
172282
  importSpecifier,
172071
172283
  importSpecifier.isTypeOnly,
172072
172284
  /*propertyName*/
@@ -178567,7 +178779,7 @@ __export(ts_exports2, {
178567
178779
  changeFullExtension: () => changeFullExtension,
178568
178780
  changesAffectModuleResolution: () => changesAffectModuleResolution,
178569
178781
  changesAffectingProgramStructure: () => changesAffectingProgramStructure,
178570
- characterToRegularExpressionFlag: () => characterToRegularExpressionFlag,
178782
+ characterCodeToRegularExpressionFlag: () => characterCodeToRegularExpressionFlag,
178571
178783
  childIsDecorated: () => childIsDecorated,
178572
178784
  classElementOrClassElementParameterIsDecorated: () => classElementOrClassElementParameterIsDecorated,
178573
178785
  classHasClassThisAssignment: () => classHasClassThisAssignment,
@@ -178667,9 +178879,8 @@ __export(ts_exports2, {
178667
178879
  createBaseNodeFactory: () => createBaseNodeFactory,
178668
178880
  createBinaryExpressionTrampoline: () => createBinaryExpressionTrampoline,
178669
178881
  createBindingHelper: () => createBindingHelper,
178670
- createBuildInfo: () => createBuildInfo,
178671
178882
  createBuilderProgram: () => createBuilderProgram,
178672
- createBuilderProgramUsingProgramBuildInfo: () => createBuilderProgramUsingProgramBuildInfo,
178883
+ createBuilderProgramUsingIncrementalBuildInfo: () => createBuilderProgramUsingIncrementalBuildInfo,
178673
178884
  createBuilderStatusReporter: () => createBuilderStatusReporter,
178674
178885
  createCacheWithRedirects: () => createCacheWithRedirects,
178675
178886
  createCacheableExportInfoMap: () => createCacheableExportInfoMap,
@@ -179553,7 +179764,7 @@ __export(ts_exports2, {
179553
179764
  isBreakStatement: () => isBreakStatement,
179554
179765
  isBuild: () => isBuild,
179555
179766
  isBuildInfoFile: () => isBuildInfoFile,
179556
- isBuilderProgram: () => isBuilderProgram2,
179767
+ isBuilderProgram: () => isBuilderProgram,
179557
179768
  isBundle: () => isBundle,
179558
179769
  isCallChain: () => isCallChain,
179559
179770
  isCallExpression: () => isCallExpression,
@@ -179760,6 +179971,8 @@ __export(ts_exports2, {
179760
179971
  isInTemplateString: () => isInTemplateString,
179761
179972
  isInTopLevelContext: () => isInTopLevelContext,
179762
179973
  isInTypeQuery: () => isInTypeQuery,
179974
+ isIncrementalBuildInfo: () => isIncrementalBuildInfo,
179975
+ isIncrementalBundleEmitBuildInfo: () => isIncrementalBundleEmitBuildInfo,
179763
179976
  isIncrementalCompilation: () => isIncrementalCompilation,
179764
179977
  isIndexSignatureDeclaration: () => isIndexSignatureDeclaration,
179765
179978
  isIndexedAccessTypeNode: () => isIndexedAccessTypeNode,
@@ -179902,6 +180115,7 @@ __export(ts_exports2, {
179902
180115
  isModuleBlock: () => isModuleBlock,
179903
180116
  isModuleBody: () => isModuleBody,
179904
180117
  isModuleDeclaration: () => isModuleDeclaration,
180118
+ isModuleExportName: () => isModuleExportName,
179905
180119
  isModuleExportsAccessExpression: () => isModuleExportsAccessExpression,
179906
180120
  isModuleIdentifier: () => isModuleIdentifier,
179907
180121
  isModuleName: () => isModuleName,
@@ -179995,7 +180209,6 @@ __export(ts_exports2, {
179995
180209
  isPrivateIdentifierClassElementDeclaration: () => isPrivateIdentifierClassElementDeclaration,
179996
180210
  isPrivateIdentifierPropertyAccessExpression: () => isPrivateIdentifierPropertyAccessExpression,
179997
180211
  isPrivateIdentifierSymbol: () => isPrivateIdentifierSymbol,
179998
- isProgramBundleEmitBuildInfo: () => isProgramBundleEmitBuildInfo,
179999
180212
  isProgramUptoDate: () => isProgramUptoDate,
180000
180213
  isPrologueDirective: () => isPrologueDirective,
180001
180214
  isPropertyAccessChain: () => isPropertyAccessChain,
@@ -180219,6 +180432,9 @@ __export(ts_exports2, {
180219
180432
  missingFileModifiedTime: () => missingFileModifiedTime,
180220
180433
  modifierToFlag: () => modifierToFlag,
180221
180434
  modifiersToFlags: () => modifiersToFlags,
180435
+ moduleExportNameIsDefault: () => moduleExportNameIsDefault,
180436
+ moduleExportNameTextEscaped: () => moduleExportNameTextEscaped,
180437
+ moduleExportNameTextUnescaped: () => moduleExportNameTextUnescaped,
180222
180438
  moduleOptionDeclaration: () => moduleOptionDeclaration,
180223
180439
  moduleResolutionIsEqualTo: () => moduleResolutionIsEqualTo,
180224
180440
  moduleResolutionNameAndModeGetter: () => moduleResolutionNameAndModeGetter,
@@ -180364,7 +180580,7 @@ __export(ts_exports2, {
180364
180580
  reducePathComponents: () => reducePathComponents,
180365
180581
  refactor: () => ts_refactor_exports,
180366
180582
  regExpEscape: () => regExpEscape,
180367
- regularExpressionFlagToCharacter: () => regularExpressionFlagToCharacter,
180583
+ regularExpressionFlagToCharacterCode: () => regularExpressionFlagToCharacterCode,
180368
180584
  relativeComplement: () => relativeComplement,
180369
180585
  removeAllComments: () => removeAllComments,
180370
180586
  removeEmitHelper: () => removeEmitHelper,
@@ -180622,7 +180838,6 @@ __export(ts_exports2, {
180622
180838
  unusedLabelIsError: () => unusedLabelIsError,
180623
180839
  unwrapInnermostStatementOfLabel: () => unwrapInnermostStatementOfLabel,
180624
180840
  unwrapParenthesizedExpression: () => unwrapParenthesizedExpression,
180625
- unwrapParenthesizedType: () => unwrapParenthesizedType,
180626
180841
  updateErrorForNoInputFiles: () => updateErrorForNoInputFiles,
180627
180842
  updateLanguageServiceSourceFile: () => updateLanguageServiceSourceFile,
180628
180843
  updateMissingFilePathsWatch: () => updateMissingFilePathsWatch,
@@ -193000,7 +193215,7 @@ if (typeof console !== "undefined") {
193000
193215
  changeFullExtension,
193001
193216
  changesAffectModuleResolution,
193002
193217
  changesAffectingProgramStructure,
193003
- characterToRegularExpressionFlag,
193218
+ characterCodeToRegularExpressionFlag,
193004
193219
  childIsDecorated,
193005
193220
  classElementOrClassElementParameterIsDecorated,
193006
193221
  classHasClassThisAssignment,
@@ -193100,9 +193315,8 @@ if (typeof console !== "undefined") {
193100
193315
  createBaseNodeFactory,
193101
193316
  createBinaryExpressionTrampoline,
193102
193317
  createBindingHelper,
193103
- createBuildInfo,
193104
193318
  createBuilderProgram,
193105
- createBuilderProgramUsingProgramBuildInfo,
193319
+ createBuilderProgramUsingIncrementalBuildInfo,
193106
193320
  createBuilderStatusReporter,
193107
193321
  createCacheWithRedirects,
193108
193322
  createCacheableExportInfoMap,
@@ -194193,6 +194407,8 @@ if (typeof console !== "undefined") {
194193
194407
  isInTemplateString,
194194
194408
  isInTopLevelContext,
194195
194409
  isInTypeQuery,
194410
+ isIncrementalBuildInfo,
194411
+ isIncrementalBundleEmitBuildInfo,
194196
194412
  isIncrementalCompilation,
194197
194413
  isIndexSignatureDeclaration,
194198
194414
  isIndexedAccessTypeNode,
@@ -194335,6 +194551,7 @@ if (typeof console !== "undefined") {
194335
194551
  isModuleBlock,
194336
194552
  isModuleBody,
194337
194553
  isModuleDeclaration,
194554
+ isModuleExportName,
194338
194555
  isModuleExportsAccessExpression,
194339
194556
  isModuleIdentifier,
194340
194557
  isModuleName,
@@ -194428,7 +194645,6 @@ if (typeof console !== "undefined") {
194428
194645
  isPrivateIdentifierClassElementDeclaration,
194429
194646
  isPrivateIdentifierPropertyAccessExpression,
194430
194647
  isPrivateIdentifierSymbol,
194431
- isProgramBundleEmitBuildInfo,
194432
194648
  isProgramUptoDate,
194433
194649
  isPrologueDirective,
194434
194650
  isPropertyAccessChain,
@@ -194652,6 +194868,9 @@ if (typeof console !== "undefined") {
194652
194868
  missingFileModifiedTime,
194653
194869
  modifierToFlag,
194654
194870
  modifiersToFlags,
194871
+ moduleExportNameIsDefault,
194872
+ moduleExportNameTextEscaped,
194873
+ moduleExportNameTextUnescaped,
194655
194874
  moduleOptionDeclaration,
194656
194875
  moduleResolutionIsEqualTo,
194657
194876
  moduleResolutionNameAndModeGetter,
@@ -194797,7 +195016,7 @@ if (typeof console !== "undefined") {
194797
195016
  reducePathComponents,
194798
195017
  refactor,
194799
195018
  regExpEscape,
194800
- regularExpressionFlagToCharacter,
195019
+ regularExpressionFlagToCharacterCode,
194801
195020
  relativeComplement,
194802
195021
  removeAllComments,
194803
195022
  removeEmitHelper,
@@ -195055,7 +195274,6 @@ if (typeof console !== "undefined") {
195055
195274
  unusedLabelIsError,
195056
195275
  unwrapInnermostStatementOfLabel,
195057
195276
  unwrapParenthesizedExpression,
195058
- unwrapParenthesizedType,
195059
195277
  updateErrorForNoInputFiles,
195060
195278
  updateLanguageServiceSourceFile,
195061
195279
  updateMissingFilePathsWatch,