typescript 4.9.0-dev.20221021 → 4.9.0-dev.20221023
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/tsc.js +73 -17
- package/lib/tsserver.js +93 -33
- package/lib/tsserverlibrary.js +93 -33
- package/lib/typescript.js +93 -33
- package/lib/typescriptServices.js +93 -33
- package/lib/typingsInstaller.js +92 -32
- package/package.json +1 -1
package/lib/tsserverlibrary.js
CHANGED
|
@@ -108,7 +108,7 @@ var ts;
|
|
|
108
108
|
// The following is baselined as a literal template type without intervention
|
|
109
109
|
/** The version of the TypeScript compiler release */
|
|
110
110
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
111
|
-
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.
|
|
111
|
+
ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221023");
|
|
112
112
|
/* @internal */
|
|
113
113
|
var Comparison;
|
|
114
114
|
(function (Comparison) {
|
|
@@ -1900,8 +1900,8 @@ var ts;
|
|
|
1900
1900
|
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);
|
|
1901
1901
|
}
|
|
1902
1902
|
ts.compareTextSpans = compareTextSpans;
|
|
1903
|
-
function min(
|
|
1904
|
-
return compare(
|
|
1903
|
+
function min(items, compare) {
|
|
1904
|
+
return reduceLeft(items, function (x, y) { return compare(x, y) === -1 /* Comparison.LessThan */ ? x : y; });
|
|
1905
1905
|
}
|
|
1906
1906
|
ts.min = min;
|
|
1907
1907
|
/**
|
|
@@ -5118,8 +5118,8 @@ var ts;
|
|
|
5118
5118
|
NodeCheckFlags[NodeCheckFlags["SuperInstance"] = 256] = "SuperInstance";
|
|
5119
5119
|
NodeCheckFlags[NodeCheckFlags["SuperStatic"] = 512] = "SuperStatic";
|
|
5120
5120
|
NodeCheckFlags[NodeCheckFlags["ContextChecked"] = 1024] = "ContextChecked";
|
|
5121
|
-
NodeCheckFlags[NodeCheckFlags["
|
|
5122
|
-
NodeCheckFlags[NodeCheckFlags["
|
|
5121
|
+
NodeCheckFlags[NodeCheckFlags["MethodWithSuperPropertyAccessInAsync"] = 2048] = "MethodWithSuperPropertyAccessInAsync";
|
|
5122
|
+
NodeCheckFlags[NodeCheckFlags["MethodWithSuperPropertyAssignmentInAsync"] = 4096] = "MethodWithSuperPropertyAssignmentInAsync";
|
|
5123
5123
|
NodeCheckFlags[NodeCheckFlags["CaptureArguments"] = 8192] = "CaptureArguments";
|
|
5124
5124
|
NodeCheckFlags[NodeCheckFlags["EnumValuesComputed"] = 16384] = "EnumValuesComputed";
|
|
5125
5125
|
NodeCheckFlags[NodeCheckFlags["LexicalModuleMergesWithClass"] = 32768] = "LexicalModuleMergesWithClass";
|
|
@@ -63321,7 +63321,7 @@ var ts;
|
|
|
63321
63321
|
type.flags & 134217728 /* TypeFlags.TemplateLiteral */ ? getTemplateLiteralType.apply(void 0, applyTemplateStringMapping(symbol, type.texts, type.types)) :
|
|
63322
63322
|
// Mapping<Mapping<T>> === Mapping<T>
|
|
63323
63323
|
type.flags & 268435456 /* TypeFlags.StringMapping */ && symbol === type.symbol ? type :
|
|
63324
|
-
type.flags & (1 /* TypeFlags.Any */ | 4 /* TypeFlags.String */
|
|
63324
|
+
type.flags & (1 /* TypeFlags.Any */ | 4 /* TypeFlags.String */ | 268435456 /* TypeFlags.StringMapping */) || isGenericIndexType(type) ? getStringMappingTypeForGenericType(symbol, type) :
|
|
63325
63325
|
// This handles Mapping<`${number}`> and Mapping<`${bigint}`>
|
|
63326
63326
|
isPatternLiteralPlaceholderType(type) ? getStringMappingTypeForGenericType(symbol, getTemplateLiteralType(["", ""], [type])) :
|
|
63327
63327
|
type;
|
|
@@ -73684,12 +73684,17 @@ var ts;
|
|
|
73684
73684
|
var immediateContainer = ts.getSuperContainer(node, /*stopOnFunctions*/ true);
|
|
73685
73685
|
var container = immediateContainer;
|
|
73686
73686
|
var needToCaptureLexicalThis = false;
|
|
73687
|
+
var inAsyncFunction = false;
|
|
73687
73688
|
// adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting
|
|
73688
73689
|
if (!isCallExpression) {
|
|
73689
73690
|
while (container && container.kind === 216 /* SyntaxKind.ArrowFunction */) {
|
|
73691
|
+
if (ts.hasSyntacticModifier(container, 512 /* ModifierFlags.Async */))
|
|
73692
|
+
inAsyncFunction = true;
|
|
73690
73693
|
container = ts.getSuperContainer(container, /*stopOnFunctions*/ true);
|
|
73691
73694
|
needToCaptureLexicalThis = languageVersion < 2 /* ScriptTarget.ES2015 */;
|
|
73692
73695
|
}
|
|
73696
|
+
if (container && ts.hasSyntacticModifier(container, 512 /* ModifierFlags.Async */))
|
|
73697
|
+
inAsyncFunction = true;
|
|
73693
73698
|
}
|
|
73694
73699
|
var canUseSuperExpression = isLegalUsageOfSuperExpression(container);
|
|
73695
73700
|
var nodeCheckFlag = 0;
|
|
@@ -73795,12 +73800,12 @@ var ts;
|
|
|
73795
73800
|
// as a call expression cannot be used as the target of a destructuring assignment while a property access can.
|
|
73796
73801
|
//
|
|
73797
73802
|
// For element access expressions (`super[x]`), we emit a generic helper that forwards the element access in both situations.
|
|
73798
|
-
if (container.kind === 171 /* SyntaxKind.MethodDeclaration */ &&
|
|
73803
|
+
if (container.kind === 171 /* SyntaxKind.MethodDeclaration */ && inAsyncFunction) {
|
|
73799
73804
|
if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) {
|
|
73800
|
-
getNodeLinks(container).flags |= 4096 /* NodeCheckFlags.
|
|
73805
|
+
getNodeLinks(container).flags |= 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */;
|
|
73801
73806
|
}
|
|
73802
73807
|
else {
|
|
73803
|
-
getNodeLinks(container).flags |= 2048 /* NodeCheckFlags.
|
|
73808
|
+
getNodeLinks(container).flags |= 2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */;
|
|
73804
73809
|
}
|
|
73805
73810
|
}
|
|
73806
73811
|
if (needToCaptureLexicalThis) {
|
|
@@ -82956,7 +82961,7 @@ var ts;
|
|
|
82956
82961
|
return typeAsPromise.promisedTypeOfPromise = getTypeArguments(type)[0];
|
|
82957
82962
|
}
|
|
82958
82963
|
// primitives with a `{ then() }` won't be unwrapped/adopted.
|
|
82959
|
-
if (allTypesAssignableToKind(type, 131068 /* TypeFlags.Primitive */ | 131072 /* TypeFlags.Never */)) {
|
|
82964
|
+
if (allTypesAssignableToKind(getBaseConstraintOrType(type), 131068 /* TypeFlags.Primitive */ | 131072 /* TypeFlags.Never */)) {
|
|
82960
82965
|
return undefined;
|
|
82961
82966
|
}
|
|
82962
82967
|
var thenFunction = getTypeOfPropertyOfType(type, "then"); // TODO: GH#18217
|
|
@@ -83023,7 +83028,7 @@ var ts;
|
|
|
83023
83028
|
* Determines whether a type is an object with a callable `then` member.
|
|
83024
83029
|
*/
|
|
83025
83030
|
function isThenableType(type) {
|
|
83026
|
-
if (allTypesAssignableToKind(type, 131068 /* TypeFlags.Primitive */ | 131072 /* TypeFlags.Never */)) {
|
|
83031
|
+
if (allTypesAssignableToKind(getBaseConstraintOrType(type), 131068 /* TypeFlags.Primitive */ | 131072 /* TypeFlags.Never */)) {
|
|
83027
83032
|
// primitive types cannot be considered "thenable" since they are not objects.
|
|
83028
83033
|
return false;
|
|
83029
83034
|
}
|
|
@@ -98522,8 +98527,11 @@ var ts;
|
|
|
98522
98527
|
}
|
|
98523
98528
|
return ts.visitEachChild(node, visitor, context);
|
|
98524
98529
|
case 174 /* SyntaxKind.GetAccessor */:
|
|
98530
|
+
return doWithContext(1 /* ContextFlags.NonTopLevel */ | 2 /* ContextFlags.HasLexicalThis */, visitGetAccessorDeclaration, node);
|
|
98525
98531
|
case 175 /* SyntaxKind.SetAccessor */:
|
|
98532
|
+
return doWithContext(1 /* ContextFlags.NonTopLevel */ | 2 /* ContextFlags.HasLexicalThis */, visitSetAccessorDeclaration, node);
|
|
98526
98533
|
case 173 /* SyntaxKind.Constructor */:
|
|
98534
|
+
return doWithContext(1 /* ContextFlags.NonTopLevel */ | 2 /* ContextFlags.HasLexicalThis */, visitConstructorDeclaration, node);
|
|
98527
98535
|
case 260 /* SyntaxKind.ClassDeclaration */:
|
|
98528
98536
|
case 228 /* SyntaxKind.ClassExpression */:
|
|
98529
98537
|
return doWithContext(1 /* ContextFlags.NonTopLevel */ | 2 /* ContextFlags.HasLexicalThis */, visitDefault, node);
|
|
@@ -98624,6 +98632,9 @@ var ts;
|
|
|
98624
98632
|
return ts.setOriginalNode(ts.setTextRange(factory.createYieldExpression(
|
|
98625
98633
|
/*asteriskToken*/ undefined, ts.visitNode(node.expression, visitor, ts.isExpression)), node), node);
|
|
98626
98634
|
}
|
|
98635
|
+
function visitConstructorDeclaration(node) {
|
|
98636
|
+
return factory.updateConstructorDeclaration(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike), ts.visitParameterList(node.parameters, visitor, context), transformMethodBody(node));
|
|
98637
|
+
}
|
|
98627
98638
|
/**
|
|
98628
98639
|
* Visits a MethodDeclaration node.
|
|
98629
98640
|
*
|
|
@@ -98638,7 +98649,14 @@ var ts;
|
|
|
98638
98649
|
/*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context),
|
|
98639
98650
|
/*type*/ undefined, ts.getFunctionFlags(node) & 2 /* FunctionFlags.Async */
|
|
98640
98651
|
? transformAsyncFunctionBody(node)
|
|
98641
|
-
:
|
|
98652
|
+
: transformMethodBody(node));
|
|
98653
|
+
}
|
|
98654
|
+
function visitGetAccessorDeclaration(node) {
|
|
98655
|
+
return factory.updateGetAccessorDeclaration(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike), node.name, ts.visitParameterList(node.parameters, visitor, context),
|
|
98656
|
+
/*type*/ undefined, transformMethodBody(node));
|
|
98657
|
+
}
|
|
98658
|
+
function visitSetAccessorDeclaration(node) {
|
|
98659
|
+
return factory.updateSetAccessorDeclaration(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike), node.name, ts.visitParameterList(node.parameters, visitor, context), transformMethodBody(node));
|
|
98642
98660
|
}
|
|
98643
98661
|
/**
|
|
98644
98662
|
* Visits a FunctionDeclaration node.
|
|
@@ -98752,6 +98770,42 @@ var ts;
|
|
|
98752
98770
|
}
|
|
98753
98771
|
return false;
|
|
98754
98772
|
}
|
|
98773
|
+
function transformMethodBody(node) {
|
|
98774
|
+
ts.Debug.assertIsDefined(node.body);
|
|
98775
|
+
var savedCapturedSuperProperties = capturedSuperProperties;
|
|
98776
|
+
var savedHasSuperElementAccess = hasSuperElementAccess;
|
|
98777
|
+
capturedSuperProperties = new ts.Set();
|
|
98778
|
+
hasSuperElementAccess = false;
|
|
98779
|
+
var updated = ts.visitFunctionBody(node.body, visitor, context);
|
|
98780
|
+
// Minor optimization, emit `_super` helper to capture `super` access in an arrow.
|
|
98781
|
+
// This step isn't needed if we eventually transform this to ES5.
|
|
98782
|
+
var originalMethod = ts.getOriginalNode(node, ts.isFunctionLikeDeclaration);
|
|
98783
|
+
var emitSuperHelpers = languageVersion >= 2 /* ScriptTarget.ES2015 */ &&
|
|
98784
|
+
resolver.getNodeCheckFlags(node) & (4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */ | 2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */) &&
|
|
98785
|
+
(ts.getFunctionFlags(originalMethod) & 3 /* FunctionFlags.AsyncGenerator */) !== 3 /* FunctionFlags.AsyncGenerator */;
|
|
98786
|
+
if (emitSuperHelpers) {
|
|
98787
|
+
enableSubstitutionForAsyncMethodsWithSuper();
|
|
98788
|
+
if (capturedSuperProperties.size) {
|
|
98789
|
+
var variableStatement = createSuperAccessVariableStatement(factory, resolver, node, capturedSuperProperties);
|
|
98790
|
+
substitutedSuperAccessors[ts.getNodeId(variableStatement)] = true;
|
|
98791
|
+
var statements = updated.statements.slice();
|
|
98792
|
+
ts.insertStatementsAfterStandardPrologue(statements, [variableStatement]);
|
|
98793
|
+
updated = factory.updateBlock(updated, statements);
|
|
98794
|
+
}
|
|
98795
|
+
if (hasSuperElementAccess) {
|
|
98796
|
+
// Emit helpers for super element access expressions (`super[x]`).
|
|
98797
|
+
if (resolver.getNodeCheckFlags(node) & 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */) {
|
|
98798
|
+
ts.addEmitHelper(updated, ts.advancedAsyncSuperHelper);
|
|
98799
|
+
}
|
|
98800
|
+
else if (resolver.getNodeCheckFlags(node) & 2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */) {
|
|
98801
|
+
ts.addEmitHelper(updated, ts.asyncSuperHelper);
|
|
98802
|
+
}
|
|
98803
|
+
}
|
|
98804
|
+
}
|
|
98805
|
+
capturedSuperProperties = savedCapturedSuperProperties;
|
|
98806
|
+
hasSuperElementAccess = savedHasSuperElementAccess;
|
|
98807
|
+
return updated;
|
|
98808
|
+
}
|
|
98755
98809
|
function transformAsyncFunctionBody(node) {
|
|
98756
98810
|
resumeLexicalEnvironment();
|
|
98757
98811
|
var original = ts.getOriginalNode(node, ts.isFunctionLike);
|
|
@@ -98784,7 +98838,7 @@ var ts;
|
|
|
98784
98838
|
ts.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
|
|
98785
98839
|
// Minor optimization, emit `_super` helper to capture `super` access in an arrow.
|
|
98786
98840
|
// This step isn't needed if we eventually transform this to ES5.
|
|
98787
|
-
var emitSuperHelpers = languageVersion >= 2 /* ScriptTarget.ES2015 */ && resolver.getNodeCheckFlags(node) & (4096 /* NodeCheckFlags.
|
|
98841
|
+
var emitSuperHelpers = languageVersion >= 2 /* ScriptTarget.ES2015 */ && resolver.getNodeCheckFlags(node) & (4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */ | 2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */);
|
|
98788
98842
|
if (emitSuperHelpers) {
|
|
98789
98843
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
98790
98844
|
if (capturedSuperProperties.size) {
|
|
@@ -98797,10 +98851,10 @@ var ts;
|
|
|
98797
98851
|
ts.setTextRange(block, node.body);
|
|
98798
98852
|
if (emitSuperHelpers && hasSuperElementAccess) {
|
|
98799
98853
|
// Emit helpers for super element access expressions (`super[x]`).
|
|
98800
|
-
if (resolver.getNodeCheckFlags(node) & 4096 /* NodeCheckFlags.
|
|
98854
|
+
if (resolver.getNodeCheckFlags(node) & 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */) {
|
|
98801
98855
|
ts.addEmitHelper(block, ts.advancedAsyncSuperHelper);
|
|
98802
98856
|
}
|
|
98803
|
-
else if (resolver.getNodeCheckFlags(node) & 2048 /* NodeCheckFlags.
|
|
98857
|
+
else if (resolver.getNodeCheckFlags(node) & 2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */) {
|
|
98804
98858
|
ts.addEmitHelper(block, ts.asyncSuperHelper);
|
|
98805
98859
|
}
|
|
98806
98860
|
}
|
|
@@ -98872,7 +98926,7 @@ var ts;
|
|
|
98872
98926
|
// If we need to support substitutions for `super` in an async method,
|
|
98873
98927
|
// we should track it here.
|
|
98874
98928
|
if (enabledSubstitutions & 1 /* ES2017SubstitutionFlags.AsyncMethodsWithSuper */ && isSuperContainer(node)) {
|
|
98875
|
-
var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 /* NodeCheckFlags.
|
|
98929
|
+
var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */ | 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */);
|
|
98876
98930
|
if (superContainerFlags !== enclosingSuperContainerFlags) {
|
|
98877
98931
|
var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
|
|
98878
98932
|
enclosingSuperContainerFlags = superContainerFlags;
|
|
@@ -98949,7 +99003,7 @@ var ts;
|
|
|
98949
99003
|
|| kind === 175 /* SyntaxKind.SetAccessor */;
|
|
98950
99004
|
}
|
|
98951
99005
|
function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
|
|
98952
|
-
if (enclosingSuperContainerFlags & 4096 /* NodeCheckFlags.
|
|
99006
|
+
if (enclosingSuperContainerFlags & 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */) {
|
|
98953
99007
|
return ts.setTextRange(factory.createPropertyAccessExpression(factory.createCallExpression(factory.createUniqueName("_superIndex", 16 /* GeneratedIdentifierFlags.Optimistic */ | 32 /* GeneratedIdentifierFlags.FileLevel */),
|
|
98954
99008
|
/*typeArguments*/ undefined, [argumentExpression]), "value"), location);
|
|
98955
99009
|
}
|
|
@@ -98964,7 +99018,7 @@ var ts;
|
|
|
98964
99018
|
function createSuperAccessVariableStatement(factory, resolver, node, names) {
|
|
98965
99019
|
// Create a variable declaration with a getter/setter (if binding) definition for each name:
|
|
98966
99020
|
// const _super = Object.create(null, { x: { get: () => super.x, set: (v) => super.x = v }, ... });
|
|
98967
|
-
var hasBinding = (resolver.getNodeCheckFlags(node) & 4096 /* NodeCheckFlags.
|
|
99021
|
+
var hasBinding = (resolver.getNodeCheckFlags(node) & 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */) !== 0;
|
|
98968
99022
|
var accessors = [];
|
|
98969
99023
|
names.forEach(function (_, key) {
|
|
98970
99024
|
var name = ts.unescapeLeadingUnderscores(key);
|
|
@@ -99672,7 +99726,7 @@ var ts;
|
|
|
99672
99726
|
/*type*/ undefined, factory.updateBlock(node.body, ts.visitLexicalEnvironment(node.body.statements, visitor, context, statementOffset))), !!(hierarchyFacts & 1 /* HierarchyFacts.HasLexicalThis */)));
|
|
99673
99727
|
// Minor optimization, emit `_super` helper to capture `super` access in an arrow.
|
|
99674
99728
|
// This step isn't needed if we eventually transform this to ES5.
|
|
99675
|
-
var emitSuperHelpers = languageVersion >= 2 /* ScriptTarget.ES2015 */ && resolver.getNodeCheckFlags(node) & (4096 /* NodeCheckFlags.
|
|
99729
|
+
var emitSuperHelpers = languageVersion >= 2 /* ScriptTarget.ES2015 */ && resolver.getNodeCheckFlags(node) & (4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */ | 2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */);
|
|
99676
99730
|
if (emitSuperHelpers) {
|
|
99677
99731
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
99678
99732
|
var variableStatement = ts.createSuperAccessVariableStatement(factory, resolver, node, capturedSuperProperties);
|
|
@@ -99683,10 +99737,10 @@ var ts;
|
|
|
99683
99737
|
ts.insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
|
|
99684
99738
|
var block = factory.updateBlock(node.body, statements);
|
|
99685
99739
|
if (emitSuperHelpers && hasSuperElementAccess) {
|
|
99686
|
-
if (resolver.getNodeCheckFlags(node) & 4096 /* NodeCheckFlags.
|
|
99740
|
+
if (resolver.getNodeCheckFlags(node) & 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */) {
|
|
99687
99741
|
ts.addEmitHelper(block, ts.advancedAsyncSuperHelper);
|
|
99688
99742
|
}
|
|
99689
|
-
else if (resolver.getNodeCheckFlags(node) & 2048 /* NodeCheckFlags.
|
|
99743
|
+
else if (resolver.getNodeCheckFlags(node) & 2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */) {
|
|
99690
99744
|
ts.addEmitHelper(block, ts.asyncSuperHelper);
|
|
99691
99745
|
}
|
|
99692
99746
|
}
|
|
@@ -99815,7 +99869,7 @@ var ts;
|
|
|
99815
99869
|
// If we need to support substitutions for `super` in an async method,
|
|
99816
99870
|
// we should track it here.
|
|
99817
99871
|
if (enabledSubstitutions & 1 /* ESNextSubstitutionFlags.AsyncMethodsWithSuper */ && isSuperContainer(node)) {
|
|
99818
|
-
var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 /* NodeCheckFlags.
|
|
99872
|
+
var superContainerFlags = resolver.getNodeCheckFlags(node) & (2048 /* NodeCheckFlags.MethodWithSuperPropertyAccessInAsync */ | 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */);
|
|
99819
99873
|
if (superContainerFlags !== enclosingSuperContainerFlags) {
|
|
99820
99874
|
var savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
|
|
99821
99875
|
enclosingSuperContainerFlags = superContainerFlags;
|
|
@@ -99892,7 +99946,7 @@ var ts;
|
|
|
99892
99946
|
|| kind === 175 /* SyntaxKind.SetAccessor */;
|
|
99893
99947
|
}
|
|
99894
99948
|
function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
|
|
99895
|
-
if (enclosingSuperContainerFlags & 4096 /* NodeCheckFlags.
|
|
99949
|
+
if (enclosingSuperContainerFlags & 4096 /* NodeCheckFlags.MethodWithSuperPropertyAssignmentInAsync */) {
|
|
99896
99950
|
return ts.setTextRange(factory.createPropertyAccessExpression(factory.createCallExpression(factory.createIdentifier("_superIndex"),
|
|
99897
99951
|
/*typeArguments*/ undefined, [argumentExpression]), "value"), location);
|
|
99898
99952
|
}
|
|
@@ -123918,7 +123972,7 @@ var ts;
|
|
|
123918
123972
|
var isNonDirectorySeparatorRoot = rootLength > 1 || dirPath.charCodeAt(0) !== 47 /* CharacterCodes.slash */;
|
|
123919
123973
|
if (isNonDirectorySeparatorRoot &&
|
|
123920
123974
|
dirPath.search(/[a-zA-Z]:/) !== 0 && // Non dos style paths
|
|
123921
|
-
pathPartForUserCheck.search(/[a-zA-
|
|
123975
|
+
pathPartForUserCheck.search(/[a-zA-Z]\$\//) === 0) { // Dos style nextPart
|
|
123922
123976
|
nextDirectorySeparator = dirPath.indexOf(ts.directorySeparator, nextDirectorySeparator + 1);
|
|
123923
123977
|
if (nextDirectorySeparator === -1) {
|
|
123924
123978
|
// ignore "//vda1cs4850/c$/folderAtRoot"
|
|
@@ -125424,15 +125478,21 @@ var ts;
|
|
|
125424
125478
|
return undefined;
|
|
125425
125479
|
}
|
|
125426
125480
|
function tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) {
|
|
125427
|
-
var
|
|
125428
|
-
if (
|
|
125481
|
+
var normalizedTargetPaths = getPathsRelativeToRootDirs(moduleFileName, rootDirs, getCanonicalFileName);
|
|
125482
|
+
if (normalizedTargetPaths === undefined) {
|
|
125483
|
+
return undefined;
|
|
125484
|
+
}
|
|
125485
|
+
var normalizedSourcePaths = getPathsRelativeToRootDirs(sourceDirectory, rootDirs, getCanonicalFileName);
|
|
125486
|
+
var relativePaths = ts.flatMap(normalizedSourcePaths, function (sourcePath) {
|
|
125487
|
+
return ts.map(normalizedTargetPaths, function (targetPath) { return ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(sourcePath, targetPath, getCanonicalFileName)); });
|
|
125488
|
+
});
|
|
125489
|
+
var shortest = ts.min(relativePaths, ts.compareNumberOfDirectorySeparators);
|
|
125490
|
+
if (!shortest) {
|
|
125429
125491
|
return undefined;
|
|
125430
125492
|
}
|
|
125431
|
-
var normalizedSourcePath = getPathRelativeToRootDirs(sourceDirectory, rootDirs, getCanonicalFileName);
|
|
125432
|
-
var relativePath = normalizedSourcePath !== undefined ? ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(normalizedSourcePath, normalizedTargetPath, getCanonicalFileName)) : normalizedTargetPath;
|
|
125433
125493
|
return ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeJs
|
|
125434
|
-
? removeExtensionAndIndexPostFix(
|
|
125435
|
-
: ts.removeFileExtension(
|
|
125494
|
+
? removeExtensionAndIndexPostFix(shortest, ending, compilerOptions)
|
|
125495
|
+
: ts.removeFileExtension(shortest);
|
|
125436
125496
|
}
|
|
125437
125497
|
function tryGetModuleNameAsNodeModule(_a, _b, importingSourceFile, host, options, userPreferences, packageNameOnly, overrideMode) {
|
|
125438
125498
|
var path = _a.path, isRedirect = _a.isRedirect;
|
|
@@ -125569,8 +125629,8 @@ var ts;
|
|
|
125569
125629
|
}
|
|
125570
125630
|
}
|
|
125571
125631
|
}
|
|
125572
|
-
function
|
|
125573
|
-
return ts.
|
|
125632
|
+
function getPathsRelativeToRootDirs(path, rootDirs, getCanonicalFileName) {
|
|
125633
|
+
return ts.mapDefined(rootDirs, function (rootDir) {
|
|
125574
125634
|
var relativePath = getRelativePathIfInDirectory(path, rootDir, getCanonicalFileName);
|
|
125575
125635
|
return relativePath !== undefined && isPathRelativeToParent(relativePath) ? undefined : relativePath;
|
|
125576
125636
|
});
|
|
@@ -146079,7 +146139,7 @@ var ts;
|
|
|
146079
146139
|
return bestMatch;
|
|
146080
146140
|
}
|
|
146081
146141
|
function betterMatch(a, b) {
|
|
146082
|
-
return ts.min(a, b, compareMatches);
|
|
146142
|
+
return ts.min([a, b], compareMatches);
|
|
146083
146143
|
}
|
|
146084
146144
|
function compareMatches(a, b) {
|
|
146085
146145
|
return a === undefined ? 1 /* Comparison.GreaterThan */ : b === undefined ? -1 /* Comparison.LessThan */
|