typescript 4.9.0-dev.20221020 → 4.9.0-dev.20221022

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
@@ -99,7 +99,7 @@ var ts;
99
99
  // The following is baselined as a literal template type without intervention
100
100
  /** The version of the TypeScript compiler release */
101
101
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
102
- ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221020");
102
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221022");
103
103
  /* @internal */
104
104
  var Comparison;
105
105
  (function (Comparison) {
@@ -1891,8 +1891,8 @@ var ts;
1891
1891
  return compareValues(a === null || a === void 0 ? void 0 : a.start, b === null || b === void 0 ? void 0 : b.start) || compareValues(a === null || a === void 0 ? void 0 : a.length, b === null || b === void 0 ? void 0 : b.length);
1892
1892
  }
1893
1893
  ts.compareTextSpans = compareTextSpans;
1894
- function min(a, b, compare) {
1895
- return compare(a, b) === -1 /* Comparison.LessThan */ ? a : b;
1894
+ function min(items, compare) {
1895
+ return reduceLeft(items, function (x, y) { return compare(x, y) === -1 /* Comparison.LessThan */ ? x : y; });
1896
1896
  }
1897
1897
  ts.min = min;
1898
1898
  /**
@@ -5109,8 +5109,8 @@ var ts;
5109
5109
  NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 256] = "SuperInstance";
5110
5110
  NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 512] = "SuperStatic";
5111
5111
  NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 1024] = "ContextChecked";
5112
- NodeCheckFlags[NodeCheckFlags["AsyncMethodWithSuper"] = 2048] = "AsyncMethodWithSuper";
5113
- NodeCheckFlags[NodeCheckFlags["AsyncMethodWithSuperBinding"] = 4096] = "AsyncMethodWithSuperBinding";
5112
+ NodeCheckFlags[NodeCheckFlags["MethodWithSuperPropertyAccessInAsync"] = 2048] = "MethodWithSuperPropertyAccessInAsync";
5113
+ NodeCheckFlags[NodeCheckFlags["MethodWithSuperPropertyAssignmentInAsync"] = 4096] = "MethodWithSuperPropertyAssignmentInAsync";
5114
5114
  NodeCheckFlags[NodeCheckFlags["CaptureArguments"] = 8192] = "CaptureArguments";
5115
5115
  NodeCheckFlags[NodeCheckFlags["EnumValuesComputed"] = 16384] = "EnumValuesComputed";
5116
5116
  NodeCheckFlags[NodeCheckFlags["LexicalModuleMergesWithClass"] = 32768] = "LexicalModuleMergesWithClass";
@@ -42261,12 +42261,23 @@ var ts;
42261
42261
  }
42262
42262
  function writeConfigurations() {
42263
42263
  // Filter applicable options to place in the file
42264
- var categorizedOptions = ts.createMultiMap();
42264
+ var categorizedOptions = new ts.Map();
42265
+ // Set allowed categories in order
42266
+ categorizedOptions.set(ts.Diagnostics.Projects, []);
42267
+ categorizedOptions.set(ts.Diagnostics.Language_and_Environment, []);
42268
+ categorizedOptions.set(ts.Diagnostics.Modules, []);
42269
+ categorizedOptions.set(ts.Diagnostics.JavaScript_Support, []);
42270
+ categorizedOptions.set(ts.Diagnostics.Emit, []);
42271
+ categorizedOptions.set(ts.Diagnostics.Interop_Constraints, []);
42272
+ categorizedOptions.set(ts.Diagnostics.Type_Checking, []);
42273
+ categorizedOptions.set(ts.Diagnostics.Completeness, []);
42265
42274
  for (var _i = 0, optionDeclarations_1 = ts.optionDeclarations; _i < optionDeclarations_1.length; _i++) {
42266
42275
  var option = optionDeclarations_1[_i];
42267
- var category = option.category;
42268
42276
  if (isAllowedOptionForOutput(option)) {
42269
- categorizedOptions.add(ts.getLocaleSpecificMessage(category), option);
42277
+ var listForCategory = categorizedOptions.get(option.category);
42278
+ if (!listForCategory)
42279
+ categorizedOptions.set(option.category, listForCategory = []);
42280
+ listForCategory.push(option);
42270
42281
  }
42271
42282
  }
42272
42283
  // Serialize all options and their descriptions
@@ -42277,7 +42288,7 @@ var ts;
42277
42288
  if (entries.length !== 0) {
42278
42289
  entries.push({ value: "" });
42279
42290
  }
42280
- entries.push({ value: "/* ".concat(category, " */") });
42291
+ entries.push({ value: "/* ".concat(ts.getLocaleSpecificMessage(category), " */") });
42281
42292
  for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
42282
42293
  var option = options_1[_i];
42283
42294
  var optionName = void 0;
@@ -73288,7 +73299,7 @@ var ts;
73288
73299
  // We only look for uninitialized variables in strict null checking mode, and only when we can analyze
73289
73300
  // the entire control flow graph from the variable's declaration (i.e. when the flow container and
73290
73301
  // declaration container are the same).
73291
- var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) ||
73302
+ var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) ||
73292
73303
  type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 /* TypeFlags.AnyOrUnknown */ | 16384 /* TypeFlags.Void */)) !== 0 ||
73293
73304
  isInTypeQuery(node) || node.parent.kind === 278 /* SyntaxKind.ExportSpecifier */) ||
73294
73305
  node.parent.kind === 232 /* SyntaxKind.NonNullExpression */ ||
@@ -73317,6 +73328,12 @@ var ts;
73317
73328
  }
73318
73329
  return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType;
73319
73330
  }
73331
+ function isSameScopedBindingElement(node, declaration) {
73332
+ if (ts.isBindingElement(declaration)) {
73333
+ var bindingElement = ts.findAncestor(node, ts.isBindingElement);
73334
+ return bindingElement && ts.getRootDeclaration(bindingElement) === ts.getRootDeclaration(declaration);
73335
+ }
73336
+ }
73320
73337
  function shouldMarkIdentifierAliasReferenced(node) {
73321
73338
  var _a;
73322
73339
  var parent = node.parent;
@@ -73658,12 +73675,17 @@ var ts;
73658
73675
  var immediateContainer = ts.getSuperContainer(node, /*stopOnFunctions*/ true);
73659
73676
  var container = immediateContainer;
73660
73677
  var needToCaptureLexicalThis = false;
73678
+ var inAsyncFunction = false;
73661
73679
  // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting
73662
73680
  if (!isCallExpression) {
73663
73681
  while (container && container.kind === 216 /* SyntaxKind.ArrowFunction */) {
73682
+ if (ts.hasSyntacticModifier(container, 512 /* ModifierFlags.Async */))
73683
+ inAsyncFunction = true;
73664
73684
  container = ts.getSuperContainer(container, /*stopOnFunctions*/ true);
73665
73685
  needToCaptureLexicalThis = languageVersion < 2 /* ScriptTarget.ES2015 */;
73666
73686
  }
73687
+ if (container && ts.hasSyntacticModifier(container, 512 /* ModifierFlags.Async */))
73688
+ inAsyncFunction = true;
73667
73689
  }
73668
73690
  var canUseSuperExpression = isLegalUsageOfSuperExpression(container);
73669
73691
  var nodeCheckFlag = 0;
@@ -73769,12 +73791,12 @@ var ts;
73769
73791
  // as a call expression cannot be used as the target of a destructuring assignment while a property access can.
73770
73792
  //
73771
73793
  // For element access expressions (`super[x]`), we emit a generic helper that forwards the element access in both situations.
73772
- if (container.kind === 171 /* SyntaxKind.MethodDeclaration */ && ts.hasSyntacticModifier(container, 512 /* ModifierFlags.Async */)) {
73794
+ if (container.kind === 171 /* SyntaxKind.MethodDeclaration */ && inAsyncFunction) {
73773
73795
  if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) {
73774
- getNodeLinks(container).flags |= 4096 /* NodeCheckFlags.AsyncMethodWithSuperBinding */;
73796
+ getNodeLinks(container).flags |= 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */;
73775
73797
  }
73776
73798
  else {
73777
- getNodeLinks(container).flags |= 2048 /* NodeCheckFlags.AsyncMethodWithSuper */;
73799
+ getNodeLinks(container).flags |= 2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */;
73778
73800
  }
73779
73801
  }
73780
73802
  if (needToCaptureLexicalThis) {
@@ -82930,7 +82952,7 @@ var ts;
82930
82952
  return typeAsPromise.promisedTypeOfPromise = getTypeArguments(type)[0];
82931
82953
  }
82932
82954
  // primitives with a `{ then() }` won't be unwrapped/adopted.
82933
- if (allTypesAssignableToKind(type, 131068 /* TypeFlags.Primitive */ | 131072 /* TypeFlags.Never */)) {
82955
+ if (allTypesAssignableToKind(getBaseConstraintOrType(type), 131068 /* TypeFlags.Primitive */ | 131072 /* TypeFlags.Never */)) {
82934
82956
  return undefined;
82935
82957
  }
82936
82958
  var thenFunction = getTypeOfPropertyOfType(type, "then"); // TODO: GH#18217
@@ -82997,7 +83019,7 @@ var ts;
82997
83019
  * Determines whether a type is an object with a callable `then` member.
82998
83020
  */
82999
83021
  function isThenableType(type) {
83000
- if (allTypesAssignableToKind(type, 131068 /* TypeFlags.Primitive */ | 131072 /* TypeFlags.Never */)) {
83022
+ if (allTypesAssignableToKind(getBaseConstraintOrType(type), 131068 /* TypeFlags.Primitive */ | 131072 /* TypeFlags.Never */)) {
83001
83023
  // primitive types cannot be considered "thenable" since they are not objects.
83002
83024
  return false;
83003
83025
  }
@@ -98496,8 +98518,11 @@ var ts;
98496
98518
  }
98497
98519
  return ts.visitEachChild(node, visitor, context);
98498
98520
  case 174 /* SyntaxKind.GetAccessor */:
98521
+ return doWithContext(1 /* ContextFlags.NonTopLevel */ | 2 /* ContextFlags.HasLexicalThis */, visitGetAccessorDeclaration, node);
98499
98522
  case 175 /* SyntaxKind.SetAccessor */:
98523
+ return doWithContext(1 /* ContextFlags.NonTopLevel */ | 2 /* ContextFlags.HasLexicalThis */, visitSetAccessorDeclaration, node);
98500
98524
  case 173 /* SyntaxKind.Constructor */:
98525
+ return doWithContext(1 /* ContextFlags.NonTopLevel */ | 2 /* ContextFlags.HasLexicalThis */, visitConstructorDeclaration, node);
98501
98526
  case 260 /* SyntaxKind.ClassDeclaration */:
98502
98527
  case 228 /* SyntaxKind.ClassExpression */:
98503
98528
  return doWithContext(1 /* ContextFlags.NonTopLevel */ | 2 /* ContextFlags.HasLexicalThis */, visitDefault, node);
@@ -98598,6 +98623,9 @@ var ts;
98598
98623
  return ts.setOriginalNode(ts.setTextRange(factory.createYieldExpression(
98599
98624
  /*asteriskToken*/ undefined, ts.visitNode(node.expression, visitor, ts.isExpression)), node), node);
98600
98625
  }
98626
+ function visitConstructorDeclaration(node) {
98627
+ return factory.updateConstructorDeclaration(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike), ts.visitParameterList(node.parameters, visitor, context), transformMethodBody(node));
98628
+ }
98601
98629
  /**
98602
98630
  * Visits a MethodDeclaration node.
98603
98631
  *
@@ -98612,7 +98640,14 @@ var ts;
98612
98640
  /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context),
98613
98641
  /*type*/ undefined, ts.getFunctionFlags(node) & 2 /* FunctionFlags.Async */
98614
98642
  ? transformAsyncFunctionBody(node)
98615
- : ts.visitFunctionBody(node.body, visitor, context));
98643
+ : transformMethodBody(node));
98644
+ }
98645
+ function visitGetAccessorDeclaration(node) {
98646
+ return factory.updateGetAccessorDeclaration(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike), node.name, ts.visitParameterList(node.parameters, visitor, context),
98647
+ /*type*/ undefined, transformMethodBody(node));
98648
+ }
98649
+ function visitSetAccessorDeclaration(node) {
98650
+ return factory.updateSetAccessorDeclaration(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike), node.name, ts.visitParameterList(node.parameters, visitor, context), transformMethodBody(node));
98616
98651
  }
98617
98652
  /**
98618
98653
  * Visits a FunctionDeclaration node.
@@ -98726,6 +98761,42 @@ var ts;
98726
98761
  }
98727
98762
  return false;
98728
98763
  }
98764
+ function transformMethodBody(node) {
98765
+ ts.Debug.assertIsDefined(node.body);
98766
+ var savedCapturedSuperProperties = capturedSuperProperties;
98767
+ var savedHasSuperElementAccess = hasSuperElementAccess;
98768
+ capturedSuperProperties = new ts.Set();
98769
+ hasSuperElementAccess = false;
98770
+ var updated = ts.visitFunctionBody(node.body, visitor, context);
98771
+ // Minor optimization, emit `_super` helper to capture `super` access in an arrow.
98772
+ // This step isn't needed if we eventually transform this to ES5.
98773
+ var originalMethod = ts.getOriginalNode(node, ts.isFunctionLikeDeclaration);
98774
+ var emitSuperHelpers = languageVersion >= 2 /* ScriptTarget.ES2015 */ &&
98775
+ resolver.getNodeCheckFlags(node) & (4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */ | 2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */) &&
98776
+ (ts.getFunctionFlags(originalMethod) & 3 /* FunctionFlags.AsyncGenerator */) !== 3 /* FunctionFlags.AsyncGenerator */;
98777
+ if (emitSuperHelpers) {
98778
+ enableSubstitutionForAsyncMethodsWithSuper();
98779
+ if (capturedSuperProperties.size) {
98780
+ var variableStatement = createSuperAccessVariableStatement(factory, resolver, node, capturedSuperProperties);
98781
+ substitutedSuperAccessors[ts.getNodeId(variableStatement)] = true;
98782
+ var statements = updated.statements.slice();
98783
+ ts.insertStatementsAfterStandardPrologue(statements, [variableStatement]);
98784
+ updated = factory.updateBlock(updated, statements);
98785
+ }
98786
+ if (hasSuperElementAccess) {
98787
+ // Emit helpers for super element access expressions (`super[x]`).
98788
+ if (resolver.getNodeCheckFlags(node) & 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */) {
98789
+ ts.addEmitHelper(updated, ts.advancedAsyncSuperHelper);
98790
+ }
98791
+ else if (resolver.getNodeCheckFlags(node) & 2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */) {
98792
+ ts.addEmitHelper(updated, ts.asyncSuperHelper);
98793
+ }
98794
+ }
98795
+ }
98796
+ capturedSuperProperties = savedCapturedSuperProperties;
98797
+ hasSuperElementAccess = savedHasSuperElementAccess;
98798
+ return updated;
98799
+ }
98729
98800
  function transformAsyncFunctionBody(node) {
98730
98801
  resumeLexicalEnvironment();
98731
98802
  var original = ts.getOriginalNode(node, ts.isFunctionLike);
@@ -98758,7 +98829,7 @@ var ts;
98758
98829
  ts.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
98759
98830
  // Minor optimization, emit `_super` helper to capture `super` access in an arrow.
98760
98831
  // This step isn't needed if we eventually transform this to ES5.
98761
- var emitSuperHelpers = languageVersion >= 2 /* ScriptTarget.ES2015 */ && resolver.getNodeCheckFlags(node) & (4096 /* NodeCheckFlags.AsyncMethodWithSuperBinding */ | 2048 /* NodeCheckFlags.AsyncMethodWithSuper */);
98832
+ var emitSuperHelpers = languageVersion >= 2 /* ScriptTarget.ES2015 */ && resolver.getNodeCheckFlags(node) & (4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */ | 2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */);
98762
98833
  if (emitSuperHelpers) {
98763
98834
  enableSubstitutionForAsyncMethodsWithSuper();
98764
98835
  if (capturedSuperProperties.size) {
@@ -98771,10 +98842,10 @@ var ts;
98771
98842
  ts.setTextRange(block, node.body);
98772
98843
  if (emitSuperHelpers && hasSuperElementAccess) {
98773
98844
  // Emit helpers for super element access expressions (`super[x]`).
98774
- if (resolver.getNodeCheckFlags(node) & 4096 /* NodeCheckFlags.AsyncMethodWithSuperBinding */) {
98845
+ if (resolver.getNodeCheckFlags(node) & 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */) {
98775
98846
  ts.addEmitHelper(block, ts.advancedAsyncSuperHelper);
98776
98847
  }
98777
- else if (resolver.getNodeCheckFlags(node) & 2048 /* NodeCheckFlags.AsyncMethodWithSuper */) {
98848
+ else if (resolver.getNodeCheckFlags(node) & 2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */) {
98778
98849
  ts.addEmitHelper(block, ts.asyncSuperHelper);
98779
98850
  }
98780
98851
  }
@@ -98846,7 +98917,7 @@ var ts;
98846
98917
  // If we need to support substitutions for `super` in an async method,
98847
98918
  // we should track it here.
98848
98919
  if (enabledSubstitutions & 1 /* ES2017SubstitutionFlags.AsyncMethodsWithSuper */ && isSuperContainer(node)) {
98849
- var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 /* NodeCheckFlags.AsyncMethodWithSuper */ | 4096 /* NodeCheckFlags.AsyncMethodWithSuperBinding */);
98920
+ var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */ | 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */);
98850
98921
  if (superContainerFlags !== enclosingSuperContainerFlags) {
98851
98922
  var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
98852
98923
  enclosingSuperContainerFlags = superContainerFlags;
@@ -98923,7 +98994,7 @@ var ts;
98923
98994
  || kind === 175 /* SyntaxKind.SetAccessor */;
98924
98995
  }
98925
98996
  function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
98926
- if (enclosingSuperContainerFlags & 4096 /* NodeCheckFlags.AsyncMethodWithSuperBinding */) {
98997
+ if (enclosingSuperContainerFlags & 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */) {
98927
98998
  return ts.setTextRange(factory.createPropertyAccessExpression(factory.createCallExpression(factory.createUniqueName("_superIndex", 16 /* GeneratedIdentifierFlags.Optimistic */ | 32 /* GeneratedIdentifierFlags.FileLevel */),
98928
98999
  /*typeArguments*/ undefined, [argumentExpression]), "value"), location);
98929
99000
  }
@@ -98938,7 +99009,7 @@ var ts;
98938
99009
  function createSuperAccessVariableStatement(factory, resolver, node, names) {
98939
99010
  // Create a variable declaration with a getter/setter (if binding) definition for each name:
98940
99011
  // const _super = Object.create(null, { x: { get: () => super.x, set: (v) => super.x = v }, ... });
98941
- var hasBinding = (resolver.getNodeCheckFlags(node) & 4096 /* NodeCheckFlags.AsyncMethodWithSuperBinding */) !== 0;
99012
+ var hasBinding = (resolver.getNodeCheckFlags(node) & 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */) !== 0;
98942
99013
  var accessors = [];
98943
99014
  names.forEach(function (_, key) {
98944
99015
  var name = ts.unescapeLeadingUnderscores(key);
@@ -99646,7 +99717,7 @@ var ts;
99646
99717
  /*type*/ undefined, factory.updateBlock(node.body, ts.visitLexicalEnvironment(node.body.statements, visitor, context, statementOffset))), !!(hierarchyFacts & 1 /* HierarchyFacts.HasLexicalThis */)));
99647
99718
  // Minor optimization, emit `_super` helper to capture `super` access in an arrow.
99648
99719
  // This step isn't needed if we eventually transform this to ES5.
99649
- var emitSuperHelpers = languageVersion >= 2 /* ScriptTarget.ES2015 */ && resolver.getNodeCheckFlags(node) & (4096 /* NodeCheckFlags.AsyncMethodWithSuperBinding */ | 2048 /* NodeCheckFlags.AsyncMethodWithSuper */);
99720
+ var emitSuperHelpers = languageVersion >= 2 /* ScriptTarget.ES2015 */ && resolver.getNodeCheckFlags(node) & (4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */ | 2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */);
99650
99721
  if (emitSuperHelpers) {
99651
99722
  enableSubstitutionForAsyncMethodsWithSuper();
99652
99723
  var variableStatement = ts.createSuperAccessVariableStatement(factory, resolver, node, capturedSuperProperties);
@@ -99657,10 +99728,10 @@ var ts;
99657
99728
  ts.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
99658
99729
  var block = factory.updateBlock(node.body, statements);
99659
99730
  if (emitSuperHelpers && hasSuperElementAccess) {
99660
- if (resolver.getNodeCheckFlags(node) & 4096 /* NodeCheckFlags.AsyncMethodWithSuperBinding */) {
99731
+ if (resolver.getNodeCheckFlags(node) & 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */) {
99661
99732
  ts.addEmitHelper(block, ts.advancedAsyncSuperHelper);
99662
99733
  }
99663
- else if (resolver.getNodeCheckFlags(node) & 2048 /* NodeCheckFlags.AsyncMethodWithSuper */) {
99734
+ else if (resolver.getNodeCheckFlags(node) & 2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */) {
99664
99735
  ts.addEmitHelper(block, ts.asyncSuperHelper);
99665
99736
  }
99666
99737
  }
@@ -99789,7 +99860,7 @@ var ts;
99789
99860
  // If we need to support substitutions for `super` in an async method,
99790
99861
  // we should track it here.
99791
99862
  if (enabledSubstitutions & 1 /* ESNextSubstitutionFlags.AsyncMethodsWithSuper */ && isSuperContainer(node)) {
99792
- var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 /* NodeCheckFlags.AsyncMethodWithSuper */ | 4096 /* NodeCheckFlags.AsyncMethodWithSuperBinding */);
99863
+ var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */ | 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */);
99793
99864
  if (superContainerFlags !== enclosingSuperContainerFlags) {
99794
99865
  var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
99795
99866
  enclosingSuperContainerFlags = superContainerFlags;
@@ -99866,7 +99937,7 @@ var ts;
99866
99937
  || kind === 175 /* SyntaxKind.SetAccessor */;
99867
99938
  }
99868
99939
  function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
99869
- if (enclosingSuperContainerFlags & 4096 /* NodeCheckFlags.AsyncMethodWithSuperBinding */) {
99940
+ if (enclosingSuperContainerFlags & 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */) {
99870
99941
  return ts.setTextRange(factory.createPropertyAccessExpression(factory.createCallExpression(factory.createIdentifier("_superIndex"),
99871
99942
  /*typeArguments*/ undefined, [argumentExpression]), "value"), location);
99872
99943
  }
@@ -123892,7 +123963,7 @@ var ts;
123892
123963
  var isNonDirectorySeparatorRoot = rootLength > 1 || dirPath.charCodeAt(0) !== 47 /* CharacterCodes.slash */;
123893
123964
  if (isNonDirectorySeparatorRoot &&
123894
123965
  dirPath.search(/[a-zA-Z]:/) !== 0 && // Non dos style paths
123895
- pathPartForUserCheck.search(/[a-zA-z]\$\//) === 0) { // Dos style nextPart
123966
+ pathPartForUserCheck.search(/[a-zA-Z]\$\//) === 0) { // Dos style nextPart
123896
123967
  nextDirectorySeparator = dirPath.indexOf(ts.directorySeparator, nextDirectorySeparator + 1);
123897
123968
  if (nextDirectorySeparator === -1) {
123898
123969
  // ignore "//vda1cs4850/c$/folderAtRoot"
@@ -125398,15 +125469,21 @@ var ts;
125398
125469
  return undefined;
125399
125470
  }
125400
125471
  function tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) {
125401
- var normalizedTargetPath = getPathRelativeToRootDirs(moduleFileName, rootDirs, getCanonicalFileName);
125402
- if (normalizedTargetPath === undefined) {
125472
+ var normalizedTargetPaths = getPathsRelativeToRootDirs(moduleFileName, rootDirs, getCanonicalFileName);
125473
+ if (normalizedTargetPaths === undefined) {
125474
+ return undefined;
125475
+ }
125476
+ var normalizedSourcePaths = getPathsRelativeToRootDirs(sourceDirectory, rootDirs, getCanonicalFileName);
125477
+ var relativePaths = ts.flatMap(normalizedSourcePaths, function (sourcePath) {
125478
+ return ts.map(normalizedTargetPaths, function (targetPath) { return ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(sourcePath, targetPath, getCanonicalFileName)); });
125479
+ });
125480
+ var shortest = ts.min(relativePaths, ts.compareNumberOfDirectorySeparators);
125481
+ if (!shortest) {
125403
125482
  return undefined;
125404
125483
  }
125405
- var normalizedSourcePath = getPathRelativeToRootDirs(sourceDirectory, rootDirs, getCanonicalFileName);
125406
- var relativePath = normalizedSourcePath !== undefined ? ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(normalizedSourcePath, normalizedTargetPath, getCanonicalFileName)) : normalizedTargetPath;
125407
125484
  return ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeJs
125408
- ? removeExtensionAndIndexPostFix(relativePath, ending, compilerOptions)
125409
- : ts.removeFileExtension(relativePath);
125485
+ ? removeExtensionAndIndexPostFix(shortest, ending, compilerOptions)
125486
+ : ts.removeFileExtension(shortest);
125410
125487
  }
125411
125488
  function tryGetModuleNameAsNodeModule(_a, _b, importingSourceFile, host, options, userPreferences, packageNameOnly, overrideMode) {
125412
125489
  var path = _a.path, isRedirect = _a.isRedirect;
@@ -125543,8 +125620,8 @@ var ts;
125543
125620
  }
125544
125621
  }
125545
125622
  }
125546
- function getPathRelativeToRootDirs(path, rootDirs, getCanonicalFileName) {
125547
- return ts.firstDefined(rootDirs, function (rootDir) {
125623
+ function getPathsRelativeToRootDirs(path, rootDirs, getCanonicalFileName) {
125624
+ return ts.mapDefined(rootDirs, function (rootDir) {
125548
125625
  var relativePath = getRelativePathIfInDirectory(path, rootDir, getCanonicalFileName);
125549
125626
  return relativePath !== undefined && isPathRelativeToParent(relativePath) ? undefined : relativePath;
125550
125627
  });
@@ -146053,7 +146130,7 @@ var ts;
146053
146130
  return bestMatch;
146054
146131
  }
146055
146132
  function betterMatch(a, b) {
146056
- return ts.min(a, b, compareMatches);
146133
+ return ts.min([a, b], compareMatches);
146057
146134
  }
146058
146135
  function compareMatches(a, b) {
146059
146136
  return a === undefined ? 1 /* Comparison.GreaterThan */ : b === undefined ? -1 /* Comparison.LessThan */