typescript 4.9.0-dev.20220929 → 4.9.0-dev.20221001

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/protocol.d.ts CHANGED
@@ -501,9 +501,16 @@ declare namespace ts.server.protocol {
501
501
  arguments: OrganizeImportsRequestArgs;
502
502
  }
503
503
  type OrganizeImportsScope = GetCombinedCodeFixScope;
504
+ const enum OrganizeImportsMode {
505
+ All = "All",
506
+ SortAndCombine = "SortAndCombine",
507
+ RemoveUnused = "RemoveUnused"
508
+ }
504
509
  interface OrganizeImportsRequestArgs {
505
510
  scope: OrganizeImportsScope;
511
+ /** @deprecated Use `mode` instead */
506
512
  skipDestructiveCodeActions?: boolean;
513
+ mode?: OrganizeImportsMode;
507
514
  }
508
515
  interface OrganizeImportsResponse extends Response {
509
516
  body: readonly FileCodeEdits[];
package/lib/tsc.js CHANGED
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.9";
72
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220929");
72
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221001");
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -8350,7 +8350,7 @@ var ts;
8350
8350
  return -1;
8351
8351
  }
8352
8352
  function peekExtendedUnicodeEscape() {
8353
- if (languageVersion >= 2 && codePointAt(text, pos + 1) === 117 && codePointAt(text, pos + 2) === 123) {
8353
+ if (codePointAt(text, pos + 1) === 117 && codePointAt(text, pos + 2) === 123) {
8354
8354
  var start_2 = pos;
8355
8355
  pos += 3;
8356
8356
  var escapedValueString = scanMinimumNumberOfHexDigits(1, false);
@@ -18485,7 +18485,7 @@ var ts;
18485
18485
  nextAutoGenerateId++;
18486
18486
  return node;
18487
18487
  }
18488
- function createIdentifier(text, typeArguments, originalKeywordKind) {
18488
+ function createIdentifier(text, typeArguments, originalKeywordKind, hasExtendedUnicodeEscape) {
18489
18489
  var node = createBaseIdentifier(text, originalKeywordKind);
18490
18490
  if (typeArguments) {
18491
18491
  node.typeArguments = createNodeArray(typeArguments);
@@ -18493,6 +18493,10 @@ var ts;
18493
18493
  if (node.originalKeywordKind === 133) {
18494
18494
  node.transformFlags |= 67108864;
18495
18495
  }
18496
+ if (hasExtendedUnicodeEscape) {
18497
+ node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
18498
+ node.transformFlags |= 1024;
18499
+ }
18496
18500
  return node;
18497
18501
  }
18498
18502
  function updateIdentifier(node, typeArguments) {
@@ -26760,8 +26764,9 @@ var ts;
26760
26764
  var pos = getNodePos();
26761
26765
  var originalKeywordKind = token();
26762
26766
  var text = internIdentifier(scanner.getTokenValue());
26767
+ var hasExtendedUnicodeEscape = scanner.hasExtendedUnicodeEscape();
26763
26768
  nextTokenWithoutCheck();
26764
- return finishNode(factory.createIdentifier(text, undefined, originalKeywordKind), pos);
26769
+ return finishNode(factory.createIdentifier(text, undefined, originalKeywordKind, hasExtendedUnicodeEscape), pos);
26765
26770
  }
26766
26771
  if (token() === 80) {
26767
26772
  parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
@@ -40589,6 +40594,12 @@ var ts;
40589
40594
  getOptionalType: function () { return optionalType; },
40590
40595
  getPromiseType: function () { return getGlobalPromiseType(false); },
40591
40596
  getPromiseLikeType: function () { return getGlobalPromiseLikeType(false); },
40597
+ getAsyncIterableType: function () {
40598
+ var type = getGlobalAsyncIterableType(false);
40599
+ if (type === emptyGenericType)
40600
+ return undefined;
40601
+ return type;
40602
+ },
40592
40603
  isSymbolAccessible: isSymbolAccessible,
40593
40604
  isArrayType: isArrayType,
40594
40605
  isTupleType: isTupleType,
@@ -41375,8 +41386,8 @@ var ts;
41375
41386
  return symbol;
41376
41387
  }
41377
41388
  if (symbol.flags & 2097152) {
41378
- var target = resolveAlias(symbol);
41379
- if (target === unknownSymbol || target.flags & meaning) {
41389
+ var targetFlags = getAllSymbolFlags(symbol);
41390
+ if (targetFlags & meaning) {
41380
41391
  return symbol;
41381
41392
  }
41382
41393
  }
@@ -41866,8 +41877,8 @@ var ts;
41866
41877
  !checkAndReportErrorForExtendingInterface(errorLocation) &&
41867
41878
  !checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) &&
41868
41879
  !checkAndReportErrorForExportingPrimitiveType(errorLocation, name) &&
41880
+ !checkAndReportErrorForUsingNamespaceAsTypeOrValue(errorLocation, name, meaning) &&
41869
41881
  !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) &&
41870
- !checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) &&
41871
41882
  !checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) {
41872
41883
  var suggestion = void 0;
41873
41884
  var suggestedLib = void 0;
@@ -41935,7 +41946,7 @@ var ts;
41935
41946
  }
41936
41947
  }
41937
41948
  if (result && errorLocation && meaning & 111551 && result.flags & 2097152 && !(result.flags & 111551) && !ts.isValidTypeOnlyAliasUseSite(errorLocation)) {
41938
- var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result);
41949
+ var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result, 111551);
41939
41950
  if (typeOnlyDeclaration) {
41940
41951
  var message = typeOnlyDeclaration.kind === 278
41941
41952
  ? ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type
@@ -42088,7 +42099,7 @@ var ts;
42088
42099
  return false;
42089
42100
  }
42090
42101
  function checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) {
42091
- if (meaning & (111551 & ~1024)) {
42102
+ if (meaning & 111551) {
42092
42103
  if (isPrimitiveTypeName(name)) {
42093
42104
  if (isExtendedByInterface(errorLocation)) {
42094
42105
  error(errorLocation, ts.Diagnostics.An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes, ts.unescapeLeadingUnderscores(name));
@@ -42099,7 +42110,8 @@ var ts;
42099
42110
  return true;
42100
42111
  }
42101
42112
  var symbol = resolveSymbol(resolveName(errorLocation, name, 788968 & ~111551, undefined, undefined, false));
42102
- if (symbol && !(symbol.flags & 1024)) {
42113
+ var allFlags = symbol && getAllSymbolFlags(symbol);
42114
+ if (symbol && allFlags !== undefined && !(allFlags & 111551)) {
42103
42115
  var rawName = ts.unescapeLeadingUnderscores(name);
42104
42116
  if (isES2015OrLaterConstructorName(name)) {
42105
42117
  error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later, rawName);
@@ -42147,16 +42159,16 @@ var ts;
42147
42159
  }
42148
42160
  return false;
42149
42161
  }
42150
- function checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) {
42151
- if (meaning & (111551 & ~1024 & ~788968)) {
42152
- var symbol = resolveSymbol(resolveName(errorLocation, name, 1024 & ~111551, undefined, undefined, false));
42162
+ function checkAndReportErrorForUsingNamespaceAsTypeOrValue(errorLocation, name, meaning) {
42163
+ if (meaning & (111551 & ~788968)) {
42164
+ var symbol = resolveSymbol(resolveName(errorLocation, name, 1024, undefined, undefined, false));
42153
42165
  if (symbol) {
42154
42166
  error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_value, ts.unescapeLeadingUnderscores(name));
42155
42167
  return true;
42156
42168
  }
42157
42169
  }
42158
- else if (meaning & (788968 & ~1024 & ~111551)) {
42159
- var symbol = resolveSymbol(resolveName(errorLocation, name, (512 | 1024) & ~788968, undefined, undefined, false));
42170
+ else if (meaning & (788968 & ~111551)) {
42171
+ var symbol = resolveSymbol(resolveName(errorLocation, name, 1536, undefined, undefined, false));
42160
42172
  if (symbol) {
42161
42173
  error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_type, ts.unescapeLeadingUnderscores(name));
42162
42174
  return true;
@@ -42687,6 +42699,30 @@ var ts;
42687
42699
  }
42688
42700
  return undefined;
42689
42701
  }
42702
+ function getAllSymbolFlags(symbol) {
42703
+ var flags = symbol.flags;
42704
+ var seenSymbols;
42705
+ while (symbol.flags & 2097152) {
42706
+ var target = resolveAlias(symbol);
42707
+ if (target === unknownSymbol) {
42708
+ return 67108863;
42709
+ }
42710
+ if (target === symbol || (seenSymbols === null || seenSymbols === void 0 ? void 0 : seenSymbols.has(target))) {
42711
+ break;
42712
+ }
42713
+ if (target.flags & 2097152) {
42714
+ if (seenSymbols) {
42715
+ seenSymbols.add(target);
42716
+ }
42717
+ else {
42718
+ seenSymbols = new ts.Set([symbol, target]);
42719
+ }
42720
+ }
42721
+ flags |= target.flags;
42722
+ symbol = target;
42723
+ }
42724
+ return flags;
42725
+ }
42690
42726
  function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty) {
42691
42727
  if (!aliasDeclaration || ts.isPropertyAccessExpression(aliasDeclaration))
42692
42728
  return false;
@@ -42709,19 +42745,25 @@ var ts;
42709
42745
  }
42710
42746
  return !!aliasDeclarationLinks.typeOnlyDeclaration;
42711
42747
  }
42712
- function getTypeOnlyAliasDeclaration(symbol) {
42748
+ function getTypeOnlyAliasDeclaration(symbol, include) {
42713
42749
  if (!(symbol.flags & 2097152)) {
42714
42750
  return undefined;
42715
42751
  }
42716
42752
  var links = getSymbolLinks(symbol);
42717
- return links.typeOnlyDeclaration || undefined;
42753
+ if (include === undefined) {
42754
+ return links.typeOnlyDeclaration || undefined;
42755
+ }
42756
+ if (links.typeOnlyDeclaration) {
42757
+ return getAllSymbolFlags(resolveAlias(links.typeOnlyDeclaration.symbol)) & include ? links.typeOnlyDeclaration : undefined;
42758
+ }
42759
+ return undefined;
42718
42760
  }
42719
42761
  function markExportAsReferenced(node) {
42720
42762
  var symbol = getSymbolOfNode(node);
42721
42763
  var target = resolveAlias(symbol);
42722
42764
  if (target) {
42723
42765
  var markAlias = target === unknownSymbol ||
42724
- ((target.flags & 111551) && !isConstEnumOrConstEnumOnlyModule(target) && !getTypeOnlyAliasDeclaration(symbol));
42766
+ ((getAllSymbolFlags(target) & 111551) && !isConstEnumOrConstEnumOnlyModule(target) && !getTypeOnlyAliasDeclaration(symbol, 111551));
42725
42767
  if (markAlias) {
42726
42768
  markAliasSymbolAsReferenced(symbol);
42727
42769
  }
@@ -42735,8 +42777,7 @@ var ts;
42735
42777
  if (!node)
42736
42778
  return ts.Debug.fail();
42737
42779
  if (ts.isInternalModuleImportEqualsDeclaration(node)) {
42738
- var target = resolveSymbol(symbol);
42739
- if (target === unknownSymbol || target.flags & 111551) {
42780
+ if (getAllSymbolFlags(resolveSymbol(symbol)) & 111551) {
42740
42781
  checkExpressionCached(node.moduleReference);
42741
42782
  }
42742
42783
  }
@@ -43466,7 +43507,7 @@ var ts;
43466
43507
  }
43467
43508
  function symbolIsValue(symbol, includeTypeOnlyMembers) {
43468
43509
  return !!(symbol.flags & 111551 ||
43469
- symbol.flags & 2097152 && resolveAlias(symbol).flags & 111551 && (includeTypeOnlyMembers || !getTypeOnlyAliasDeclaration(symbol)));
43510
+ symbol.flags & 2097152 && getAllSymbolFlags(symbol) & 111551 && (includeTypeOnlyMembers || !getTypeOnlyAliasDeclaration(symbol)));
43470
43511
  }
43471
43512
  function findConstructorDeclaration(node) {
43472
43513
  var members = node.members;
@@ -43693,8 +43734,10 @@ var ts;
43693
43734
  if (symbolFromSymbolTable === symbol) {
43694
43735
  return true;
43695
43736
  }
43696
- symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 278)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
43697
- if (symbolFromSymbolTable.flags & meaning) {
43737
+ var shouldResolveAlias = (symbolFromSymbolTable.flags & 2097152 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 278));
43738
+ symbolFromSymbolTable = shouldResolveAlias ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
43739
+ var flags = shouldResolveAlias ? getAllSymbolFlags(symbolFromSymbolTable) : symbolFromSymbolTable.flags;
43740
+ if (flags & meaning) {
43698
43741
  qualify = true;
43699
43742
  return true;
43700
43743
  }
@@ -46076,7 +46119,7 @@ var ts;
46076
46119
  return !symbol.exports ? [] : ts.filter(ts.arrayFrom(symbol.exports.values()), isNamespaceMember);
46077
46120
  }
46078
46121
  function isTypeOnlyNamespace(symbol) {
46079
- return ts.every(getNamespaceMembersForSerialization(symbol), function (m) { return !(resolveSymbol(m).flags & 111551); });
46122
+ return ts.every(getNamespaceMembersForSerialization(symbol), function (m) { return !(getAllSymbolFlags(resolveSymbol(m)) & 111551); });
46080
46123
  }
46081
46124
  function serializeModule(symbol, symbolName, modifierFlags) {
46082
46125
  var members = getNamespaceMembersForSerialization(symbol);
@@ -47949,7 +47992,7 @@ var ts;
47949
47992
  links.type = (exportSymbol === null || exportSymbol === void 0 ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol)
47950
47993
  : isDuplicatedCommonJSExport(symbol.declarations) ? autoType
47951
47994
  : declaredType ? declaredType
47952
- : targetSymbol.flags & 111551 ? getTypeOfSymbol(targetSymbol)
47995
+ : getAllSymbolFlags(targetSymbol) & 111551 ? getTypeOfSymbol(targetSymbol)
47953
47996
  : errorType;
47954
47997
  }
47955
47998
  return links.type;
@@ -49983,7 +50026,7 @@ var ts;
49983
50026
  var propSet;
49984
50027
  var indexTypes;
49985
50028
  var isUnion = containingType.flags & 1048576;
49986
- var optionalFlag = isUnion ? 0 : 16777216;
50029
+ var optionalFlag;
49987
50030
  var syntheticFlag = 4;
49988
50031
  var checkFlags = isUnion ? 0 : 8;
49989
50032
  var mergedInstantiations = false;
@@ -49994,11 +50037,14 @@ var ts;
49994
50037
  var prop = getPropertyOfType(type, name, skipObjectFunctionPropertyAugment);
49995
50038
  var modifiers = prop ? ts.getDeclarationModifierFlagsFromSymbol(prop) : 0;
49996
50039
  if (prop) {
49997
- if (isUnion) {
49998
- optionalFlag |= (prop.flags & 16777216);
49999
- }
50000
- else {
50001
- optionalFlag &= prop.flags;
50040
+ if (prop.flags & 106500) {
50041
+ optionalFlag !== null && optionalFlag !== void 0 ? optionalFlag : (optionalFlag = isUnion ? 0 : 16777216);
50042
+ if (isUnion) {
50043
+ optionalFlag |= (prop.flags & 16777216);
50044
+ }
50045
+ else {
50046
+ optionalFlag &= prop.flags;
50047
+ }
50002
50048
  }
50003
50049
  if (!singleProp) {
50004
50050
  singleProp = prop;
@@ -50106,7 +50152,7 @@ var ts;
50106
50152
  propTypes.push(type);
50107
50153
  }
50108
50154
  ts.addRange(propTypes, indexTypes);
50109
- var result = createSymbol(4 | optionalFlag, name, syntheticFlag | checkFlags);
50155
+ var result = createSymbol(4 | (optionalFlag !== null && optionalFlag !== void 0 ? optionalFlag : 0), name, syntheticFlag | checkFlags);
50110
50156
  result.containingType = containingType;
50111
50157
  if (!hasNonUniformValueDeclaration && firstValueDeclaration) {
50112
50158
  result.valueDeclaration = firstValueDeclaration;
@@ -56458,7 +56504,7 @@ var ts;
56458
56504
  }
56459
56505
  return 0;
56460
56506
  }
56461
- if (!skipOptional && sourceProp.flags & 16777216 && !(targetProp.flags & 16777216)) {
56507
+ if (!skipOptional && sourceProp.flags & 16777216 && targetProp.flags & 106500 && !(targetProp.flags & 16777216)) {
56462
56508
  if (reportErrors) {
56463
56509
  reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target));
56464
56510
  }
@@ -61064,9 +61110,9 @@ var ts;
61064
61110
  });
61065
61111
  }
61066
61112
  function markAliasReferenced(symbol, location) {
61067
- if (isNonLocalAlias(symbol, 111551) && !isInTypeQuery(location) && !getTypeOnlyAliasDeclaration(symbol)) {
61113
+ if (isNonLocalAlias(symbol, 111551) && !isInTypeQuery(location) && !getTypeOnlyAliasDeclaration(symbol, 111551)) {
61068
61114
  var target = resolveAlias(symbol);
61069
- if (target.flags & 111551) {
61115
+ if (getAllSymbolFlags(target) & 111551) {
61070
61116
  if (compilerOptions.isolatedModules ||
61071
61117
  ts.shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(location) ||
61072
61118
  !isConstEnumOrConstEnumOnlyModule(target)) {
@@ -62217,7 +62263,7 @@ var ts;
62217
62263
  function instantiateContextualType(contextualType, node, contextFlags) {
62218
62264
  if (contextualType && maybeTypeOfKind(contextualType, 465829888)) {
62219
62265
  var inferenceContext = getInferenceContext(node);
62220
- if (inferenceContext && contextFlags & 1 && ts.some(inferenceContext.inferences, hasInferenceCandidates)) {
62266
+ if (inferenceContext && contextFlags & 1 && ts.some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
62221
62267
  return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
62222
62268
  }
62223
62269
  if (inferenceContext === null || inferenceContext === void 0 ? void 0 : inferenceContext.returnMapper) {
@@ -66016,7 +66062,7 @@ var ts;
66016
66062
  if (symbol && symbol.flags & 2097152) {
66017
66063
  symbol = resolveAlias(symbol);
66018
66064
  }
66019
- return !!(symbol && (symbol.flags & 384) && getEnumKind(symbol) === 1);
66065
+ return !!(symbol && (getAllSymbolFlags(symbol) & 384) && getEnumKind(symbol) === 1);
66020
66066
  }
66021
66067
  return false;
66022
66068
  }
@@ -68166,6 +68212,9 @@ var ts;
68166
68212
  function hasInferenceCandidates(info) {
68167
68213
  return !!(info.candidates || info.contraCandidates);
68168
68214
  }
68215
+ function hasInferenceCandidatesOrDefault(info) {
68216
+ return !!(info.candidates || info.contraCandidates || hasTypeParameterDefault(info.typeParameter));
68217
+ }
68169
68218
  function hasOverlappingInferences(a, b) {
68170
68219
  for (var i = 0; i < a.length; i++) {
68171
68220
  if (hasInferenceCandidates(a[i]) && hasInferenceCandidates(b[i])) {
@@ -71357,7 +71406,13 @@ var ts;
71357
71406
  var message = allowAsyncIterables
71358
71407
  ? ts.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator
71359
71408
  : ts.Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator;
71360
- return errorAndMaybeSuggestAwait(errorNode, !!getAwaitedTypeOfPromise(type), message, typeToString(type));
71409
+ var suggestAwait = !!getAwaitedTypeOfPromise(type)
71410
+ || (!allowAsyncIterables &&
71411
+ ts.isForOfStatement(errorNode.parent) &&
71412
+ errorNode.parent.expression === errorNode &&
71413
+ getGlobalAsyncIterableType(false) !== emptyGenericType &&
71414
+ isTypeAssignableTo(type, getGlobalAsyncIterableType(false)));
71415
+ return errorAndMaybeSuggestAwait(errorNode, suggestAwait, message, typeToString(type));
71361
71416
  }
71362
71417
  function getIterationTypesOfIterator(type, resolver, errorNode, errorOutputContainer) {
71363
71418
  return getIterationTypesOfIteratorWorker(type, resolver, errorNode, errorOutputContainer, false);
@@ -72951,10 +73006,11 @@ var ts;
72951
73006
  }
72952
73007
  return;
72953
73008
  }
73009
+ var targetFlags = getAllSymbolFlags(target);
72954
73010
  var excludedMeanings = (symbol.flags & (111551 | 1048576) ? 111551 : 0) |
72955
73011
  (symbol.flags & 788968 ? 788968 : 0) |
72956
73012
  (symbol.flags & 1920 ? 1920 : 0);
72957
- if (target.flags & excludedMeanings) {
73013
+ if (targetFlags & excludedMeanings) {
72958
73014
  var message = node.kind === 278 ?
72959
73015
  ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 :
72960
73016
  ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
@@ -72964,7 +73020,7 @@ var ts;
72964
73020
  && !ts.isTypeOnlyImportOrExportDeclaration(node)
72965
73021
  && !(node.flags & 16777216)) {
72966
73022
  var typeOnlyAlias = getTypeOnlyAliasDeclaration(symbol);
72967
- var isType = !(target.flags & 111551);
73023
+ var isType = !(targetFlags & 111551);
72968
73024
  if (isType || typeOnlyAlias) {
72969
73025
  switch (node.kind) {
72970
73026
  case 270:
@@ -73118,13 +73174,14 @@ var ts;
73118
73174
  if (node.moduleReference.kind !== 280) {
73119
73175
  var target = resolveAlias(getSymbolOfNode(node));
73120
73176
  if (target !== unknownSymbol) {
73121
- if (target.flags & 111551) {
73177
+ var targetFlags = getAllSymbolFlags(target);
73178
+ if (targetFlags & 111551) {
73122
73179
  var moduleName = ts.getFirstIdentifier(node.moduleReference);
73123
73180
  if (!(resolveEntityName(moduleName, 111551 | 1920).flags & 1920)) {
73124
73181
  error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.declarationNameToString(moduleName));
73125
73182
  }
73126
73183
  }
73127
- if (target.flags & 788968) {
73184
+ if (targetFlags & 788968) {
73128
73185
  checkTypeNameIsReserved(node.name, ts.Diagnostics.Import_name_cannot_be_0);
73129
73186
  }
73130
73187
  }
@@ -73251,7 +73308,7 @@ var ts;
73251
73308
  markExportAsReferenced(node);
73252
73309
  }
73253
73310
  var target = symbol && (symbol.flags & 2097152 ? resolveAlias(symbol) : symbol);
73254
- if (!target || target === unknownSymbol || target.flags & 111551) {
73311
+ if (!target || getAllSymbolFlags(target) & 111551) {
73255
73312
  checkExpressionCached(node.propertyName || node.name);
73256
73313
  }
73257
73314
  }
@@ -73295,7 +73352,7 @@ var ts;
73295
73352
  if (sym) {
73296
73353
  markAliasReferenced(sym, id);
73297
73354
  var target = sym.flags & 2097152 ? resolveAlias(sym) : sym;
73298
- if (target === unknownSymbol || target.flags & 111551) {
73355
+ if (getAllSymbolFlags(target) & 111551) {
73299
73356
  checkExpressionCached(node.expression);
73300
73357
  }
73301
73358
  }
@@ -74467,7 +74524,7 @@ var ts;
74467
74524
  return symbolLinks.exportsSomeValue;
74468
74525
  function isValue(s) {
74469
74526
  s = resolveSymbol(s);
74470
- return s && !!(s.flags & 111551);
74527
+ return s && !!(getAllSymbolFlags(s) & 111551);
74471
74528
  }
74472
74529
  }
74473
74530
  function isNameOfModuleOrEnumDeclaration(node) {
@@ -74506,7 +74563,7 @@ var ts;
74506
74563
  var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier);
74507
74564
  if (node) {
74508
74565
  var symbol = getReferencedValueOrAliasSymbol(node);
74509
- if (isNonLocalAlias(symbol, 111551) && !getTypeOnlyAliasDeclaration(symbol)) {
74566
+ if (isNonLocalAlias(symbol, 111551) && !getTypeOnlyAliasDeclaration(symbol, 111551)) {
74510
74567
  return getDeclarationOfAliasSymbol(symbol);
74511
74568
  }
74512
74569
  }
@@ -74573,7 +74630,7 @@ var ts;
74573
74630
  case 273:
74574
74631
  case 278:
74575
74632
  var symbol = getSymbolOfNode(node);
74576
- return !!symbol && isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol);
74633
+ return !!symbol && isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol, 111551);
74577
74634
  case 275:
74578
74635
  var exportClause = node.exportClause;
74579
74636
  return !!exportClause && (ts.isNamespaceExport(exportClause) ||
@@ -74594,6 +74651,7 @@ var ts;
74594
74651
  return isValue && node.moduleReference && !ts.nodeIsMissing(node.moduleReference);
74595
74652
  }
74596
74653
  function isAliasResolvedToValue(symbol) {
74654
+ var _a;
74597
74655
  if (!symbol) {
74598
74656
  return false;
74599
74657
  }
@@ -74601,7 +74659,7 @@ var ts;
74601
74659
  if (target === unknownSymbol) {
74602
74660
  return true;
74603
74661
  }
74604
- return !!(target.flags & 111551) &&
74662
+ return !!(((_a = getAllSymbolFlags(target)) !== null && _a !== void 0 ? _a : -1) & 111551) &&
74605
74663
  (ts.shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target));
74606
74664
  }
74607
74665
  function isConstEnumOrConstEnumOnlyModule(s) {
@@ -74616,7 +74674,7 @@ var ts;
74616
74674
  }
74617
74675
  var target = getSymbolLinks(symbol).aliasTarget;
74618
74676
  if (target && ts.getEffectiveModifierFlags(node) & 1 &&
74619
- target.flags & 111551 &&
74677
+ getAllSymbolFlags(target) & 111551 &&
74620
74678
  (ts.shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) {
74621
74679
  return true;
74622
74680
  }
@@ -84769,11 +84827,13 @@ var ts;
84769
84827
  return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context);
84770
84828
  }
84771
84829
  function visitIdentifier(node) {
84772
- if (!convertedLoopState) {
84773
- return node;
84830
+ if (convertedLoopState) {
84831
+ if (resolver.isArgumentsLocalBinding(node)) {
84832
+ return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory.createUniqueName("arguments"));
84833
+ }
84774
84834
  }
84775
- if (resolver.isArgumentsLocalBinding(node)) {
84776
- return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory.createUniqueName("arguments"));
84835
+ if (node.hasExtendedUnicodeEscape) {
84836
+ return ts.setOriginalNode(ts.setTextRange(factory.createIdentifier(ts.unescapeLeadingUnderscores(node.escapedText)), node), node);
84777
84837
  }
84778
84838
  return node;
84779
84839
  }