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/tsserver.js
CHANGED
|
@@ -2341,7 +2341,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2341
2341
|
|
|
2342
2342
|
// src/compiler/corePublic.ts
|
|
2343
2343
|
var versionMajorMinor = "5.4";
|
|
2344
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2344
|
+
var version = `${versionMajorMinor}.0-dev.20240113`;
|
|
2345
2345
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2346
2346
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2347
2347
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -8448,6 +8448,7 @@ var sys = (() => {
|
|
|
8448
8448
|
resolvePath: (path) => _path.resolve(path),
|
|
8449
8449
|
fileExists,
|
|
8450
8450
|
directoryExists,
|
|
8451
|
+
getAccessibleFileSystemEntries,
|
|
8451
8452
|
createDirectory(directoryName) {
|
|
8452
8453
|
if (!nodeSystem.directoryExists(directoryName)) {
|
|
8453
8454
|
try {
|
|
@@ -15132,6 +15133,45 @@ function isRestParameter(node) {
|
|
|
15132
15133
|
const type = isJSDocParameterTag(node) ? node.typeExpression && node.typeExpression.type : node.type;
|
|
15133
15134
|
return node.dotDotDotToken !== void 0 || !!type && type.kind === 325 /* JSDocVariadicType */;
|
|
15134
15135
|
}
|
|
15136
|
+
function hasInternalAnnotation(range, sourceFile) {
|
|
15137
|
+
const comment = sourceFile.text.substring(range.pos, range.end);
|
|
15138
|
+
return comment.includes("@internal");
|
|
15139
|
+
}
|
|
15140
|
+
function isInternalDeclaration(node, sourceFile) {
|
|
15141
|
+
sourceFile ?? (sourceFile = getSourceFileOfNode(node));
|
|
15142
|
+
const parseTreeNode = getParseTreeNode(node);
|
|
15143
|
+
if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) {
|
|
15144
|
+
const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);
|
|
15145
|
+
const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0;
|
|
15146
|
+
const text = sourceFile.text;
|
|
15147
|
+
const commentRanges = previousSibling ? concatenate(
|
|
15148
|
+
// to handle
|
|
15149
|
+
// ... parameters, /** @internal */
|
|
15150
|
+
// public param: string
|
|
15151
|
+
getTrailingCommentRanges(text, skipTrivia(
|
|
15152
|
+
text,
|
|
15153
|
+
previousSibling.end + 1,
|
|
15154
|
+
/*stopAfterLineBreak*/
|
|
15155
|
+
false,
|
|
15156
|
+
/*stopAtComments*/
|
|
15157
|
+
true
|
|
15158
|
+
)),
|
|
15159
|
+
getLeadingCommentRanges(text, node.pos)
|
|
15160
|
+
) : getTrailingCommentRanges(text, skipTrivia(
|
|
15161
|
+
text,
|
|
15162
|
+
node.pos,
|
|
15163
|
+
/*stopAfterLineBreak*/
|
|
15164
|
+
false,
|
|
15165
|
+
/*stopAtComments*/
|
|
15166
|
+
true
|
|
15167
|
+
));
|
|
15168
|
+
return some(commentRanges) && hasInternalAnnotation(last(commentRanges), sourceFile);
|
|
15169
|
+
}
|
|
15170
|
+
const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, sourceFile);
|
|
15171
|
+
return !!forEach(leadingCommentRanges, (range) => {
|
|
15172
|
+
return hasInternalAnnotation(range, sourceFile);
|
|
15173
|
+
});
|
|
15174
|
+
}
|
|
15135
15175
|
|
|
15136
15176
|
// src/compiler/utilities.ts
|
|
15137
15177
|
var resolvingEmptyArray = [];
|
|
@@ -38508,7 +38548,7 @@ var libEntries = [
|
|
|
38508
38548
|
["es2023.array", "lib.es2023.array.d.ts"],
|
|
38509
38549
|
["es2023.collection", "lib.es2023.collection.d.ts"],
|
|
38510
38550
|
["esnext.array", "lib.es2023.array.d.ts"],
|
|
38511
|
-
["esnext.collection", "lib.
|
|
38551
|
+
["esnext.collection", "lib.esnext.collection.d.ts"],
|
|
38512
38552
|
["esnext.symbol", "lib.es2019.symbol.d.ts"],
|
|
38513
38553
|
["esnext.asynciterable", "lib.es2018.asynciterable.d.ts"],
|
|
38514
38554
|
["esnext.intl", "lib.esnext.intl.d.ts"],
|
|
@@ -38518,6 +38558,7 @@ var libEntries = [
|
|
|
38518
38558
|
["esnext.promise", "lib.esnext.promise.d.ts"],
|
|
38519
38559
|
["esnext.weakref", "lib.es2021.weakref.d.ts"],
|
|
38520
38560
|
["esnext.decorators", "lib.esnext.decorators.d.ts"],
|
|
38561
|
+
["esnext.object", "lib.esnext.object.d.ts"],
|
|
38521
38562
|
["decorators", "lib.decorators.d.ts"],
|
|
38522
38563
|
["decorators.legacy", "lib.decorators.legacy.d.ts"]
|
|
38523
38564
|
];
|
|
@@ -48261,7 +48302,8 @@ var intrinsicTypeKinds = new Map(Object.entries({
|
|
|
48261
48302
|
Uppercase: 0 /* Uppercase */,
|
|
48262
48303
|
Lowercase: 1 /* Lowercase */,
|
|
48263
48304
|
Capitalize: 2 /* Capitalize */,
|
|
48264
|
-
Uncapitalize: 3 /* Uncapitalize
|
|
48305
|
+
Uncapitalize: 3 /* Uncapitalize */,
|
|
48306
|
+
NoInfer: 4 /* NoInfer */
|
|
48265
48307
|
}));
|
|
48266
48308
|
var SymbolLinks = class {
|
|
48267
48309
|
};
|
|
@@ -49346,7 +49388,12 @@ function createTypeChecker(host) {
|
|
|
49346
49388
|
}
|
|
49347
49389
|
function markAsSynthetic(node) {
|
|
49348
49390
|
setTextRangePosEnd(node, -1, -1);
|
|
49349
|
-
return visitEachChild(
|
|
49391
|
+
return visitEachChild(
|
|
49392
|
+
node,
|
|
49393
|
+
markAsSynthetic,
|
|
49394
|
+
/*context*/
|
|
49395
|
+
void 0
|
|
49396
|
+
);
|
|
49350
49397
|
}
|
|
49351
49398
|
function getEmitResolver(sourceFile, cancellationToken2) {
|
|
49352
49399
|
getDiagnostics2(sourceFile, cancellationToken2);
|
|
@@ -52622,16 +52669,12 @@ function createTypeChecker(host) {
|
|
|
52622
52669
|
}
|
|
52623
52670
|
function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) {
|
|
52624
52671
|
let aliasesToMakeVisible;
|
|
52625
|
-
let bindingElementToMakeVisible;
|
|
52626
52672
|
if (!every(filter(symbol.declarations, (d) => d.kind !== 80 /* Identifier */), getIsDeclarationVisible)) {
|
|
52627
52673
|
return void 0;
|
|
52628
52674
|
}
|
|
52629
|
-
return { accessibility: 0 /* Accessible */, aliasesToMakeVisible
|
|
52675
|
+
return { accessibility: 0 /* Accessible */, aliasesToMakeVisible };
|
|
52630
52676
|
function getIsDeclarationVisible(declaration) {
|
|
52631
52677
|
var _a, _b;
|
|
52632
|
-
if (isBindingElement(declaration) && findAncestor(declaration, isParameter)) {
|
|
52633
|
-
bindingElementToMakeVisible = declaration;
|
|
52634
|
-
}
|
|
52635
52678
|
if (!isDeclarationVisible(declaration)) {
|
|
52636
52679
|
const anyImportSyntax = getAnyImportSyntax(declaration);
|
|
52637
52680
|
if (anyImportSyntax && !hasSyntacticModifier(anyImportSyntax, 32 /* Export */) && // import clause without export
|
|
@@ -53142,7 +53185,13 @@ function createTypeChecker(host) {
|
|
|
53142
53185
|
return visitAndTransformType(type, (type2) => conditionalTypeToTypeNode(type2));
|
|
53143
53186
|
}
|
|
53144
53187
|
if (type.flags & 33554432 /* Substitution */) {
|
|
53145
|
-
|
|
53188
|
+
const typeNode = typeToTypeNodeHelper(type.baseType, context);
|
|
53189
|
+
const noInferSymbol = isNoInferType(type) && getGlobalTypeSymbol(
|
|
53190
|
+
"NoInfer",
|
|
53191
|
+
/*reportErrors*/
|
|
53192
|
+
false
|
|
53193
|
+
);
|
|
53194
|
+
return noInferSymbol ? symbolToTypeNode(noInferSymbol, context, 788968 /* Type */, [typeNode]) : typeNode;
|
|
53146
53195
|
}
|
|
53147
53196
|
return Debug.fail("Should be unreachable.");
|
|
53148
53197
|
function conditionalTypeToTypeNode(type2) {
|
|
@@ -53388,7 +53437,13 @@ function createTypeChecker(host) {
|
|
|
53388
53437
|
if (!nodeIsSynthesized(node) && getParseTreeNode(node) === node) {
|
|
53389
53438
|
return node;
|
|
53390
53439
|
}
|
|
53391
|
-
return setTextRange(factory.cloneNode(visitEachChild(
|
|
53440
|
+
return setTextRange(factory.cloneNode(visitEachChild(
|
|
53441
|
+
node,
|
|
53442
|
+
deepCloneOrReuseNode,
|
|
53443
|
+
/*context*/
|
|
53444
|
+
void 0,
|
|
53445
|
+
deepCloneOrReuseNodes
|
|
53446
|
+
)), node);
|
|
53392
53447
|
}
|
|
53393
53448
|
function deepCloneOrReuseNodes(nodes, visitor, test, start2, count) {
|
|
53394
53449
|
if (nodes && nodes.length === 0) {
|
|
@@ -54110,7 +54165,8 @@ function createTypeChecker(host) {
|
|
|
54110
54165
|
let visited = visitEachChild(
|
|
54111
54166
|
node2,
|
|
54112
54167
|
elideInitializerAndSetEmitFlags,
|
|
54113
|
-
|
|
54168
|
+
/*context*/
|
|
54169
|
+
void 0,
|
|
54114
54170
|
/*nodesVisitor*/
|
|
54115
54171
|
void 0,
|
|
54116
54172
|
elideInitializerAndSetEmitFlags
|
|
@@ -54888,7 +54944,12 @@ function createTypeChecker(host) {
|
|
|
54888
54944
|
if (file && isTupleTypeNode(node) && getLineAndCharacterOfPosition(file, node.pos).line === getLineAndCharacterOfPosition(file, node.end).line) {
|
|
54889
54945
|
setEmitFlags(node, 1 /* SingleLine */);
|
|
54890
54946
|
}
|
|
54891
|
-
return visitEachChild(
|
|
54947
|
+
return visitEachChild(
|
|
54948
|
+
node,
|
|
54949
|
+
visitExistingNodeTreeSymbols,
|
|
54950
|
+
/*context*/
|
|
54951
|
+
void 0
|
|
54952
|
+
);
|
|
54892
54953
|
function getEffectiveDotDotDotForParameter(p) {
|
|
54893
54954
|
return p.dotDotDotToken || (p.type && isJSDocVariadicType(p.type) ? factory.createToken(26 /* DotDotDotToken */) : void 0);
|
|
54894
54955
|
}
|
|
@@ -54988,7 +55049,7 @@ function createTypeChecker(host) {
|
|
|
54988
55049
|
});
|
|
54989
55050
|
let addingDeclare = !bundled;
|
|
54990
55051
|
const exportEquals = symbolTable.get("export=" /* ExportEquals */);
|
|
54991
|
-
if (exportEquals && symbolTable.size > 1 && exportEquals.flags & 2097152 /* Alias */) {
|
|
55052
|
+
if (exportEquals && symbolTable.size > 1 && exportEquals.flags & (2097152 /* Alias */ | 1536 /* Module */)) {
|
|
54992
55053
|
symbolTable = createSymbolTable();
|
|
54993
55054
|
symbolTable.set("export=" /* ExportEquals */, exportEquals);
|
|
54994
55055
|
}
|
|
@@ -55445,8 +55506,18 @@ function createTypeChecker(host) {
|
|
|
55445
55506
|
);
|
|
55446
55507
|
}
|
|
55447
55508
|
function getNamespaceMembersForSerialization(symbol) {
|
|
55448
|
-
|
|
55449
|
-
|
|
55509
|
+
let exports2 = arrayFrom(getExportsOfSymbol(symbol).values());
|
|
55510
|
+
const merged = getMergedSymbol(symbol);
|
|
55511
|
+
if (merged !== symbol) {
|
|
55512
|
+
const membersSet = new Set(exports2);
|
|
55513
|
+
for (const exported of getExportsOfSymbol(merged).values()) {
|
|
55514
|
+
if (!(getSymbolFlags(resolveSymbol(exported)) & 111551 /* Value */)) {
|
|
55515
|
+
membersSet.add(exported);
|
|
55516
|
+
}
|
|
55517
|
+
}
|
|
55518
|
+
exports2 = arrayFrom(membersSet);
|
|
55519
|
+
}
|
|
55520
|
+
return filter(exports2, (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
|
|
55450
55521
|
}
|
|
55451
55522
|
function isTypeOnlyNamespace(symbol) {
|
|
55452
55523
|
return every(getNamespaceMembersForSerialization(symbol), (m) => !(getSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
|
|
@@ -61090,8 +61161,11 @@ function createTypeChecker(host) {
|
|
|
61090
61161
|
}
|
|
61091
61162
|
function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) {
|
|
61092
61163
|
const type = getDeclaredTypeOfSymbol(symbol);
|
|
61093
|
-
if (type === intrinsicMarkerType
|
|
61094
|
-
|
|
61164
|
+
if (type === intrinsicMarkerType) {
|
|
61165
|
+
const typeKind = intrinsicTypeKinds.get(symbol.escapedName);
|
|
61166
|
+
if (typeKind !== void 0 && typeArguments && typeArguments.length === 1) {
|
|
61167
|
+
return typeKind === 4 /* NoInfer */ ? getNoInferType(typeArguments[0]) : getStringMappingType(symbol, typeArguments[0]);
|
|
61168
|
+
}
|
|
61095
61169
|
}
|
|
61096
61170
|
const links = getSymbolLinks(symbol);
|
|
61097
61171
|
const typeParameters = links.typeParameters;
|
|
@@ -61245,10 +61319,19 @@ function createTypeChecker(host) {
|
|
|
61245
61319
|
}
|
|
61246
61320
|
return links.resolvedJSDocType;
|
|
61247
61321
|
}
|
|
61322
|
+
function getNoInferType(type) {
|
|
61323
|
+
return isNoInferTargetType(type) ? getOrCreateSubstitutionType(type, unknownType) : type;
|
|
61324
|
+
}
|
|
61325
|
+
function isNoInferTargetType(type) {
|
|
61326
|
+
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));
|
|
61327
|
+
}
|
|
61328
|
+
function isNoInferType(type) {
|
|
61329
|
+
return !!(type.flags & 33554432 /* Substitution */ && type.constraint.flags & 2 /* Unknown */);
|
|
61330
|
+
}
|
|
61248
61331
|
function getSubstitutionType(baseType, constraint) {
|
|
61249
|
-
|
|
61250
|
-
|
|
61251
|
-
|
|
61332
|
+
return constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType || baseType.flags & 1 /* Any */ ? baseType : getOrCreateSubstitutionType(baseType, constraint);
|
|
61333
|
+
}
|
|
61334
|
+
function getOrCreateSubstitutionType(baseType, constraint) {
|
|
61252
61335
|
const id = `${getTypeId(baseType)}>${getTypeId(constraint)}`;
|
|
61253
61336
|
const cached = substitutionTypes.get(id);
|
|
61254
61337
|
if (cached) {
|
|
@@ -61261,7 +61344,7 @@ function createTypeChecker(host) {
|
|
|
61261
61344
|
return result;
|
|
61262
61345
|
}
|
|
61263
61346
|
function getSubstitutionIntersection(substitutionType) {
|
|
61264
|
-
return getIntersectionType([substitutionType.constraint, substitutionType.baseType]);
|
|
61347
|
+
return isNoInferType(substitutionType) ? substitutionType.baseType : getIntersectionType([substitutionType.constraint, substitutionType.baseType]);
|
|
61265
61348
|
}
|
|
61266
61349
|
function isUnaryTupleTypeNode(node) {
|
|
61267
61350
|
return node.kind === 189 /* TupleType */ && node.elements.length === 1;
|
|
@@ -62790,7 +62873,7 @@ function createTypeChecker(host) {
|
|
|
62790
62873
|
}
|
|
62791
62874
|
function getIndexType(type, indexFlags = defaultIndexFlags) {
|
|
62792
62875
|
type = getReducedType(type);
|
|
62793
|
-
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);
|
|
62876
|
+
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);
|
|
62794
62877
|
}
|
|
62795
62878
|
function getExtractStringType(type) {
|
|
62796
62879
|
if (keyofStringsOnly) {
|
|
@@ -64533,6 +64616,9 @@ function createTypeChecker(host) {
|
|
|
64533
64616
|
}
|
|
64534
64617
|
if (flags & 33554432 /* Substitution */) {
|
|
64535
64618
|
const newBaseType = instantiateType(type.baseType, mapper);
|
|
64619
|
+
if (isNoInferType(type)) {
|
|
64620
|
+
return getNoInferType(newBaseType);
|
|
64621
|
+
}
|
|
64536
64622
|
const newConstraint = instantiateType(type.constraint, mapper);
|
|
64537
64623
|
if (newBaseType.flags & 8650752 /* TypeVariable */ && isGenericType(newConstraint)) {
|
|
64538
64624
|
return getSubstitutionType(newBaseType, newConstraint);
|
|
@@ -69325,7 +69411,7 @@ function createTypeChecker(host) {
|
|
|
69325
69411
|
let expandingFlags = 0 /* None */;
|
|
69326
69412
|
inferFromTypes(originalSource, originalTarget);
|
|
69327
69413
|
function inferFromTypes(source, target) {
|
|
69328
|
-
if (!couldContainTypeVariables(target)) {
|
|
69414
|
+
if (!couldContainTypeVariables(target) || isNoInferType(target)) {
|
|
69329
69415
|
return;
|
|
69330
69416
|
}
|
|
69331
69417
|
if (source === wildcardType || source === blockedStringType) {
|
|
@@ -69374,6 +69460,9 @@ function createTypeChecker(host) {
|
|
|
69374
69460
|
}
|
|
69375
69461
|
}
|
|
69376
69462
|
if (target.flags & (8388608 /* IndexedAccess */ | 33554432 /* Substitution */)) {
|
|
69463
|
+
if (isNoInferType(target)) {
|
|
69464
|
+
return;
|
|
69465
|
+
}
|
|
69377
69466
|
target = getActualTypeVariable(target);
|
|
69378
69467
|
}
|
|
69379
69468
|
if (target.flags & 8650752 /* TypeVariable */) {
|
|
@@ -90385,7 +90474,7 @@ function visitCommaListElements(elements, visitor, discardVisitor = visitor) {
|
|
|
90385
90474
|
return discarded ? discardVisitor(node) : visitor(node);
|
|
90386
90475
|
}, isExpression);
|
|
90387
90476
|
}
|
|
90388
|
-
function visitEachChild(node, visitor, context, nodesVisitor = visitNodes2, tokenVisitor, nodeVisitor = visitNode) {
|
|
90477
|
+
function visitEachChild(node, visitor, context = nullTransformationContext, nodesVisitor = visitNodes2, tokenVisitor, nodeVisitor = visitNode) {
|
|
90389
90478
|
if (node === void 0) {
|
|
90390
90479
|
return void 0;
|
|
90391
90480
|
}
|
|
@@ -104859,12 +104948,22 @@ function transformES2015(context) {
|
|
|
104859
104948
|
case 172 /* PropertyDeclaration */: {
|
|
104860
104949
|
const named = node;
|
|
104861
104950
|
if (isComputedPropertyName(named.name)) {
|
|
104862
|
-
return factory2.replacePropertyName(named, visitEachChild(
|
|
104951
|
+
return factory2.replacePropertyName(named, visitEachChild(
|
|
104952
|
+
named.name,
|
|
104953
|
+
elideUnusedThisCaptureWorker,
|
|
104954
|
+
/*context*/
|
|
104955
|
+
void 0
|
|
104956
|
+
));
|
|
104863
104957
|
}
|
|
104864
104958
|
return node;
|
|
104865
104959
|
}
|
|
104866
104960
|
}
|
|
104867
|
-
return visitEachChild(
|
|
104961
|
+
return visitEachChild(
|
|
104962
|
+
node,
|
|
104963
|
+
elideUnusedThisCaptureWorker,
|
|
104964
|
+
/*context*/
|
|
104965
|
+
void 0
|
|
104966
|
+
);
|
|
104868
104967
|
}
|
|
104869
104968
|
function simplifyConstructorElideUnusedThisCapture(body, original) {
|
|
104870
104969
|
if (original.transformFlags & 16384 /* ContainsLexicalThis */ || hierarchyFacts & 65536 /* LexicalThis */ || hierarchyFacts & 131072 /* CapturedLexicalThis */) {
|
|
@@ -104900,12 +104999,22 @@ function transformES2015(context) {
|
|
|
104900
104999
|
case 172 /* PropertyDeclaration */: {
|
|
104901
105000
|
const named = node;
|
|
104902
105001
|
if (isComputedPropertyName(named.name)) {
|
|
104903
|
-
return factory2.replacePropertyName(named, visitEachChild(
|
|
105002
|
+
return factory2.replacePropertyName(named, visitEachChild(
|
|
105003
|
+
named.name,
|
|
105004
|
+
injectSuperPresenceCheckWorker,
|
|
105005
|
+
/*context*/
|
|
105006
|
+
void 0
|
|
105007
|
+
));
|
|
104904
105008
|
}
|
|
104905
105009
|
return node;
|
|
104906
105010
|
}
|
|
104907
105011
|
}
|
|
104908
|
-
return visitEachChild(
|
|
105012
|
+
return visitEachChild(
|
|
105013
|
+
node,
|
|
105014
|
+
injectSuperPresenceCheckWorker,
|
|
105015
|
+
/*context*/
|
|
105016
|
+
void 0
|
|
105017
|
+
);
|
|
104909
105018
|
}
|
|
104910
105019
|
function complicateConstructorInjectSuperPresenceCheck(body) {
|
|
104911
105020
|
return factory2.updateBlock(body, visitNodes2(body.statements, injectSuperPresenceCheckWorker, isStatement));
|
|
@@ -113303,44 +113412,6 @@ function getDeclarationDiagnostics(host, resolver, file) {
|
|
|
113303
113412
|
);
|
|
113304
113413
|
return result.diagnostics;
|
|
113305
113414
|
}
|
|
113306
|
-
function hasInternalAnnotation(range, currentSourceFile) {
|
|
113307
|
-
const comment = currentSourceFile.text.substring(range.pos, range.end);
|
|
113308
|
-
return comment.includes("@internal");
|
|
113309
|
-
}
|
|
113310
|
-
function isInternalDeclaration(node, currentSourceFile) {
|
|
113311
|
-
const parseTreeNode = getParseTreeNode(node);
|
|
113312
|
-
if (parseTreeNode && parseTreeNode.kind === 169 /* Parameter */) {
|
|
113313
|
-
const paramIdx = parseTreeNode.parent.parameters.indexOf(parseTreeNode);
|
|
113314
|
-
const previousSibling = paramIdx > 0 ? parseTreeNode.parent.parameters[paramIdx - 1] : void 0;
|
|
113315
|
-
const text = currentSourceFile.text;
|
|
113316
|
-
const commentRanges = previousSibling ? concatenate(
|
|
113317
|
-
// to handle
|
|
113318
|
-
// ... parameters, /** @internal */
|
|
113319
|
-
// public param: string
|
|
113320
|
-
getTrailingCommentRanges(text, skipTrivia(
|
|
113321
|
-
text,
|
|
113322
|
-
previousSibling.end + 1,
|
|
113323
|
-
/*stopAfterLineBreak*/
|
|
113324
|
-
false,
|
|
113325
|
-
/*stopAtComments*/
|
|
113326
|
-
true
|
|
113327
|
-
)),
|
|
113328
|
-
getLeadingCommentRanges(text, node.pos)
|
|
113329
|
-
) : getTrailingCommentRanges(text, skipTrivia(
|
|
113330
|
-
text,
|
|
113331
|
-
node.pos,
|
|
113332
|
-
/*stopAfterLineBreak*/
|
|
113333
|
-
false,
|
|
113334
|
-
/*stopAtComments*/
|
|
113335
|
-
true
|
|
113336
|
-
));
|
|
113337
|
-
return commentRanges && commentRanges.length && hasInternalAnnotation(last(commentRanges), currentSourceFile);
|
|
113338
|
-
}
|
|
113339
|
-
const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, currentSourceFile);
|
|
113340
|
-
return !!forEach(leadingCommentRanges, (range) => {
|
|
113341
|
-
return hasInternalAnnotation(range, currentSourceFile);
|
|
113342
|
-
});
|
|
113343
|
-
}
|
|
113344
113415
|
var declarationEmitNodeBuilderFlags = 1024 /* MultilineObjectLiterals */ | 2048 /* WriteClassExpressionAsTypeLiteral */ | 4096 /* UseTypeOfFunction */ | 8 /* UseStructuralFallback */ | 524288 /* AllowEmptyTuple */ | 4 /* GenerateNamesForShadowedTypeParams */ | 1 /* NoTruncation */;
|
|
113345
113416
|
function transformDeclarations(context) {
|
|
113346
113417
|
const throwDiagnostic = () => Debug.fail("Diagnostic emitted without context");
|
|
@@ -113356,7 +113427,6 @@ function transformDeclarations(context) {
|
|
|
113356
113427
|
let lateStatementReplacementMap;
|
|
113357
113428
|
let suppressNewDiagnosticContexts;
|
|
113358
113429
|
let exportedModulesFromDeclarationEmit;
|
|
113359
|
-
const usedBindingElementAliases = /* @__PURE__ */ new Map();
|
|
113360
113430
|
const { factory: factory2 } = context;
|
|
113361
113431
|
const host = context.getEmitHost();
|
|
113362
113432
|
const symbolTracker = {
|
|
@@ -113422,17 +113492,6 @@ function transformDeclarations(context) {
|
|
|
113422
113492
|
}
|
|
113423
113493
|
}
|
|
113424
113494
|
}
|
|
113425
|
-
if (symbolAccessibilityResult.bindingElementToMakeVisible) {
|
|
113426
|
-
const bindingElement = symbolAccessibilityResult.bindingElementToMakeVisible;
|
|
113427
|
-
const parameter = findAncestor(bindingElement, isParameter);
|
|
113428
|
-
Debug.assert(parameter !== void 0);
|
|
113429
|
-
const parent2 = getOriginalNode(parameter.parent);
|
|
113430
|
-
let aliases = usedBindingElementAliases.get(parent2);
|
|
113431
|
-
if (!aliases) {
|
|
113432
|
-
usedBindingElementAliases.set(parent2, aliases = /* @__PURE__ */ new Map());
|
|
113433
|
-
}
|
|
113434
|
-
aliases.set(getOriginalNode(bindingElement), bindingElement.name);
|
|
113435
|
-
}
|
|
113436
113495
|
} else {
|
|
113437
113496
|
const errorInfo = getSymbolAccessibilityDiagnostic(symbolAccessibilityResult);
|
|
113438
113497
|
if (errorInfo) {
|
|
@@ -113765,7 +113824,7 @@ function transformDeclarations(context) {
|
|
|
113765
113824
|
});
|
|
113766
113825
|
return ret;
|
|
113767
113826
|
}
|
|
113768
|
-
function
|
|
113827
|
+
function filterBindingPatternInitializers(name) {
|
|
113769
113828
|
if (name.kind === 80 /* Identifier */) {
|
|
113770
113829
|
return name;
|
|
113771
113830
|
} else {
|
|
@@ -113782,180 +113841,15 @@ function transformDeclarations(context) {
|
|
|
113782
113841
|
if (elem.propertyName && isComputedPropertyName(elem.propertyName) && isEntityNameExpression(elem.propertyName.expression)) {
|
|
113783
113842
|
checkEntityNameVisibility(elem.propertyName.expression, enclosingDeclaration);
|
|
113784
113843
|
}
|
|
113785
|
-
if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !isIdentifierANonContextualKeyword(elem.propertyName)) {
|
|
113786
|
-
return factory2.updateBindingElement(
|
|
113787
|
-
elem,
|
|
113788
|
-
elem.dotDotDotToken,
|
|
113789
|
-
/*propertyName*/
|
|
113790
|
-
void 0,
|
|
113791
|
-
elem.propertyName,
|
|
113792
|
-
shouldPrintWithInitializer(elem) ? elem.initializer : void 0
|
|
113793
|
-
);
|
|
113794
|
-
}
|
|
113795
113844
|
return factory2.updateBindingElement(
|
|
113796
113845
|
elem,
|
|
113797
113846
|
elem.dotDotDotToken,
|
|
113798
113847
|
elem.propertyName,
|
|
113799
|
-
|
|
113848
|
+
filterBindingPatternInitializers(elem.name),
|
|
113800
113849
|
shouldPrintWithInitializer(elem) ? elem.initializer : void 0
|
|
113801
113850
|
);
|
|
113802
113851
|
}
|
|
113803
113852
|
}
|
|
113804
|
-
function ensureBindingAliasesInParameterList(input, updatedNode) {
|
|
113805
|
-
const original = getOriginalNode(input);
|
|
113806
|
-
const params = updatedNode.parameters;
|
|
113807
|
-
const aliases = usedBindingElementAliases.get(original);
|
|
113808
|
-
if (!aliases) {
|
|
113809
|
-
return updatedNode;
|
|
113810
|
-
}
|
|
113811
|
-
usedBindingElementAliases.delete(original);
|
|
113812
|
-
const newParams = map(params, addUsedBindingPatternsToParameter);
|
|
113813
|
-
const newParamsNodeArray = factory2.createNodeArray(newParams, params.hasTrailingComma);
|
|
113814
|
-
switch (updatedNode.kind) {
|
|
113815
|
-
case 174 /* MethodDeclaration */:
|
|
113816
|
-
return factory2.updateMethodDeclaration(
|
|
113817
|
-
updatedNode,
|
|
113818
|
-
updatedNode.modifiers,
|
|
113819
|
-
updatedNode.asteriskToken,
|
|
113820
|
-
updatedNode.name,
|
|
113821
|
-
updatedNode.questionToken,
|
|
113822
|
-
updatedNode.typeParameters,
|
|
113823
|
-
newParamsNodeArray,
|
|
113824
|
-
updatedNode.type,
|
|
113825
|
-
updatedNode.body
|
|
113826
|
-
);
|
|
113827
|
-
case 176 /* Constructor */:
|
|
113828
|
-
return factory2.updateConstructorDeclaration(
|
|
113829
|
-
updatedNode,
|
|
113830
|
-
updatedNode.modifiers,
|
|
113831
|
-
newParamsNodeArray,
|
|
113832
|
-
updatedNode.body
|
|
113833
|
-
);
|
|
113834
|
-
case 177 /* GetAccessor */:
|
|
113835
|
-
return factory2.updateGetAccessorDeclaration(
|
|
113836
|
-
updatedNode,
|
|
113837
|
-
updatedNode.modifiers,
|
|
113838
|
-
updatedNode.name,
|
|
113839
|
-
newParamsNodeArray,
|
|
113840
|
-
updatedNode.type,
|
|
113841
|
-
updatedNode.body
|
|
113842
|
-
);
|
|
113843
|
-
case 178 /* SetAccessor */:
|
|
113844
|
-
return factory2.updateSetAccessorDeclaration(
|
|
113845
|
-
updatedNode,
|
|
113846
|
-
updatedNode.modifiers,
|
|
113847
|
-
updatedNode.name,
|
|
113848
|
-
newParamsNodeArray,
|
|
113849
|
-
updatedNode.body
|
|
113850
|
-
);
|
|
113851
|
-
case 219 /* ArrowFunction */:
|
|
113852
|
-
return factory2.updateArrowFunction(
|
|
113853
|
-
updatedNode,
|
|
113854
|
-
updatedNode.modifiers,
|
|
113855
|
-
updatedNode.typeParameters,
|
|
113856
|
-
newParamsNodeArray,
|
|
113857
|
-
updatedNode.type,
|
|
113858
|
-
updatedNode.equalsGreaterThanToken,
|
|
113859
|
-
updatedNode.body
|
|
113860
|
-
);
|
|
113861
|
-
case 262 /* FunctionDeclaration */:
|
|
113862
|
-
return factory2.updateFunctionDeclaration(
|
|
113863
|
-
updatedNode,
|
|
113864
|
-
updatedNode.modifiers,
|
|
113865
|
-
updatedNode.asteriskToken,
|
|
113866
|
-
updatedNode.name,
|
|
113867
|
-
updatedNode.typeParameters,
|
|
113868
|
-
newParamsNodeArray,
|
|
113869
|
-
updatedNode.type,
|
|
113870
|
-
updatedNode.body
|
|
113871
|
-
);
|
|
113872
|
-
case 179 /* CallSignature */:
|
|
113873
|
-
return factory2.updateCallSignature(
|
|
113874
|
-
updatedNode,
|
|
113875
|
-
updatedNode.typeParameters,
|
|
113876
|
-
newParamsNodeArray,
|
|
113877
|
-
updatedNode.type
|
|
113878
|
-
);
|
|
113879
|
-
case 173 /* MethodSignature */:
|
|
113880
|
-
return factory2.updateMethodSignature(
|
|
113881
|
-
updatedNode,
|
|
113882
|
-
updatedNode.modifiers,
|
|
113883
|
-
updatedNode.name,
|
|
113884
|
-
updatedNode.questionToken,
|
|
113885
|
-
updatedNode.typeParameters,
|
|
113886
|
-
newParamsNodeArray,
|
|
113887
|
-
updatedNode.type
|
|
113888
|
-
);
|
|
113889
|
-
case 180 /* ConstructSignature */:
|
|
113890
|
-
return factory2.updateConstructSignature(
|
|
113891
|
-
updatedNode,
|
|
113892
|
-
updatedNode.typeParameters,
|
|
113893
|
-
newParamsNodeArray,
|
|
113894
|
-
updatedNode.type
|
|
113895
|
-
);
|
|
113896
|
-
case 184 /* FunctionType */:
|
|
113897
|
-
return factory2.updateFunctionTypeNode(
|
|
113898
|
-
updatedNode,
|
|
113899
|
-
updatedNode.typeParameters,
|
|
113900
|
-
newParamsNodeArray,
|
|
113901
|
-
updatedNode.type
|
|
113902
|
-
);
|
|
113903
|
-
case 185 /* ConstructorType */:
|
|
113904
|
-
return factory2.updateConstructorTypeNode(
|
|
113905
|
-
updatedNode,
|
|
113906
|
-
updatedNode.modifiers,
|
|
113907
|
-
updatedNode.typeParameters,
|
|
113908
|
-
newParamsNodeArray,
|
|
113909
|
-
updatedNode.type
|
|
113910
|
-
);
|
|
113911
|
-
default:
|
|
113912
|
-
Debug.assertNever(updatedNode);
|
|
113913
|
-
}
|
|
113914
|
-
function addUsedBindingPatternsToParameter(p) {
|
|
113915
|
-
return factory2.updateParameterDeclaration(
|
|
113916
|
-
p,
|
|
113917
|
-
p.modifiers,
|
|
113918
|
-
p.dotDotDotToken,
|
|
113919
|
-
addUsedBindingPatternAliases(p.name),
|
|
113920
|
-
p.questionToken,
|
|
113921
|
-
p.type,
|
|
113922
|
-
p.initializer
|
|
113923
|
-
);
|
|
113924
|
-
}
|
|
113925
|
-
function addUsedBindingPatternAliases(name) {
|
|
113926
|
-
if (name.kind === 80 /* Identifier */) {
|
|
113927
|
-
return name;
|
|
113928
|
-
} else {
|
|
113929
|
-
if (name.kind === 207 /* ArrayBindingPattern */) {
|
|
113930
|
-
return factory2.updateArrayBindingPattern(name, visitNodes2(name.elements, visitBindingElement, isArrayBindingElement));
|
|
113931
|
-
} else {
|
|
113932
|
-
return factory2.updateObjectBindingPattern(name, visitNodes2(name.elements, visitBindingElement, isBindingElement));
|
|
113933
|
-
}
|
|
113934
|
-
}
|
|
113935
|
-
function visitBindingElement(elem) {
|
|
113936
|
-
if (elem.kind === 232 /* OmittedExpression */) {
|
|
113937
|
-
return elem;
|
|
113938
|
-
}
|
|
113939
|
-
const usedAlias = aliases.get(getOriginalNode(elem));
|
|
113940
|
-
if (usedAlias && !elem.propertyName) {
|
|
113941
|
-
return factory2.updateBindingElement(
|
|
113942
|
-
elem,
|
|
113943
|
-
elem.dotDotDotToken,
|
|
113944
|
-
elem.name,
|
|
113945
|
-
usedAlias,
|
|
113946
|
-
elem.initializer
|
|
113947
|
-
);
|
|
113948
|
-
}
|
|
113949
|
-
return factory2.updateBindingElement(
|
|
113950
|
-
elem,
|
|
113951
|
-
elem.dotDotDotToken,
|
|
113952
|
-
elem.propertyName,
|
|
113953
|
-
addUsedBindingPatternAliases(elem.name),
|
|
113954
|
-
elem.initializer
|
|
113955
|
-
);
|
|
113956
|
-
}
|
|
113957
|
-
}
|
|
113958
|
-
}
|
|
113959
113853
|
function ensureParameter(p, modifierMask, type) {
|
|
113960
113854
|
let oldDiag;
|
|
113961
113855
|
if (!suppressNewDiagnosticContexts) {
|
|
@@ -113966,7 +113860,7 @@ function transformDeclarations(context) {
|
|
|
113966
113860
|
p,
|
|
113967
113861
|
maskModifiers(factory2, p, modifierMask),
|
|
113968
113862
|
p.dotDotDotToken,
|
|
113969
|
-
|
|
113863
|
+
filterBindingPatternInitializers(p.name),
|
|
113970
113864
|
resolver.isOptionalParameter(p) ? p.questionToken || factory2.createToken(58 /* QuestionToken */) : void 0,
|
|
113971
113865
|
ensureType(
|
|
113972
113866
|
p,
|
|
@@ -114342,25 +114236,19 @@ function transformDeclarations(context) {
|
|
|
114342
114236
|
return cleanup(factory2.updateTypeReferenceNode(node, node.typeName, node.typeArguments));
|
|
114343
114237
|
}
|
|
114344
114238
|
case 180 /* ConstructSignature */:
|
|
114345
|
-
return cleanup(
|
|
114239
|
+
return cleanup(factory2.updateConstructSignature(
|
|
114346
114240
|
input,
|
|
114347
|
-
|
|
114348
|
-
|
|
114349
|
-
|
|
114350
|
-
updateParamsList(input, input.parameters),
|
|
114351
|
-
ensureType(input, input.type)
|
|
114352
|
-
)
|
|
114241
|
+
ensureTypeParams(input, input.typeParameters),
|
|
114242
|
+
updateParamsList(input, input.parameters),
|
|
114243
|
+
ensureType(input, input.type)
|
|
114353
114244
|
));
|
|
114354
114245
|
case 176 /* Constructor */: {
|
|
114355
|
-
const ctor =
|
|
114356
|
-
|
|
114357
|
-
|
|
114358
|
-
|
|
114359
|
-
|
|
114360
|
-
|
|
114361
|
-
/*body*/
|
|
114362
|
-
void 0
|
|
114363
|
-
)
|
|
114246
|
+
const ctor = factory2.createConstructorDeclaration(
|
|
114247
|
+
/*modifiers*/
|
|
114248
|
+
ensureModifiers(input),
|
|
114249
|
+
updateParamsList(input, input.parameters, 0 /* None */),
|
|
114250
|
+
/*body*/
|
|
114251
|
+
void 0
|
|
114364
114252
|
);
|
|
114365
114253
|
return cleanup(ctor);
|
|
114366
114254
|
}
|
|
@@ -114371,20 +114259,17 @@ function transformDeclarations(context) {
|
|
|
114371
114259
|
void 0
|
|
114372
114260
|
);
|
|
114373
114261
|
}
|
|
114374
|
-
const sig =
|
|
114375
|
-
input,
|
|
114376
|
-
|
|
114377
|
-
|
|
114378
|
-
|
|
114379
|
-
|
|
114380
|
-
|
|
114381
|
-
|
|
114382
|
-
|
|
114383
|
-
|
|
114384
|
-
|
|
114385
|
-
/*body*/
|
|
114386
|
-
void 0
|
|
114387
|
-
)
|
|
114262
|
+
const sig = factory2.createMethodDeclaration(
|
|
114263
|
+
ensureModifiers(input),
|
|
114264
|
+
/*asteriskToken*/
|
|
114265
|
+
void 0,
|
|
114266
|
+
input.name,
|
|
114267
|
+
input.questionToken,
|
|
114268
|
+
ensureTypeParams(input, input.typeParameters),
|
|
114269
|
+
updateParamsList(input, input.parameters),
|
|
114270
|
+
ensureType(input, input.type),
|
|
114271
|
+
/*body*/
|
|
114272
|
+
void 0
|
|
114388
114273
|
);
|
|
114389
114274
|
return cleanup(sig);
|
|
114390
114275
|
}
|
|
@@ -114396,17 +114281,14 @@ function transformDeclarations(context) {
|
|
|
114396
114281
|
);
|
|
114397
114282
|
}
|
|
114398
114283
|
const accessorType = getTypeAnnotationFromAllAccessorDeclarations(input, resolver.getAllAccessorDeclarations(input));
|
|
114399
|
-
return cleanup(
|
|
114284
|
+
return cleanup(factory2.updateGetAccessorDeclaration(
|
|
114400
114285
|
input,
|
|
114401
|
-
|
|
114402
|
-
|
|
114403
|
-
|
|
114404
|
-
|
|
114405
|
-
|
|
114406
|
-
|
|
114407
|
-
/*body*/
|
|
114408
|
-
void 0
|
|
114409
|
-
)
|
|
114286
|
+
ensureModifiers(input),
|
|
114287
|
+
input.name,
|
|
114288
|
+
updateAccessorParamsList(input, hasEffectiveModifier(input, 2 /* Private */)),
|
|
114289
|
+
ensureType(input, accessorType),
|
|
114290
|
+
/*body*/
|
|
114291
|
+
void 0
|
|
114410
114292
|
));
|
|
114411
114293
|
}
|
|
114412
114294
|
case 178 /* SetAccessor */: {
|
|
@@ -114416,16 +114298,13 @@ function transformDeclarations(context) {
|
|
|
114416
114298
|
void 0
|
|
114417
114299
|
);
|
|
114418
114300
|
}
|
|
114419
|
-
return cleanup(
|
|
114301
|
+
return cleanup(factory2.updateSetAccessorDeclaration(
|
|
114420
114302
|
input,
|
|
114421
|
-
|
|
114422
|
-
|
|
114423
|
-
|
|
114424
|
-
|
|
114425
|
-
|
|
114426
|
-
/*body*/
|
|
114427
|
-
void 0
|
|
114428
|
-
)
|
|
114303
|
+
ensureModifiers(input),
|
|
114304
|
+
input.name,
|
|
114305
|
+
updateAccessorParamsList(input, hasEffectiveModifier(input, 2 /* Private */)),
|
|
114306
|
+
/*body*/
|
|
114307
|
+
void 0
|
|
114429
114308
|
));
|
|
114430
114309
|
}
|
|
114431
114310
|
case 172 /* PropertyDeclaration */:
|
|
@@ -114464,29 +114343,25 @@ function transformDeclarations(context) {
|
|
|
114464
114343
|
void 0
|
|
114465
114344
|
);
|
|
114466
114345
|
}
|
|
114467
|
-
return cleanup(
|
|
114346
|
+
return cleanup(factory2.updateMethodSignature(
|
|
114468
114347
|
input,
|
|
114469
|
-
|
|
114470
|
-
|
|
114471
|
-
|
|
114472
|
-
|
|
114473
|
-
|
|
114474
|
-
|
|
114475
|
-
updateParamsList(input, input.parameters),
|
|
114476
|
-
ensureType(input, input.type)
|
|
114477
|
-
)
|
|
114348
|
+
ensureModifiers(input),
|
|
114349
|
+
input.name,
|
|
114350
|
+
input.questionToken,
|
|
114351
|
+
ensureTypeParams(input, input.typeParameters),
|
|
114352
|
+
updateParamsList(input, input.parameters),
|
|
114353
|
+
ensureType(input, input.type)
|
|
114478
114354
|
));
|
|
114479
114355
|
}
|
|
114480
114356
|
case 179 /* CallSignature */: {
|
|
114481
|
-
return cleanup(
|
|
114482
|
-
input,
|
|
114357
|
+
return cleanup(
|
|
114483
114358
|
factory2.updateCallSignature(
|
|
114484
114359
|
input,
|
|
114485
114360
|
ensureTypeParams(input, input.typeParameters),
|
|
114486
114361
|
updateParamsList(input, input.parameters),
|
|
114487
114362
|
ensureType(input, input.type)
|
|
114488
114363
|
)
|
|
114489
|
-
)
|
|
114364
|
+
);
|
|
114490
114365
|
}
|
|
114491
114366
|
case 181 /* IndexSignature */: {
|
|
114492
114367
|
return cleanup(factory2.updateIndexSignature(
|
|
@@ -114540,26 +114415,20 @@ function transformDeclarations(context) {
|
|
|
114540
114415
|
return cleanup(factory2.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType));
|
|
114541
114416
|
}
|
|
114542
114417
|
case 184 /* FunctionType */: {
|
|
114543
|
-
return cleanup(
|
|
114418
|
+
return cleanup(factory2.updateFunctionTypeNode(
|
|
114544
114419
|
input,
|
|
114545
|
-
|
|
114546
|
-
|
|
114547
|
-
|
|
114548
|
-
updateParamsList(input, input.parameters),
|
|
114549
|
-
Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode))
|
|
114550
|
-
)
|
|
114420
|
+
visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration),
|
|
114421
|
+
updateParamsList(input, input.parameters),
|
|
114422
|
+
Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode))
|
|
114551
114423
|
));
|
|
114552
114424
|
}
|
|
114553
114425
|
case 185 /* ConstructorType */: {
|
|
114554
|
-
return cleanup(
|
|
114426
|
+
return cleanup(factory2.updateConstructorTypeNode(
|
|
114555
114427
|
input,
|
|
114556
|
-
|
|
114557
|
-
|
|
114558
|
-
|
|
114559
|
-
|
|
114560
|
-
updateParamsList(input, input.parameters),
|
|
114561
|
-
Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode))
|
|
114562
|
-
)
|
|
114428
|
+
ensureModifiers(input),
|
|
114429
|
+
visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration),
|
|
114430
|
+
updateParamsList(input, input.parameters),
|
|
114431
|
+
Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode))
|
|
114563
114432
|
));
|
|
114564
114433
|
}
|
|
114565
114434
|
case 205 /* ImportType */: {
|
|
@@ -114745,20 +114614,17 @@ function transformDeclarations(context) {
|
|
|
114745
114614
|
));
|
|
114746
114615
|
}
|
|
114747
114616
|
case 262 /* FunctionDeclaration */: {
|
|
114748
|
-
const clean2 = cleanup(
|
|
114617
|
+
const clean2 = cleanup(factory2.updateFunctionDeclaration(
|
|
114749
114618
|
input,
|
|
114750
|
-
|
|
114751
|
-
|
|
114752
|
-
|
|
114753
|
-
|
|
114754
|
-
|
|
114755
|
-
|
|
114756
|
-
|
|
114757
|
-
|
|
114758
|
-
|
|
114759
|
-
/*body*/
|
|
114760
|
-
void 0
|
|
114761
|
-
)
|
|
114619
|
+
ensureModifiers(input),
|
|
114620
|
+
/*asteriskToken*/
|
|
114621
|
+
void 0,
|
|
114622
|
+
input.name,
|
|
114623
|
+
ensureTypeParams(input, input.typeParameters),
|
|
114624
|
+
updateParamsList(input, input.parameters),
|
|
114625
|
+
ensureType(input, input.type),
|
|
114626
|
+
/*body*/
|
|
114627
|
+
void 0
|
|
114762
114628
|
));
|
|
114763
114629
|
if (clean2 && resolver.isExpandoFunctionDeclaration(input) && shouldEmitFunctionProperties(input)) {
|
|
114764
114630
|
const props = resolver.getPropertiesOfContainerFunction(input);
|
|
@@ -134712,7 +134578,14 @@ function getSynthesizedDeepCloneWorker(node, replaceNode) {
|
|
|
134712
134578
|
true,
|
|
134713
134579
|
replaceNode
|
|
134714
134580
|
) : (ns) => ns && getSynthesizedDeepClones(ns);
|
|
134715
|
-
const visited = visitEachChild(
|
|
134581
|
+
const visited = visitEachChild(
|
|
134582
|
+
node,
|
|
134583
|
+
nodeClone,
|
|
134584
|
+
/*context*/
|
|
134585
|
+
void 0,
|
|
134586
|
+
nodesClone,
|
|
134587
|
+
nodeClone
|
|
134588
|
+
);
|
|
134716
134589
|
if (visited === node) {
|
|
134717
134590
|
const clone2 = isStringLiteral(node) ? setOriginalNode(factory.createStringLiteralFromNode(node), node) : isNumericLiteral(node) ? setOriginalNode(factory.createNumericLiteral(node.text, node.numericLiteralFlags), node) : factory.cloneNode(node);
|
|
134718
134591
|
return setTextRange(clone2, node);
|
|
@@ -144497,7 +144370,12 @@ function transformFunctionBody(body, exposedVariableDeclarations, writes, substi
|
|
|
144497
144370
|
const oldIgnoreReturns = ignoreReturns;
|
|
144498
144371
|
ignoreReturns = ignoreReturns || isFunctionLikeDeclaration(node) || isClassLike(node);
|
|
144499
144372
|
const substitution = substitutions.get(getNodeId(node).toString());
|
|
144500
|
-
const result = substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
144373
|
+
const result = substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
144374
|
+
node,
|
|
144375
|
+
visitor,
|
|
144376
|
+
/*context*/
|
|
144377
|
+
void 0
|
|
144378
|
+
);
|
|
144501
144379
|
ignoreReturns = oldIgnoreReturns;
|
|
144502
144380
|
return result;
|
|
144503
144381
|
}
|
|
@@ -144507,7 +144385,12 @@ function transformConstantInitializer(initializer, substitutions) {
|
|
|
144507
144385
|
return substitutions.size ? visitor(initializer) : initializer;
|
|
144508
144386
|
function visitor(node) {
|
|
144509
144387
|
const substitution = substitutions.get(getNodeId(node).toString());
|
|
144510
|
-
return substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
144388
|
+
return substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(
|
|
144389
|
+
node,
|
|
144390
|
+
visitor,
|
|
144391
|
+
/*context*/
|
|
144392
|
+
void 0
|
|
144393
|
+
);
|
|
144511
144394
|
}
|
|
144512
144395
|
}
|
|
144513
144396
|
function getStatementsOrClassElements(scope) {
|
|
@@ -149276,7 +149159,12 @@ function transformJSDocType(node) {
|
|
|
149276
149159
|
case 329 /* JSDocTypeLiteral */:
|
|
149277
149160
|
return transformJSDocTypeLiteral(node);
|
|
149278
149161
|
default:
|
|
149279
|
-
const visited = visitEachChild(
|
|
149162
|
+
const visited = visitEachChild(
|
|
149163
|
+
node,
|
|
149164
|
+
transformJSDocType,
|
|
149165
|
+
/*context*/
|
|
149166
|
+
void 0
|
|
149167
|
+
);
|
|
149280
149168
|
setEmitFlags(visited, 1 /* SingleLine */);
|
|
149281
149169
|
return visited;
|
|
149282
149170
|
}
|
|
@@ -157405,7 +157293,12 @@ function tryGetAutoImportableReferenceFromTypeNode(importTypeNode, scriptTarget)
|
|
|
157405
157293
|
const typeArguments = visitNodes2(node.typeArguments, visit, isTypeNode);
|
|
157406
157294
|
return factory.createTypeReferenceNode(qualifier, typeArguments);
|
|
157407
157295
|
}
|
|
157408
|
-
return visitEachChild(
|
|
157296
|
+
return visitEachChild(
|
|
157297
|
+
node,
|
|
157298
|
+
visit,
|
|
157299
|
+
/*context*/
|
|
157300
|
+
void 0
|
|
157301
|
+
);
|
|
157409
157302
|
}
|
|
157410
157303
|
}
|
|
157411
157304
|
function replaceFirstIdentifierOfEntityName(name, newIdentifier) {
|
|
@@ -163923,6 +163816,11 @@ function getContextNode(node) {
|
|
|
163923
163816
|
return isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent) ? getContextNode(
|
|
163924
163817
|
findAncestor(node.parent, (node2) => isBinaryExpression(node2) || isForInOrOfStatement(node2))
|
|
163925
163818
|
) : node;
|
|
163819
|
+
case 255 /* SwitchStatement */:
|
|
163820
|
+
return {
|
|
163821
|
+
start: find(node.getChildren(node.getSourceFile()), (node2) => node2.kind === 109 /* SwitchKeyword */),
|
|
163822
|
+
end: node.caseBlock
|
|
163823
|
+
};
|
|
163926
163824
|
default:
|
|
163927
163825
|
return node;
|
|
163928
163826
|
}
|
|
@@ -164223,6 +164121,9 @@ function getTextSpan(node, sourceFile, endNode2) {
|
|
|
164223
164121
|
start2 += 1;
|
|
164224
164122
|
end -= 1;
|
|
164225
164123
|
}
|
|
164124
|
+
if ((endNode2 == null ? void 0 : endNode2.kind) === 269 /* CaseBlock */) {
|
|
164125
|
+
end = endNode2.getFullStart();
|
|
164126
|
+
}
|
|
164226
164127
|
return createTextSpanFromBounds(start2, end);
|
|
164227
164128
|
}
|
|
164228
164129
|
function getTextSpanOfEntry(entry) {
|
|
@@ -165778,9 +165679,20 @@ function getDefinitionAtPosition(program, sourceFile, position, searchOtherFiles
|
|
|
165778
165679
|
void 0
|
|
165779
165680
|
)] : void 0;
|
|
165780
165681
|
}
|
|
165781
|
-
|
|
165782
|
-
|
|
165783
|
-
|
|
165682
|
+
switch (node.kind) {
|
|
165683
|
+
case 107 /* ReturnKeyword */:
|
|
165684
|
+
const functionDeclaration = findAncestor(node.parent, (n) => isClassStaticBlockDeclaration(n) ? "quit" : isFunctionLikeDeclaration(n));
|
|
165685
|
+
return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
165686
|
+
case 90 /* DefaultKeyword */:
|
|
165687
|
+
if (!isDefaultClause(node.parent)) {
|
|
165688
|
+
break;
|
|
165689
|
+
}
|
|
165690
|
+
case 84 /* CaseKeyword */:
|
|
165691
|
+
const switchStatement = findAncestor(node.parent, isSwitchStatement);
|
|
165692
|
+
if (switchStatement) {
|
|
165693
|
+
return [createDefinitionInfoFromSwitch(switchStatement, sourceFile)];
|
|
165694
|
+
}
|
|
165695
|
+
break;
|
|
165784
165696
|
}
|
|
165785
165697
|
if (node.kind === 135 /* AwaitKeyword */) {
|
|
165786
165698
|
const functionDeclaration = findAncestor(node, (n) => isFunctionLikeDeclaration(n));
|
|
@@ -166198,6 +166110,23 @@ function createDefinitionInfoFromName(checker, declaration, symbolKind, symbolNa
|
|
|
166198
166110
|
failedAliasResolution
|
|
166199
166111
|
};
|
|
166200
166112
|
}
|
|
166113
|
+
function createDefinitionInfoFromSwitch(statement, sourceFile) {
|
|
166114
|
+
const keyword = ts_FindAllReferences_exports.getContextNode(statement);
|
|
166115
|
+
const textSpan = createTextSpanFromNode(isContextWithStartAndEndNode(keyword) ? keyword.start : keyword, sourceFile);
|
|
166116
|
+
return {
|
|
166117
|
+
fileName: sourceFile.fileName,
|
|
166118
|
+
textSpan,
|
|
166119
|
+
kind: "keyword" /* keyword */,
|
|
166120
|
+
name: "switch",
|
|
166121
|
+
containerKind: void 0,
|
|
166122
|
+
containerName: "",
|
|
166123
|
+
...ts_FindAllReferences_exports.toContextSpan(textSpan, sourceFile, keyword),
|
|
166124
|
+
isLocal: true,
|
|
166125
|
+
isAmbient: false,
|
|
166126
|
+
unverified: false,
|
|
166127
|
+
failedAliasResolution: void 0
|
|
166128
|
+
};
|
|
166129
|
+
}
|
|
166201
166130
|
function isDefinitionVisible(checker, declaration) {
|
|
166202
166131
|
if (checker.isDeclarationVisible(declaration))
|
|
166203
166132
|
return true;
|