typescript 5.4.0-dev.20240111 → 5.4.0-dev.20240113
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/lib.es5.d.ts +5 -0
- package/lib/lib.esnext.collection.d.ts +29 -0
- package/lib/lib.esnext.d.ts +2 -0
- package/lib/lib.esnext.object.d.ts +29 -0
- package/lib/tsc.js +203 -337
- package/lib/tsserver.js +274 -345
- package/lib/typescript.d.ts +5 -2
- package/lib/typescript.js +275 -345
- package/lib/typingsInstaller.js +6 -3
- package/package.json +2 -2
package/lib/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.4";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20240113`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6206,6 +6206,7 @@ ${lanes.join("\n")}
|
|
|
6206
6206
|
resolvePath: (path) => _path.resolve(path),
|
|
6207
6207
|
fileExists,
|
|
6208
6208
|
directoryExists,
|
|
6209
|
+
getAccessibleFileSystemEntries,
|
|
6209
6210
|
createDirectory(directoryName) {
|
|
6210
6211
|
if (!nodeSystem.directoryExists(directoryName)) {
|
|
6211
6212
|
try {
|
|
@@ -12907,6 +12908,45 @@ ${lanes.join("\n")}
|
|
|
12907
12908
|
const type = isJSDocParameterTag(node) ? node.typeExpression && node.typeExpression.type : node.type;
|
|
12908
12909
|
return node.dotDotDotToken !== void 0 || !!type && type.kind === 325 /* JSDocVariadicType */;
|
|
12909
12910
|
}
|
|
12911
|
+
function hasInternalAnnotation(range, sourceFile) {
|
|
12912
|
+
const comment = sourceFile.text.substring(range.pos, range.end);
|
|
12913
|
+
return comment.includes("@internal");
|
|
12914
|
+
}
|
|
12915
|
+
function isInternalDeclaration(node, sourceFile) {
|
|
12916
|
+
sourceFile ?? (sourceFile = getSourceFileOfNode(node));
|
|
12917
|
+
const parseTreeNode = getParseTreeNode(node);
|
|
12918
|
+
if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) {
|
|
12919
|
+
const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);
|
|
12920
|
+
const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0;
|
|
12921
|
+
const text = sourceFile.text;
|
|
12922
|
+
const commentRanges = previousSibling ? concatenate(
|
|
12923
|
+
// to handle
|
|
12924
|
+
// ... parameters, /** @internal */
|
|
12925
|
+
// public param: string
|
|
12926
|
+
getTrailingCommentRanges(text, skipTrivia(
|
|
12927
|
+
text,
|
|
12928
|
+
previousSibling.end + 1,
|
|
12929
|
+
/*stopAfterLineBreak*/
|
|
12930
|
+
false,
|
|
12931
|
+
/*stopAtComments*/
|
|
12932
|
+
true
|
|
12933
|
+
)),
|
|
12934
|
+
getLeadingCommentRanges(text, node.pos)
|
|
12935
|
+
) : getTrailingCommentRanges(text, skipTrivia(
|
|
12936
|
+
text,
|
|
12937
|
+
node.pos,
|
|
12938
|
+
/*stopAfterLineBreak*/
|
|
12939
|
+
false,
|
|
12940
|
+
/*stopAtComments*/
|
|
12941
|
+
true
|
|
12942
|
+
));
|
|
12943
|
+
return some(commentRanges) && hasInternalAnnotation(last(commentRanges), sourceFile);
|
|
12944
|
+
}
|
|
12945
|
+
const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, sourceFile);
|
|
12946
|
+
return !!forEach(leadingCommentRanges, (range) => {
|
|
12947
|
+
return hasInternalAnnotation(range, sourceFile);
|
|
12948
|
+
});
|
|
12949
|
+
}
|
|
12910
12950
|
var unchangedTextChangeRange, supportedLocaleDirectories, MAX_SMI_X86;
|
|
12911
12951
|
var init_utilitiesPublic = __esm({
|
|
12912
12952
|
"src/compiler/utilitiesPublic.ts"() {
|
|
@@ -38002,7 +38042,7 @@ ${lanes.join("\n")}
|
|
|
38002
38042
|
["es2023.array", "lib.es2023.array.d.ts"],
|
|
38003
38043
|
["es2023.collection", "lib.es2023.collection.d.ts"],
|
|
38004
38044
|
["esnext.array", "lib.es2023.array.d.ts"],
|
|
38005
|
-
["esnext.collection", "lib.
|
|
38045
|
+
["esnext.collection", "lib.esnext.collection.d.ts"],
|
|
38006
38046
|
["esnext.symbol", "lib.es2019.symbol.d.ts"],
|
|
38007
38047
|
["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"],
|
|
38008
38048
|
["esnext.intl", "lib.esnext.intl.d.ts"],
|
|
@@ -38012,6 +38052,7 @@ ${lanes.join("\n")}
|
|
|
38012
38052
|
["esnext.promise", "lib.esnext.promise.d.ts"],
|
|
38013
38053
|
["esnext.weakref", "lib.es2021.weakref.d.ts"],
|
|
38014
38054
|
["esnext.decorators", "lib.esnext.decorators.d.ts"],
|
|
38055
|
+
["esnext.object", "lib.esnext.object.d.ts"],
|
|
38015
38056
|
["decorators", "lib.decorators.d.ts"],
|
|
38016
38057
|
["decorators.legacy", "lib.decorators.legacy.d.ts"]
|
|
38017
38058
|
];
|
|
@@ -47100,7 +47141,12 @@ ${lanes.join("\n")}
|
|
|
47100
47141
|
}
|
|
47101
47142
|
function markAsSynthetic(node) {
|
|
47102
47143
|
setTextRangePosEnd(node, -1, -1);
|
|
47103
|
-
return visitEachChild(
|
|
47144
|
+
return visitEachChild(
|
|
47145
|
+
node,
|
|
47146
|
+
markAsSynthetic,
|
|
47147
|
+
/*context*/
|
|
47148
|
+
void 0
|
|
47149
|
+
);
|
|
47104
47150
|
}
|
|
47105
47151
|
function getEmitResolver(sourceFile, cancellationToken2) {
|
|
47106
47152
|
getDiagnostics2(sourceFile, cancellationToken2);
|
|
@@ -50376,16 +50422,12 @@ ${lanes.join("\n")}
|
|
|
50376
50422
|
}
|
|
50377
50423
|
function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) {
|
|
50378
50424
|
let aliasesToMakeVisible;
|
|
50379
|
-
let bindingElementToMakeVisible;
|
|
50380
50425
|
if (!every(filter(symbol.declarations, (d) => d.kind !== 80 /* Identifier */), getIsDeclarationVisible)) {
|
|
50381
50426
|
return void 0;
|
|
50382
50427
|
}
|
|
50383
|
-
return { accessibility: 0 /* Accessible */, aliasesToMakeVisible
|
|
50428
|
+
return { accessibility: 0 /* Accessible */, aliasesToMakeVisible };
|
|
50384
50429
|
function getIsDeclarationVisible(declaration) {
|
|
50385
50430
|
var _a, _b;
|
|
50386
|
-
if (isBindingElement(declaration) && findAncestor(declaration, isParameter)) {
|
|
50387
|
-
bindingElementToMakeVisible = declaration;
|
|
50388
|
-
}
|
|
50389
50431
|
if (!isDeclarationVisible(declaration)) {
|
|
50390
50432
|
const anyImportSyntax = getAnyImportSyntax(declaration);
|
|
50391
50433
|
if (anyImportSyntax && !hasSyntacticModifier(anyImportSyntax, 32 /* Export */) && // import clause without export
|
|
@@ -50896,7 +50938,13 @@ ${lanes.join("\n")}
|
|
|
50896
50938
|
return visitAndTransformType(type, (type2) => conditionalTypeToTypeNode(type2));
|
|
50897
50939
|
}
|
|
50898
50940
|
if (type.flags & 33554432 /* Substitution */) {
|
|
50899
|
-
|
|
50941
|
+
const typeNode = typeToTypeNodeHelper(type.baseType, context);
|
|
50942
|
+
const noInferSymbol = isNoInferType(type) && getGlobalTypeSymbol(
|
|
50943
|
+
"NoInfer",
|
|
50944
|
+
/*reportErrors*/
|
|
50945
|
+
false
|
|
50946
|
+
);
|
|
50947
|
+
return noInferSymbol ? symbolToTypeNode(noInferSymbol, context, 788968 /* Type */, [typeNode]) : typeNode;
|
|
50900
50948
|
}
|
|
50901
50949
|
return Debug.fail("Should be unreachable.");
|
|
50902
50950
|
function conditionalTypeToTypeNode(type2) {
|
|
@@ -51142,7 +51190,13 @@ ${lanes.join("\n")}
|
|
|
51142
51190
|
if (!nodeIsSynthesized(node) && getParseTreeNode(node) === node) {
|
|
51143
51191
|
return node;
|
|
51144
51192
|
}
|
|
51145
|
-
return setTextRange(factory.cloneNode(visitEachChild(
|
|
51193
|
+
return setTextRange(factory.cloneNode(visitEachChild(
|
|
51194
|
+
node,
|
|
51195
|
+
deepCloneOrReuseNode,
|
|
51196
|
+
/*context*/
|
|
51197
|
+
void 0,
|
|
51198
|
+
deepCloneOrReuseNodes
|
|
51199
|
+
)), node);
|
|
51146
51200
|
}
|
|
51147
51201
|
function deepCloneOrReuseNodes(nodes, visitor, test, start, count) {
|
|
51148
51202
|
if (nodes && nodes.length === 0) {
|
|
@@ -51864,7 +51918,8 @@ ${lanes.join("\n")}
|
|
|
51864
51918
|
let visited = visitEachChild(
|
|
51865
51919
|
node2,
|
|
51866
51920
|
elideInitializerAndSetEmitFlags,
|
|
51867
|
-
|
|
51921
|
+
/*context*/
|
|
51922
|
+
void 0,
|
|
51868
51923
|
/*nodesVisitor*/
|
|
51869
51924
|
void 0,
|
|
51870
51925
|
elideInitializerAndSetEmitFlags
|
|
@@ -52642,7 +52697,12 @@ ${lanes.join("\n")}
|
|
|
52642
52697
|
if (file && isTupleTypeNode(node) && getLineAndCharacterOfPosition(file, node.pos).line === getLineAndCharacterOfPosition(file, node.end).line) {
|
|
52643
52698
|
setEmitFlags(node, 1 /* SingleLine */);
|
|
52644
52699
|
}
|
|
52645
|
-
return visitEachChild(
|
|
52700
|
+
return visitEachChild(
|
|
52701
|
+
node,
|
|
52702
|
+
visitExistingNodeTreeSymbols,
|
|
52703
|
+
/*context*/
|
|
52704
|
+
void 0
|
|
52705
|
+
);
|
|
52646
52706
|
function getEffectiveDotDotDotForParameter(p) {
|
|
52647
52707
|
return p.dotDotDotToken || (p.type && isJSDocVariadicType(p.type) ? factory.createToken(26 /* DotDotDotToken */) : void 0);
|
|
52648
52708
|
}
|
|
@@ -52742,7 +52802,7 @@ ${lanes.join("\n")}
|
|
|
52742
52802
|
});
|
|
52743
52803
|
let addingDeclare = !bundled;
|
|
52744
52804
|
const exportEquals = symbolTable.get("export=" /* ExportEquals */);
|
|
52745
|
-
if (exportEquals && symbolTable.size > 1 && exportEquals.flags & 2097152 /* Alias */) {
|
|
52805
|
+
if (exportEquals && symbolTable.size > 1 && exportEquals.flags & (2097152 /* Alias */ | 1536 /* Module */)) {
|
|
52746
52806
|
symbolTable = createSymbolTable();
|
|
52747
52807
|
symbolTable.set("export=" /* ExportEquals */, exportEquals);
|
|
52748
52808
|
}
|
|
@@ -53199,8 +53259,18 @@ ${lanes.join("\n")}
|
|
|
53199
53259
|
);
|
|
53200
53260
|
}
|
|
53201
53261
|
function getNamespaceMembersForSerialization(symbol) {
|
|
53202
|
-
|
|
53203
|
-
|
|
53262
|
+
let exports = arrayFrom(getExportsOfSymbol(symbol).values());
|
|
53263
|
+
const merged = getMergedSymbol(symbol);
|
|
53264
|
+
if (merged !== symbol) {
|
|
53265
|
+
const membersSet = new Set(exports);
|
|
53266
|
+
for (const exported of getExportsOfSymbol(merged).values()) {
|
|
53267
|
+
if (!(getSymbolFlags(resolveSymbol(exported)) & 111551 /* Value */)) {
|
|
53268
|
+
membersSet.add(exported);
|
|
53269
|
+
}
|
|
53270
|
+
}
|
|
53271
|
+
exports = arrayFrom(membersSet);
|
|
53272
|
+
}
|
|
53273
|
+
return filter(exports, (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
|
|
53204
53274
|
}
|
|
53205
53275
|
function isTypeOnlyNamespace(symbol) {
|
|
53206
53276
|
return every(getNamespaceMembersForSerialization(symbol), (m) => !(getSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
|
|
@@ -58844,8 +58914,11 @@ ${lanes.join("\n")}
|
|
|
58844
58914
|
}
|
|
58845
58915
|
function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) {
|
|
58846
58916
|
const type = getDeclaredTypeOfSymbol(symbol);
|
|
58847
|
-
if (type === intrinsicMarkerType
|
|
58848
|
-
|
|
58917
|
+
if (type === intrinsicMarkerType) {
|
|
58918
|
+
const typeKind = intrinsicTypeKinds.get(symbol.escapedName);
|
|
58919
|
+
if (typeKind !== void 0 && typeArguments && typeArguments.length === 1) {
|
|
58920
|
+
return typeKind === 4 /* NoInfer */ ? getNoInferType(typeArguments[0]) : getStringMappingType(symbol, typeArguments[0]);
|
|
58921
|
+
}
|
|
58849
58922
|
}
|
|
58850
58923
|
const links = getSymbolLinks(symbol);
|
|
58851
58924
|
const typeParameters = links.typeParameters;
|
|
@@ -58999,10 +59072,19 @@ ${lanes.join("\n")}
|
|
|
58999
59072
|
}
|
|
59000
59073
|
return links.resolvedJSDocType;
|
|
59001
59074
|
}
|
|
59075
|
+
function getNoInferType(type) {
|
|
59076
|
+
return isNoInferTargetType(type) ? getOrCreateSubstitutionType(type, unknownType) : type;
|
|
59077
|
+
}
|
|
59078
|
+
function isNoInferTargetType(type) {
|
|
59079
|
+
return !!(type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, isNoInferTargetType) || type.flags & 33554432 /* Substitution */ && !isNoInferType(type) && isNoInferTargetType(type.baseType) || type.flags & 524288 /* Object */ && !isEmptyAnonymousObjectType(type) || type.flags & (465829888 /* Instantiable */ & ~33554432 /* Substitution */) && !isPatternLiteralType(type));
|
|
59080
|
+
}
|
|
59081
|
+
function isNoInferType(type) {
|
|
59082
|
+
return !!(type.flags & 33554432 /* Substitution */ && type.constraint.flags & 2 /* Unknown */);
|
|
59083
|
+
}
|
|
59002
59084
|
function getSubstitutionType(baseType, constraint) {
|
|
59003
|
-
|
|
59004
|
-
|
|
59005
|
-
|
|
59085
|
+
return constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType || baseType.flags & 1 /* Any */ ? baseType : getOrCreateSubstitutionType(baseType, constraint);
|
|
59086
|
+
}
|
|
59087
|
+
function getOrCreateSubstitutionType(baseType, constraint) {
|
|
59006
59088
|
const id = `${getTypeId(baseType)}>${getTypeId(constraint)}`;
|
|
59007
59089
|
const cached = substitutionTypes.get(id);
|
|
59008
59090
|
if (cached) {
|
|
@@ -59015,7 +59097,7 @@ ${lanes.join("\n")}
|
|
|
59015
59097
|
return result;
|
|
59016
59098
|
}
|
|
59017
59099
|
function getSubstitutionIntersection(substitutionType) {
|
|
59018
|
-
return getIntersectionType([substitutionType.constraint, substitutionType.baseType]);
|
|
59100
|
+
return isNoInferType(substitutionType) ? substitutionType.baseType : getIntersectionType([substitutionType.constraint, substitutionType.baseType]);
|
|
59019
59101
|
}
|
|
59020
59102
|
function isUnaryTupleTypeNode(node) {
|
|
59021
59103
|
return node.kind === 189 /* TupleType */ && node.elements.length === 1;
|
|
@@ -60544,7 +60626,7 @@ ${lanes.join("\n")}
|
|
|
60544
60626
|
}
|
|
60545
60627
|
function getIndexType(type, indexFlags = defaultIndexFlags) {
|
|
60546
60628
|
type = getReducedType(type);
|
|
60547
|
-
return shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType : getLiteralTypeFromProperties(type, (indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */), indexFlags === defaultIndexFlags);
|
|
60629
|
+
return isNoInferType(type) ? getNoInferType(getIndexType(type.baseType, indexFlags)) : shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType : getLiteralTypeFromProperties(type, (indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */), indexFlags === defaultIndexFlags);
|
|
60548
60630
|
}
|
|
60549
60631
|
function getExtractStringType(type) {
|
|
60550
60632
|
if (keyofStringsOnly) {
|
|
@@ -62287,6 +62369,9 @@ ${lanes.join("\n")}
|
|
|
62287
62369
|
}
|
|
62288
62370
|
if (flags & 33554432 /* Substitution */) {
|
|
62289
62371
|
const newBaseType = instantiateType(type.baseType, mapper);
|
|
62372
|
+
if (isNoInferType(type)) {
|
|
62373
|
+
return getNoInferType(newBaseType);
|
|
62374
|
+
}
|
|
62290
62375
|
const newConstraint = instantiateType(type.constraint, mapper);
|
|
62291
62376
|
if (newBaseType.flags & 8650752 /* TypeVariable */ && isGenericType(newConstraint)) {
|
|
62292
62377
|
return getSubstitutionType(newBaseType, newConstraint);
|
|
@@ -67079,7 +67164,7 @@ ${lanes.join("\n")}
|
|
|
67079
67164
|
let expandingFlags = 0 /* None */;
|
|
67080
67165
|
inferFromTypes(originalSource, originalTarget);
|
|
67081
67166
|
function inferFromTypes(source, target) {
|
|
67082
|
-
if (!couldContainTypeVariables(target)) {
|
|
67167
|
+
if (!couldContainTypeVariables(target) || isNoInferType(target)) {
|
|
67083
67168
|
return;
|
|
67084
67169
|
}
|
|
67085
67170
|
if (source === wildcardType || source === blockedStringType) {
|
|
@@ -67128,6 +67213,9 @@ ${lanes.join("\n")}
|
|
|
67128
67213
|
}
|
|
67129
67214
|
}
|
|
67130
67215
|
if (target.flags & (8388608 /* IndexedAccess */ | 33554432 /* Substitution */)) {
|
|
67216
|
+
if (isNoInferType(target)) {
|
|
67217
|
+
return;
|
|
67218
|
+
}
|
|
67131
67219
|
target = getActualTypeVariable(target);
|
|
67132
67220
|
}
|
|
67133
67221
|
if (target.flags & 8650752 /* TypeVariable */) {
|
|
@@ -87903,7 +87991,8 @@ ${lanes.join("\n")}
|
|
|
87903
87991
|
Uppercase: 0 /* Uppercase */,
|
|
87904
87992
|
Lowercase: 1 /* Lowercase */,
|
|
87905
87993
|
Capitalize: 2 /* Capitalize */,
|
|
87906
|
-
Uncapitalize: 3 /* Uncapitalize
|
|
87994
|
+
Uncapitalize: 3 /* Uncapitalize */,
|
|
87995
|
+
NoInfer: 4 /* NoInfer */
|
|
87907
87996
|
}));
|
|
87908
87997
|
SymbolLinks = class {
|
|
87909
87998
|
};
|
|
@@ -88272,7 +88361,7 @@ ${lanes.join("\n")}
|
|
|
88272
88361
|
return discarded ? discardVisitor(node) : visitor(node);
|
|
88273
88362
|
}, isExpression);
|
|
88274
88363
|
}
|
|
88275
|
-
function visitEachChild(node, visitor, context, nodesVisitor = visitNodes2, tokenVisitor, nodeVisitor = visitNode) {
|
|
88364
|
+
function visitEachChild(node, visitor, context = nullTransformationContext, nodesVisitor = visitNodes2, tokenVisitor, nodeVisitor = visitNode) {
|
|
88276
88365
|
if (node === void 0) {
|
|
88277
88366
|
return void 0;
|
|
88278
88367
|
}
|
|
@@ -102874,12 +102963,22 @@ ${lanes.join("\n")}
|
|
|
102874
102963
|
case 172 /* PropertyDeclaration */: {
|
|
102875
102964
|
const named = node;
|
|
102876
102965
|
if (isComputedPropertyName(named.name)) {
|
|
102877
|
-
return factory2.replacePropertyName(named, visitEachChild(
|
|
102966
|
+
return factory2.replacePropertyName(named, visitEachChild(
|
|
102967
|
+
named.name,
|
|
102968
|
+
elideUnusedThisCaptureWorker,
|
|
102969
|
+
/*context*/
|
|
102970
|
+
void 0
|
|
102971
|
+
));
|
|
102878
102972
|
}
|
|
102879
102973
|
return node;
|
|
102880
102974
|
}
|
|
102881
102975
|
}
|
|
102882
|
-
return visitEachChild(
|
|
102976
|
+
return visitEachChild(
|
|
102977
|
+
node,
|
|
102978
|
+
elideUnusedThisCaptureWorker,
|
|
102979
|
+
/*context*/
|
|
102980
|
+
void 0
|
|
102981
|
+
);
|
|
102883
102982
|
}
|
|
102884
102983
|
function simplifyConstructorElideUnusedThisCapture(body, original) {
|
|
102885
102984
|
if (original.transformFlags & 16384 /* ContainsLexicalThis */ || hierarchyFacts & 65536 /* LexicalThis */ || hierarchyFacts & 131072 /* CapturedLexicalThis */) {
|
|
@@ -102915,12 +103014,22 @@ ${lanes.join("\n")}
|
|
|
102915
103014
|
case 172 /* PropertyDeclaration */: {
|
|
102916
103015
|
const named = node;
|
|
102917
103016
|
if (isComputedPropertyName(named.name)) {
|
|
102918
|
-
return factory2.replacePropertyName(named, visitEachChild(
|
|
103017
|
+
return factory2.replacePropertyName(named, visitEachChild(
|
|
103018
|
+
named.name,
|
|
103019
|
+
injectSuperPresenceCheckWorker,
|
|
103020
|
+
/*context*/
|
|
103021
|
+
void 0
|
|
103022
|
+
));
|
|
102919
103023
|
}
|
|
102920
103024
|
return node;
|
|
102921
103025
|
}
|
|
102922
103026
|
}
|
|
102923
|
-
return visitEachChild(
|
|
103027
|
+
return visitEachChild(
|
|
103028
|
+
node,
|
|
103029
|
+
injectSuperPresenceCheckWorker,
|
|
103030
|
+
/*context*/
|
|
103031
|
+
void 0
|
|
103032
|
+
);
|
|
102924
103033
|
}
|
|
102925
103034
|
function complicateConstructorInjectSuperPresenceCheck(body) {
|
|
102926
103035
|
return factory2.updateBlock(body, visitNodes2(body.statements, injectSuperPresenceCheckWorker, isStatement));
|
|
@@ -111367,44 +111476,6 @@ ${lanes.join("\n")}
|
|
|
111367
111476
|
);
|
|
111368
111477
|
return result.diagnostics;
|
|
111369
111478
|
}
|
|
111370
|
-
function hasInternalAnnotation(range, currentSourceFile) {
|
|
111371
|
-
const comment = currentSourceFile.text.substring(range.pos, range.end);
|
|
111372
|
-
return comment.includes("@internal");
|
|
111373
|
-
}
|
|
111374
|
-
function isInternalDeclaration(node, currentSourceFile) {
|
|
111375
|
-
const parseTreeNode = getParseTreeNode(node);
|
|
111376
|
-
if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) {
|
|
111377
|
-
const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);
|
|
111378
|
-
const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0;
|
|
111379
|
-
const text = currentSourceFile.text;
|
|
111380
|
-
const commentRanges = previousSibling ? concatenate(
|
|
111381
|
-
// to handle
|
|
111382
|
-
// ... parameters, /** @internal */
|
|
111383
|
-
// public param: string
|
|
111384
|
-
getTrailingCommentRanges(text, skipTrivia(
|
|
111385
|
-
text,
|
|
111386
|
-
previousSibling.end + 1,
|
|
111387
|
-
/*stopAfterLineBreak*/
|
|
111388
|
-
false,
|
|
111389
|
-
/*stopAtComments*/
|
|
111390
|
-
true
|
|
111391
|
-
)),
|
|
111392
|
-
getLeadingCommentRanges(text, node.pos)
|
|
111393
|
-
) : getTrailingCommentRanges(text, skipTrivia(
|
|
111394
|
-
text,
|
|
111395
|
-
node.pos,
|
|
111396
|
-
/*stopAfterLineBreak*/
|
|
111397
|
-
false,
|
|
111398
|
-
/*stopAtComments*/
|
|
111399
|
-
true
|
|
111400
|
-
));
|
|
111401
|
-
return commentRanges && commentRanges.length && hasInternalAnnotation(last(commentRanges), currentSourceFile);
|
|
111402
|
-
}
|
|
111403
|
-
const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, currentSourceFile);
|
|
111404
|
-
return !!forEach(leadingCommentRanges, (range) => {
|
|
111405
|
-
return hasInternalAnnotation(range, currentSourceFile);
|
|
111406
|
-
});
|
|
111407
|
-
}
|
|
111408
111479
|
function transformDeclarations(context) {
|
|
111409
111480
|
const throwDiagnostic = () => Debug.fail("Diagnostic emitted without context");
|
|
111410
111481
|
let getSymbolAccessibilityDiagnostic = throwDiagnostic;
|
|
@@ -111419,7 +111490,6 @@ ${lanes.join("\n")}
|
|
|
111419
111490
|
let lateStatementReplacementMap;
|
|
111420
111491
|
let suppressNewDiagnosticContexts;
|
|
111421
111492
|
let exportedModulesFromDeclarationEmit;
|
|
111422
|
-
const usedBindingElementAliases = /* @__PURE__ */ new Map();
|
|
111423
111493
|
const { factory: factory2 } = context;
|
|
111424
111494
|
const host = context.getEmitHost();
|
|
111425
111495
|
const symbolTracker = {
|
|
@@ -111485,17 +111555,6 @@ ${lanes.join("\n")}
|
|
|
111485
111555
|
}
|
|
111486
111556
|
}
|
|
111487
111557
|
}
|
|
111488
|
-
if (symbolAccessibilityResult.bindingElementToMakeVisible) {
|
|
111489
|
-
const bindingElement = symbolAccessibilityResult.bindingElementToMakeVisible;
|
|
111490
|
-
const parameter = findAncestor(bindingElement, isParameter);
|
|
111491
|
-
Debug.assert(parameter !== void 0);
|
|
111492
|
-
const parent2 = getOriginalNode(parameter.parent);
|
|
111493
|
-
let aliases = usedBindingElementAliases.get(parent2);
|
|
111494
|
-
if (!aliases) {
|
|
111495
|
-
usedBindingElementAliases.set(parent2, aliases = /* @__PURE__ */ new Map());
|
|
111496
|
-
}
|
|
111497
|
-
aliases.set(getOriginalNode(bindingElement), bindingElement.name);
|
|
111498
|
-
}
|
|
111499
111558
|
} else {
|
|
111500
111559
|
const errorInfo = getSymbolAccessibilityDiagnostic(symbolAccessibilityResult);
|
|
111501
111560
|
if (errorInfo) {
|
|
@@ -111828,7 +111887,7 @@ ${lanes.join("\n")}
|
|
|
111828
111887
|
});
|
|
111829
111888
|
return ret;
|
|
111830
111889
|
}
|
|
111831
|
-
function
|
|
111890
|
+
function filterBindingPatternInitializers(name) {
|
|
111832
111891
|
if (name.kind === 80 /* Identifier */) {
|
|
111833
111892
|
return name;
|
|
111834
111893
|
} else {
|
|
@@ -111845,180 +111904,15 @@ ${lanes.join("\n")}
|
|
|
111845
111904
|
if (elem.propertyName && isComputedPropertyName(elem.propertyName) && isEntityNameExpression(elem.propertyName.expression)) {
|
|
111846
111905
|
checkEntityNameVisibility(elem.propertyName.expression, enclosingDeclaration);
|
|
111847
111906
|
}
|
|
111848
|
-
if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !isIdentifierANonContextualKeyword(elem.propertyName)) {
|
|
111849
|
-
return factory2.updateBindingElement(
|
|
111850
|
-
elem,
|
|
111851
|
-
elem.dotDotDotToken,
|
|
111852
|
-
/*propertyName*/
|
|
111853
|
-
void 0,
|
|
111854
|
-
elem.propertyName,
|
|
111855
|
-
shouldPrintWithInitializer(elem) ? elem.initializer : void 0
|
|
111856
|
-
);
|
|
111857
|
-
}
|
|
111858
111907
|
return factory2.updateBindingElement(
|
|
111859
111908
|
elem,
|
|
111860
111909
|
elem.dotDotDotToken,
|
|
111861
111910
|
elem.propertyName,
|
|
111862
|
-
|
|
111911
|
+
filterBindingPatternInitializers(elem.name),
|
|
111863
111912
|
shouldPrintWithInitializer(elem) ? elem.initializer : void 0
|
|
111864
111913
|
);
|
|
111865
111914
|
}
|
|
111866
111915
|
}
|
|
111867
|
-
function ensureBindingAliasesInParameterList(input, updatedNode) {
|
|
111868
|
-
const original = getOriginalNode(input);
|
|
111869
|
-
const params = updatedNode.parameters;
|
|
111870
|
-
const aliases = usedBindingElementAliases.get(original);
|
|
111871
|
-
if (!aliases) {
|
|
111872
|
-
return updatedNode;
|
|
111873
|
-
}
|
|
111874
|
-
usedBindingElementAliases.delete(original);
|
|
111875
|
-
const newParams = map(params, addUsedBindingPatternsToParameter);
|
|
111876
|
-
const newParamsNodeArray = factory2.createNodeArray(newParams, params.hasTrailingComma);
|
|
111877
|
-
switch (updatedNode.kind) {
|
|
111878
|
-
case 174 /* MethodDeclaration */:
|
|
111879
|
-
return factory2.updateMethodDeclaration(
|
|
111880
|
-
updatedNode,
|
|
111881
|
-
updatedNode.modifiers,
|
|
111882
|
-
updatedNode.asteriskToken,
|
|
111883
|
-
updatedNode.name,
|
|
111884
|
-
updatedNode.questionToken,
|
|
111885
|
-
updatedNode.typeParameters,
|
|
111886
|
-
newParamsNodeArray,
|
|
111887
|
-
updatedNode.type,
|
|
111888
|
-
updatedNode.body
|
|
111889
|
-
);
|
|
111890
|
-
case 176 /* Constructor */:
|
|
111891
|
-
return factory2.updateConstructorDeclaration(
|
|
111892
|
-
updatedNode,
|
|
111893
|
-
updatedNode.modifiers,
|
|
111894
|
-
newParamsNodeArray,
|
|
111895
|
-
updatedNode.body
|
|
111896
|
-
);
|
|
111897
|
-
case 177 /* GetAccessor */:
|
|
111898
|
-
return factory2.updateGetAccessorDeclaration(
|
|
111899
|
-
updatedNode,
|
|
111900
|
-
updatedNode.modifiers,
|
|
111901
|
-
updatedNode.name,
|
|
111902
|
-
newParamsNodeArray,
|
|
111903
|
-
updatedNode.type,
|
|
111904
|
-
updatedNode.body
|
|
111905
|
-
);
|
|
111906
|
-
case 178 /* SetAccessor */:
|
|
111907
|
-
return factory2.updateSetAccessorDeclaration(
|
|
111908
|
-
updatedNode,
|
|
111909
|
-
updatedNode.modifiers,
|
|
111910
|
-
updatedNode.name,
|
|
111911
|
-
newParamsNodeArray,
|
|
111912
|
-
updatedNode.body
|
|
111913
|
-
);
|
|
111914
|
-
case 219 /* ArrowFunction */:
|
|
111915
|
-
return factory2.updateArrowFunction(
|
|
111916
|
-
updatedNode,
|
|
111917
|
-
updatedNode.modifiers,
|
|
111918
|
-
updatedNode.typeParameters,
|
|
111919
|
-
newParamsNodeArray,
|
|
111920
|
-
updatedNode.type,
|
|
111921
|
-
updatedNode.equalsGreaterThanToken,
|
|
111922
|
-
updatedNode.body
|
|
111923
|
-
);
|
|
111924
|
-
case 262 /* FunctionDeclaration */:
|
|
111925
|
-
return factory2.updateFunctionDeclaration(
|
|
111926
|
-
updatedNode,
|
|
111927
|
-
updatedNode.modifiers,
|
|
111928
|
-
updatedNode.asteriskToken,
|
|
111929
|
-
updatedNode.name,
|
|
111930
|
-
updatedNode.typeParameters,
|
|
111931
|
-
newParamsNodeArray,
|
|
111932
|
-
updatedNode.type,
|
|
111933
|
-
updatedNode.body
|
|
111934
|
-
);
|
|
111935
|
-
case 179 /* CallSignature */:
|
|
111936
|
-
return factory2.updateCallSignature(
|
|
111937
|
-
updatedNode,
|
|
111938
|
-
updatedNode.typeParameters,
|
|
111939
|
-
newParamsNodeArray,
|
|
111940
|
-
updatedNode.type
|
|
111941
|
-
);
|
|
111942
|
-
case 173 /* MethodSignature */:
|
|
111943
|
-
return factory2.updateMethodSignature(
|
|
111944
|
-
updatedNode,
|
|
111945
|
-
updatedNode.modifiers,
|
|
111946
|
-
updatedNode.name,
|
|
111947
|
-
updatedNode.questionToken,
|
|
111948
|
-
updatedNode.typeParameters,
|
|
111949
|
-
newParamsNodeArray,
|
|
111950
|
-
updatedNode.type
|
|
111951
|
-
);
|
|
111952
|
-
case 180 /* ConstructSignature */:
|
|
111953
|
-
return factory2.updateConstructSignature(
|
|
111954
|
-
updatedNode,
|
|
111955
|
-
updatedNode.typeParameters,
|
|
111956
|
-
newParamsNodeArray,
|
|
111957
|
-
updatedNode.type
|
|
111958
|
-
);
|
|
111959
|
-
case 184 /* FunctionType */:
|
|
111960
|
-
return factory2.updateFunctionTypeNode(
|
|
111961
|
-
updatedNode,
|
|
111962
|
-
updatedNode.typeParameters,
|
|
111963
|
-
newParamsNodeArray,
|
|
111964
|
-
updatedNode.type
|
|
111965
|
-
);
|
|
111966
|
-
case 185 /* ConstructorType */:
|
|
111967
|
-
return factory2.updateConstructorTypeNode(
|
|
111968
|
-
updatedNode,
|
|
111969
|
-
updatedNode.modifiers,
|
|
111970
|
-
updatedNode.typeParameters,
|
|
111971
|
-
newParamsNodeArray,
|
|
111972
|
-
updatedNode.type
|
|
111973
|
-
);
|
|
111974
|
-
default:
|
|
111975
|
-
Debug.assertNever(updatedNode);
|
|
111976
|
-
}
|
|
111977
|
-
function addUsedBindingPatternsToParameter(p) {
|
|
111978
|
-
return factory2.updateParameterDeclaration(
|
|
111979
|
-
p,
|
|
111980
|
-
p.modifiers,
|
|
111981
|
-
p.dotDotDotToken,
|
|
111982
|
-
addUsedBindingPatternAliases(p.name),
|
|
111983
|
-
p.questionToken,
|
|
111984
|
-
p.type,
|
|
111985
|
-
p.initializer
|
|
111986
|
-
);
|
|
111987
|
-
}
|
|
111988
|
-
function addUsedBindingPatternAliases(name) {
|
|
111989
|
-
if (name.kind === 80 /* Identifier */) {
|
|
111990
|
-
return name;
|
|
111991
|
-
} else {
|
|
111992
|
-
if (name.kind === 207 /* ArrayBindingPattern */) {
|
|
111993
|
-
return factory2.updateArrayBindingPattern(name, visitNodes2(name.elements, visitBindingElement, isArrayBindingElement));
|
|
111994
|
-
} else {
|
|
111995
|
-
return factory2.updateObjectBindingPattern(name, visitNodes2(name.elements, visitBindingElement, isBindingElement));
|
|
111996
|
-
}
|
|
111997
|
-
}
|
|
111998
|
-
function visitBindingElement(elem) {
|
|
111999
|
-
if (elem.kind === 232 /* OmittedExpression */) {
|
|
112000
|
-
return elem;
|
|
112001
|
-
}
|
|
112002
|
-
const usedAlias = aliases.get(getOriginalNode(elem));
|
|
112003
|
-
if (usedAlias && !elem.propertyName) {
|
|
112004
|
-
return factory2.updateBindingElement(
|
|
112005
|
-
elem,
|
|
112006
|
-
elem.dotDotDotToken,
|
|
112007
|
-
elem.name,
|
|
112008
|
-
usedAlias,
|
|
112009
|
-
elem.initializer
|
|
112010
|
-
);
|
|
112011
|
-
}
|
|
112012
|
-
return factory2.updateBindingElement(
|
|
112013
|
-
elem,
|
|
112014
|
-
elem.dotDotDotToken,
|
|
112015
|
-
elem.propertyName,
|
|
112016
|
-
addUsedBindingPatternAliases(elem.name),
|
|
112017
|
-
elem.initializer
|
|
112018
|
-
);
|
|
112019
|
-
}
|
|
112020
|
-
}
|
|
112021
|
-
}
|
|
112022
111916
|
function ensureParameter(p, modifierMask, type) {
|
|
112023
111917
|
let oldDiag;
|
|
112024
111918
|
if (!suppressNewDiagnosticContexts) {
|
|
@@ -112029,7 +111923,7 @@ ${lanes.join("\n")}
|
|
|
112029
111923
|
p,
|
|
112030
111924
|
maskModifiers(factory2, p, modifierMask),
|
|
112031
111925
|
p.dotDotDotToken,
|
|
112032
|
-
|
|
111926
|
+
filterBindingPatternInitializers(p.name),
|
|
112033
111927
|
resolver.isOptionalParameter(p) ? p.questionToken || factory2.createToken(58 /* QuestionToken */) : void 0,
|
|
112034
111928
|
ensureType(
|
|
112035
111929
|
p,
|
|
@@ -112405,25 +112299,19 @@ ${lanes.join("\n")}
|
|
|
112405
112299
|
return cleanup(factory2.updateTypeReferenceNode(node, node.typeName, node.typeArguments));
|
|
112406
112300
|
}
|
|
112407
112301
|
case 180 /* ConstructSignature */:
|
|
112408
|
-
return cleanup(
|
|
112302
|
+
return cleanup(factory2.updateConstructSignature(
|
|
112409
112303
|
input,
|
|
112410
|
-
|
|
112411
|
-
|
|
112412
|
-
|
|
112413
|
-
updateParamsList(input, input.parameters),
|
|
112414
|
-
ensureType(input, input.type)
|
|
112415
|
-
)
|
|
112304
|
+
ensureTypeParams(input, input.typeParameters),
|
|
112305
|
+
updateParamsList(input, input.parameters),
|
|
112306
|
+
ensureType(input, input.type)
|
|
112416
112307
|
));
|
|
112417
112308
|
case 176 /* Constructor */: {
|
|
112418
|
-
const ctor =
|
|
112419
|
-
|
|
112420
|
-
|
|
112421
|
-
|
|
112422
|
-
|
|
112423
|
-
|
|
112424
|
-
/*body*/
|
|
112425
|
-
void 0
|
|
112426
|
-
)
|
|
112309
|
+
const ctor = factory2.createConstructorDeclaration(
|
|
112310
|
+
/*modifiers*/
|
|
112311
|
+
ensureModifiers(input),
|
|
112312
|
+
updateParamsList(input, input.parameters, 0 /* None */),
|
|
112313
|
+
/*body*/
|
|
112314
|
+
void 0
|
|
112427
112315
|
);
|
|
112428
112316
|
return cleanup(ctor);
|
|
112429
112317
|
}
|
|
@@ -112434,20 +112322,17 @@ ${lanes.join("\n")}
|
|
|
112434
112322
|
void 0
|
|
112435
112323
|
);
|
|
112436
112324
|
}
|
|
112437
|
-
const sig =
|
|
112438
|
-
input,
|
|
112439
|
-
|
|
112440
|
-
|
|
112441
|
-
|
|
112442
|
-
|
|
112443
|
-
|
|
112444
|
-
|
|
112445
|
-
|
|
112446
|
-
|
|
112447
|
-
|
|
112448
|
-
/*body*/
|
|
112449
|
-
void 0
|
|
112450
|
-
)
|
|
112325
|
+
const sig = factory2.createMethodDeclaration(
|
|
112326
|
+
ensureModifiers(input),
|
|
112327
|
+
/*asteriskToken*/
|
|
112328
|
+
void 0,
|
|
112329
|
+
input.name,
|
|
112330
|
+
input.questionToken,
|
|
112331
|
+
ensureTypeParams(input, input.typeParameters),
|
|
112332
|
+
updateParamsList(input, input.parameters),
|
|
112333
|
+
ensureType(input, input.type),
|
|
112334
|
+
/*body*/
|
|
112335
|
+
void 0
|
|
112451
112336
|
);
|
|
112452
112337
|
return cleanup(sig);
|
|
112453
112338
|
}
|
|
@@ -112459,17 +112344,14 @@ ${lanes.join("\n")}
|
|
|
112459
112344
|
);
|
|
112460
112345
|
}
|
|
112461
112346
|
const accessorType = getTypeAnnotationFromAllAccessorDeclarations(input, resolver.getAllAccessorDeclarations(input));
|
|
112462
|
-
return cleanup(
|
|
112347
|
+
return cleanup(factory2.updateGetAccessorDeclaration(
|
|
112463
112348
|
input,
|
|
112464
|
-
|
|
112465
|
-
|
|
112466
|
-
|
|
112467
|
-
|
|
112468
|
-
|
|
112469
|
-
|
|
112470
|
-
/*body*/
|
|
112471
|
-
void 0
|
|
112472
|
-
)
|
|
112349
|
+
ensureModifiers(input),
|
|
112350
|
+
input.name,
|
|
112351
|
+
updateAccessorParamsList(input, hasEffectiveModifier(input, 2 /* Private */)),
|
|
112352
|
+
ensureType(input, accessorType),
|
|
112353
|
+
/*body*/
|
|
112354
|
+
void 0
|
|
112473
112355
|
));
|
|
112474
112356
|
}
|
|
112475
112357
|
case 178 /* SetAccessor */: {
|
|
@@ -112479,16 +112361,13 @@ ${lanes.join("\n")}
|
|
|
112479
112361
|
void 0
|
|
112480
112362
|
);
|
|
112481
112363
|
}
|
|
112482
|
-
return cleanup(
|
|
112364
|
+
return cleanup(factory2.updateSetAccessorDeclaration(
|
|
112483
112365
|
input,
|
|
112484
|
-
|
|
112485
|
-
|
|
112486
|
-
|
|
112487
|
-
|
|
112488
|
-
|
|
112489
|
-
/*body*/
|
|
112490
|
-
void 0
|
|
112491
|
-
)
|
|
112366
|
+
ensureModifiers(input),
|
|
112367
|
+
input.name,
|
|
112368
|
+
updateAccessorParamsList(input, hasEffectiveModifier(input, 2 /* Private */)),
|
|
112369
|
+
/*body*/
|
|
112370
|
+
void 0
|
|
112492
112371
|
));
|
|
112493
112372
|
}
|
|
112494
112373
|
case 172 /* PropertyDeclaration */:
|
|
@@ -112527,29 +112406,25 @@ ${lanes.join("\n")}
|
|
|
112527
112406
|
void 0
|
|
112528
112407
|
);
|
|
112529
112408
|
}
|
|
112530
|
-
return cleanup(
|
|
112409
|
+
return cleanup(factory2.updateMethodSignature(
|
|
112531
112410
|
input,
|
|
112532
|
-
|
|
112533
|
-
|
|
112534
|
-
|
|
112535
|
-
|
|
112536
|
-
|
|
112537
|
-
|
|
112538
|
-
updateParamsList(input, input.parameters),
|
|
112539
|
-
ensureType(input, input.type)
|
|
112540
|
-
)
|
|
112411
|
+
ensureModifiers(input),
|
|
112412
|
+
input.name,
|
|
112413
|
+
input.questionToken,
|
|
112414
|
+
ensureTypeParams(input, input.typeParameters),
|
|
112415
|
+
updateParamsList(input, input.parameters),
|
|
112416
|
+
ensureType(input, input.type)
|
|
112541
112417
|
));
|
|
112542
112418
|
}
|
|
112543
112419
|
case 179 /* CallSignature */: {
|
|
112544
|
-
return cleanup(
|
|
112545
|
-
input,
|
|
112420
|
+
return cleanup(
|
|
112546
112421
|
factory2.updateCallSignature(
|
|
112547
112422
|
input,
|
|
112548
112423
|
ensureTypeParams(input, input.typeParameters),
|
|
112549
112424
|
updateParamsList(input, input.parameters),
|
|
112550
112425
|
ensureType(input, input.type)
|
|
112551
112426
|
)
|
|
112552
|
-
)
|
|
112427
|
+
);
|
|
112553
112428
|
}
|
|
112554
112429
|
case 181 /* IndexSignature */: {
|
|
112555
112430
|
return cleanup(factory2.updateIndexSignature(
|
|
@@ -112603,26 +112478,20 @@ ${lanes.join("\n")}
|
|
|
112603
112478
|
return cleanup(factory2.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType));
|
|
112604
112479
|
}
|
|
112605
112480
|
case 184 /* FunctionType */: {
|
|
112606
|
-
return cleanup(
|
|
112481
|
+
return cleanup(factory2.updateFunctionTypeNode(
|
|
112607
112482
|
input,
|
|
112608
|
-
|
|
112609
|
-
|
|
112610
|
-
|
|
112611
|
-
updateParamsList(input, input.parameters),
|
|
112612
|
-
Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode))
|
|
112613
|
-
)
|
|
112483
|
+
visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration),
|
|
112484
|
+
updateParamsList(input, input.parameters),
|
|
112485
|
+
Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode))
|
|
112614
112486
|
));
|
|
112615
112487
|
}
|
|
112616
112488
|
case 185 /* ConstructorType */: {
|
|
112617
|
-
return cleanup(
|
|
112489
|
+
return cleanup(factory2.updateConstructorTypeNode(
|
|
112618
112490
|
input,
|
|
112619
|
-
|
|
112620
|
-
|
|
112621
|
-
|
|
112622
|
-
|
|
112623
|
-
updateParamsList(input, input.parameters),
|
|
112624
|
-
Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode))
|
|
112625
|
-
)
|
|
112491
|
+
ensureModifiers(input),
|
|
112492
|
+
visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration),
|
|
112493
|
+
updateParamsList(input, input.parameters),
|
|
112494
|
+
Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode))
|
|
112626
112495
|
));
|
|
112627
112496
|
}
|
|
112628
112497
|
case 205 /* ImportType */: {
|
|
@@ -112808,20 +112677,17 @@ ${lanes.join("\n")}
|
|
|
112808
112677
|
));
|
|
112809
112678
|
}
|
|
112810
112679
|
case 262 /* FunctionDeclaration */: {
|
|
112811
|
-
const clean2 = cleanup(
|
|
112680
|
+
const clean2 = cleanup(factory2.updateFunctionDeclaration(
|
|
112812
112681
|
input,
|
|
112813
|
-
|
|
112814
|
-
|
|
112815
|
-
|
|
112816
|
-
|
|
112817
|
-
|
|
112818
|
-
|
|
112819
|
-
|
|
112820
|
-
|
|
112821
|
-
|
|
112822
|
-
/*body*/
|
|
112823
|
-
void 0
|
|
112824
|
-
)
|
|
112682
|
+
ensureModifiers(input),
|
|
112683
|
+
/*asteriskToken*/
|
|
112684
|
+
void 0,
|
|
112685
|
+
input.name,
|
|
112686
|
+
ensureTypeParams(input, input.typeParameters),
|
|
112687
|
+
updateParamsList(input, input.parameters),
|
|
112688
|
+
ensureType(input, input.type),
|
|
112689
|
+
/*body*/
|
|
112690
|
+
void 0
|
|
112825
112691
|
));
|
|
112826
112692
|
if (clean2 && resolver.isExpandoFunctionDeclaration(input) && shouldEmitFunctionProperties(input)) {
|
|
112827
112693
|
const props = resolver.getPropertiesOfContainerFunction(input);
|
|
@@ -132964,7 +132830,14 @@ ${lanes.join("\n")}
|
|
|
132964
132830
|
true,
|
|
132965
132831
|
replaceNode
|
|
132966
132832
|
) : (ns) => ns && getSynthesizedDeepClones(ns);
|
|
132967
|
-
const visited = visitEachChild(
|
|
132833
|
+
const visited = visitEachChild(
|
|
132834
|
+
node,
|
|
132835
|
+
nodeClone,
|
|
132836
|
+
/*context*/
|
|
132837
|
+
void 0,
|
|
132838
|
+
nodesClone,
|
|
132839
|
+
nodeClone
|
|
132840
|
+
);
|
|
132968
132841
|
if (visited === node) {
|
|
132969
132842
|
const clone2 = isStringLiteral(node) ? setOriginalNode(factory.createStringLiteralFromNode(node), node) : isNumericLiteral(node) ? setOriginalNode(factory.createNumericLiteral(node.text, node.numericLiteralFlags), node) : factory.cloneNode(node);
|
|
132970
132843
|
return setTextRange(clone2, node);
|
|
@@ -142921,7 +142794,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
142921
142794
|
const oldIgnoreReturns = ignoreReturns;
|
|
142922
142795
|
ignoreReturns = ignoreReturns || isFunctionLikeDeclaration(node) || isClassLike(node);
|
|
142923
142796
|
const substitution = substitutions.get(getNodeId(node).toString());
|
|
142924
|
-
const result = substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
142797
|
+
const result = substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
142798
|
+
node,
|
|
142799
|
+
visitor,
|
|
142800
|
+
/*context*/
|
|
142801
|
+
void 0
|
|
142802
|
+
);
|
|
142925
142803
|
ignoreReturns = oldIgnoreReturns;
|
|
142926
142804
|
return result;
|
|
142927
142805
|
}
|
|
@@ -142931,7 +142809,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
142931
142809
|
return substitutions.size ? visitor(initializer) : initializer;
|
|
142932
142810
|
function visitor(node) {
|
|
142933
142811
|
const substitution = substitutions.get(getNodeId(node).toString());
|
|
142934
|
-
return substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
142812
|
+
return substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
142813
|
+
node,
|
|
142814
|
+
visitor,
|
|
142815
|
+
/*context*/
|
|
142816
|
+
void 0
|
|
142817
|
+
);
|
|
142935
142818
|
}
|
|
142936
142819
|
}
|
|
142937
142820
|
function getStatementsOrClassElements(scope) {
|
|
@@ -147942,7 +147825,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
147942
147825
|
case 329 /* JSDocTypeLiteral */:
|
|
147943
147826
|
return transformJSDocTypeLiteral(node);
|
|
147944
147827
|
default:
|
|
147945
|
-
const visited = visitEachChild(
|
|
147828
|
+
const visited = visitEachChild(
|
|
147829
|
+
node,
|
|
147830
|
+
transformJSDocType,
|
|
147831
|
+
/*context*/
|
|
147832
|
+
void 0
|
|
147833
|
+
);
|
|
147946
147834
|
setEmitFlags(visited, 1 /* SingleLine */);
|
|
147947
147835
|
return visited;
|
|
147948
147836
|
}
|
|
@@ -156433,7 +156321,12 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
156433
156321
|
const typeArguments = visitNodes2(node.typeArguments, visit, isTypeNode);
|
|
156434
156322
|
return factory.createTypeReferenceNode(qualifier, typeArguments);
|
|
156435
156323
|
}
|
|
156436
|
-
return visitEachChild(
|
|
156324
|
+
return visitEachChild(
|
|
156325
|
+
node,
|
|
156326
|
+
visit,
|
|
156327
|
+
/*context*/
|
|
156328
|
+
void 0
|
|
156329
|
+
);
|
|
156437
156330
|
}
|
|
156438
156331
|
}
|
|
156439
156332
|
function replaceFirstIdentifierOfEntityName(name, newIdentifier) {
|
|
@@ -163192,6 +163085,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
163192
163085
|
return isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(
|
|
163193
163086
|
findAncestor(node.parent, (node2) => isBinaryExpression(node2) || isForInOrOfStatement(node2))
|
|
163194
163087
|
) : node;
|
|
163088
|
+
case 255 /* SwitchStatement */:
|
|
163089
|
+
return {
|
|
163090
|
+
start: find(node.getChildren(node.getSourceFile()), (node2) => node2.kind === 109 /* SwitchKeyword */),
|
|
163091
|
+
end: node.caseBlock
|
|
163092
|
+
};
|
|
163195
163093
|
default:
|
|
163196
163094
|
return node;
|
|
163197
163095
|
}
|
|
@@ -163486,6 +163384,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
163486
163384
|
start += 1;
|
|
163487
163385
|
end -= 1;
|
|
163488
163386
|
}
|
|
163387
|
+
if ((endNode2 == null ? void 0 : endNode2.kind) === 269 /* CaseBlock */) {
|
|
163388
|
+
end = endNode2.getFullStart();
|
|
163389
|
+
}
|
|
163489
163390
|
return createTextSpanFromBounds(start, end);
|
|
163490
163391
|
}
|
|
163491
163392
|
function getTextSpanOfEntry(entry) {
|
|
@@ -165096,9 +164997,20 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
165096
164997
|
void 0
|
|
165097
164998
|
)] : void 0;
|
|
165098
164999
|
}
|
|
165099
|
-
|
|
165100
|
-
|
|
165101
|
-
|
|
165000
|
+
switch (node.kind) {
|
|
165001
|
+
case 107 /* ReturnKeyword */:
|
|
165002
|
+
const functionDeclaration = findAncestor(node.parent, (n) => isClassStaticBlockDeclaration(n) ? "quit" : isFunctionLikeDeclaration(n));
|
|
165003
|
+
return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
165004
|
+
case 90 /* DefaultKeyword */:
|
|
165005
|
+
if (!isDefaultClause(node.parent)) {
|
|
165006
|
+
break;
|
|
165007
|
+
}
|
|
165008
|
+
case 84 /* CaseKeyword */:
|
|
165009
|
+
const switchStatement = findAncestor(node.parent, isSwitchStatement);
|
|
165010
|
+
if (switchStatement) {
|
|
165011
|
+
return [createDefinitionInfoFromSwitch(switchStatement, sourceFile)];
|
|
165012
|
+
}
|
|
165013
|
+
break;
|
|
165102
165014
|
}
|
|
165103
165015
|
if (node.kind === 135 /* AwaitKeyword */) {
|
|
165104
165016
|
const functionDeclaration = findAncestor(node, (n) => isFunctionLikeDeclaration(n));
|
|
@@ -165495,6 +165407,23 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
165495
165407
|
failedAliasResolution
|
|
165496
165408
|
};
|
|
165497
165409
|
}
|
|
165410
|
+
function createDefinitionInfoFromSwitch(statement, sourceFile) {
|
|
165411
|
+
const keyword = ts_FindAllReferences_exports.getContextNode(statement);
|
|
165412
|
+
const textSpan = createTextSpanFromNode(isContextWithStartAndEndNode(keyword) ? keyword.start : keyword, sourceFile);
|
|
165413
|
+
return {
|
|
165414
|
+
fileName: sourceFile.fileName,
|
|
165415
|
+
textSpan,
|
|
165416
|
+
kind: "keyword" /* keyword */,
|
|
165417
|
+
name: "switch",
|
|
165418
|
+
containerKind: void 0,
|
|
165419
|
+
containerName: "",
|
|
165420
|
+
...ts_FindAllReferences_exports.toContextSpan(textSpan, sourceFile, keyword),
|
|
165421
|
+
isLocal: true,
|
|
165422
|
+
isAmbient: false,
|
|
165423
|
+
unverified: false,
|
|
165424
|
+
failedAliasResolution: void 0
|
|
165425
|
+
};
|
|
165426
|
+
}
|
|
165498
165427
|
function isDefinitionVisible(checker, declaration) {
|
|
165499
165428
|
if (checker.isDeclarationVisible(declaration))
|
|
165500
165429
|
return true;
|
|
@@ -165572,6 +165501,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
165572
165501
|
"src/services/goToDefinition.ts"() {
|
|
165573
165502
|
"use strict";
|
|
165574
165503
|
init_ts4();
|
|
165504
|
+
init_ts_FindAllReferences();
|
|
165575
165505
|
typesWithUnwrappedTypeArguments = /* @__PURE__ */ new Set([
|
|
165576
165506
|
"Array",
|
|
165577
165507
|
"ArrayLike",
|