typescript 5.2.0-dev.20230803 → 5.2.0-dev.20230805
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +151 -85
- package/lib/tsserver.js +194 -121
- package/lib/tsserverlibrary.d.ts +8 -2
- package/lib/tsserverlibrary.js +194 -121
- package/lib/typescript.d.ts +5 -1
- package/lib/typescript.js +185 -111
- package/lib/typingsInstaller.js +1 -1
- 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.2";
|
|
38
|
-
version = `${versionMajorMinor}.0-dev.
|
|
38
|
+
version = `${versionMajorMinor}.0-dev.20230805`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -4387,15 +4387,13 @@ ${lanes.join("\n")}
|
|
|
4387
4387
|
NodeCheckFlags2[NodeCheckFlags2["ContainsCapturedBlockScopeBinding"] = 8192] = "ContainsCapturedBlockScopeBinding";
|
|
4388
4388
|
NodeCheckFlags2[NodeCheckFlags2["CapturedBlockScopedBinding"] = 16384] = "CapturedBlockScopedBinding";
|
|
4389
4389
|
NodeCheckFlags2[NodeCheckFlags2["BlockScopedBindingInLoop"] = 32768] = "BlockScopedBindingInLoop";
|
|
4390
|
-
NodeCheckFlags2[NodeCheckFlags2["
|
|
4391
|
-
NodeCheckFlags2[NodeCheckFlags2["
|
|
4392
|
-
NodeCheckFlags2[NodeCheckFlags2["
|
|
4393
|
-
NodeCheckFlags2[NodeCheckFlags2["
|
|
4394
|
-
NodeCheckFlags2[NodeCheckFlags2["
|
|
4395
|
-
NodeCheckFlags2[NodeCheckFlags2["
|
|
4396
|
-
NodeCheckFlags2[NodeCheckFlags2["
|
|
4397
|
-
NodeCheckFlags2[NodeCheckFlags2["ContainsSuperPropertyInStaticInitializer"] = 8388608] = "ContainsSuperPropertyInStaticInitializer";
|
|
4398
|
-
NodeCheckFlags2[NodeCheckFlags2["InCheckIdentifier"] = 16777216] = "InCheckIdentifier";
|
|
4390
|
+
NodeCheckFlags2[NodeCheckFlags2["NeedsLoopOutParameter"] = 65536] = "NeedsLoopOutParameter";
|
|
4391
|
+
NodeCheckFlags2[NodeCheckFlags2["AssignmentsMarked"] = 131072] = "AssignmentsMarked";
|
|
4392
|
+
NodeCheckFlags2[NodeCheckFlags2["ContainsConstructorReference"] = 262144] = "ContainsConstructorReference";
|
|
4393
|
+
NodeCheckFlags2[NodeCheckFlags2["ConstructorReference"] = 536870912] = "ConstructorReference";
|
|
4394
|
+
NodeCheckFlags2[NodeCheckFlags2["ContainsClassWithPrivateIdentifiers"] = 1048576] = "ContainsClassWithPrivateIdentifiers";
|
|
4395
|
+
NodeCheckFlags2[NodeCheckFlags2["ContainsSuperPropertyInStaticInitializer"] = 2097152] = "ContainsSuperPropertyInStaticInitializer";
|
|
4396
|
+
NodeCheckFlags2[NodeCheckFlags2["InCheckIdentifier"] = 4194304] = "InCheckIdentifier";
|
|
4399
4397
|
return NodeCheckFlags2;
|
|
4400
4398
|
})(NodeCheckFlags || {});
|
|
4401
4399
|
TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
@@ -27672,7 +27670,7 @@ ${lanes.join("\n")}
|
|
|
27672
27670
|
initializer
|
|
27673
27671
|
);
|
|
27674
27672
|
}
|
|
27675
|
-
function createAccessorPropertyGetRedirector(factory2, node, modifiers, name) {
|
|
27673
|
+
function createAccessorPropertyGetRedirector(factory2, node, modifiers, name, receiver = factory2.createThis()) {
|
|
27676
27674
|
return factory2.createGetAccessorDeclaration(
|
|
27677
27675
|
modifiers,
|
|
27678
27676
|
name,
|
|
@@ -27682,7 +27680,7 @@ ${lanes.join("\n")}
|
|
|
27682
27680
|
factory2.createBlock([
|
|
27683
27681
|
factory2.createReturnStatement(
|
|
27684
27682
|
factory2.createPropertyAccessExpression(
|
|
27685
|
-
|
|
27683
|
+
receiver,
|
|
27686
27684
|
factory2.getGeneratedPrivateNameForNode(
|
|
27687
27685
|
node.name,
|
|
27688
27686
|
/*prefix*/
|
|
@@ -27694,7 +27692,7 @@ ${lanes.join("\n")}
|
|
|
27694
27692
|
])
|
|
27695
27693
|
);
|
|
27696
27694
|
}
|
|
27697
|
-
function createAccessorPropertySetRedirector(factory2, node, modifiers, name) {
|
|
27695
|
+
function createAccessorPropertySetRedirector(factory2, node, modifiers, name, receiver = factory2.createThis()) {
|
|
27698
27696
|
return factory2.createSetAccessorDeclaration(
|
|
27699
27697
|
modifiers,
|
|
27700
27698
|
name,
|
|
@@ -27709,7 +27707,7 @@ ${lanes.join("\n")}
|
|
|
27709
27707
|
factory2.createExpressionStatement(
|
|
27710
27708
|
factory2.createAssignment(
|
|
27711
27709
|
factory2.createPropertyAccessExpression(
|
|
27712
|
-
|
|
27710
|
+
receiver,
|
|
27713
27711
|
factory2.getGeneratedPrivateNameForNode(
|
|
27714
27712
|
node.name,
|
|
27715
27713
|
/*prefix*/
|
|
@@ -46831,7 +46829,7 @@ ${lanes.join("\n")}
|
|
|
46831
46829
|
return symbol;
|
|
46832
46830
|
}
|
|
46833
46831
|
if (symbol.flags & 2097152 /* Alias */) {
|
|
46834
|
-
const targetFlags =
|
|
46832
|
+
const targetFlags = getSymbolFlags(symbol);
|
|
46835
46833
|
if (targetFlags & meaning) {
|
|
46836
46834
|
return symbol;
|
|
46837
46835
|
}
|
|
@@ -47591,7 +47589,7 @@ ${lanes.join("\n")}
|
|
|
47591
47589
|
/*isUse*/
|
|
47592
47590
|
false
|
|
47593
47591
|
));
|
|
47594
|
-
const allFlags = symbol &&
|
|
47592
|
+
const allFlags = symbol && getSymbolFlags(symbol);
|
|
47595
47593
|
if (symbol && allFlags !== void 0 && !(allFlags & 111551 /* Value */)) {
|
|
47596
47594
|
const rawName = unescapeLeadingUnderscores(name);
|
|
47597
47595
|
if (isES2015OrLaterConstructorName(name)) {
|
|
@@ -48327,11 +48325,23 @@ ${lanes.join("\n")}
|
|
|
48327
48325
|
}
|
|
48328
48326
|
return void 0;
|
|
48329
48327
|
}
|
|
48330
|
-
function
|
|
48331
|
-
|
|
48328
|
+
function getSymbolFlags(symbol, excludeTypeOnlyMeanings, excludeLocalMeanings) {
|
|
48329
|
+
const typeOnlyDeclaration = excludeTypeOnlyMeanings && getTypeOnlyAliasDeclaration(symbol);
|
|
48330
|
+
const typeOnlyDeclarationIsExportStar = typeOnlyDeclaration && isExportDeclaration(typeOnlyDeclaration);
|
|
48331
|
+
const typeOnlyResolution = typeOnlyDeclaration && (typeOnlyDeclarationIsExportStar ? resolveExternalModuleName(
|
|
48332
|
+
typeOnlyDeclaration.moduleSpecifier,
|
|
48333
|
+
typeOnlyDeclaration.moduleSpecifier,
|
|
48334
|
+
/*ignoreErrors*/
|
|
48335
|
+
true
|
|
48336
|
+
) : resolveAlias(typeOnlyDeclaration.symbol));
|
|
48337
|
+
const typeOnlyExportStarTargets = typeOnlyDeclarationIsExportStar && typeOnlyResolution ? getExportsOfModule(typeOnlyResolution) : void 0;
|
|
48338
|
+
let flags = excludeLocalMeanings ? 0 /* None */ : symbol.flags;
|
|
48332
48339
|
let seenSymbols;
|
|
48333
48340
|
while (symbol.flags & 2097152 /* Alias */) {
|
|
48334
|
-
const target = resolveAlias(symbol);
|
|
48341
|
+
const target = getExportSymbolOfValueSymbolIfExported(resolveAlias(symbol));
|
|
48342
|
+
if (!typeOnlyDeclarationIsExportStar && target === typeOnlyResolution || (typeOnlyExportStarTargets == null ? void 0 : typeOnlyExportStarTargets.get(target.escapedName)) === target) {
|
|
48343
|
+
break;
|
|
48344
|
+
}
|
|
48335
48345
|
if (target === unknownSymbol) {
|
|
48336
48346
|
return 67108863 /* All */;
|
|
48337
48347
|
}
|
|
@@ -48389,7 +48399,7 @@ ${lanes.join("\n")}
|
|
|
48389
48399
|
}
|
|
48390
48400
|
if (links.typeOnlyDeclaration) {
|
|
48391
48401
|
const resolved = links.typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ ? resolveSymbol(getExportsOfModule(links.typeOnlyDeclaration.symbol.parent).get(links.typeOnlyExportStarName || symbol.escapedName)) : resolveAlias(links.typeOnlyDeclaration.symbol);
|
|
48392
|
-
return
|
|
48402
|
+
return getSymbolFlags(resolved) & include ? links.typeOnlyDeclaration : void 0;
|
|
48393
48403
|
}
|
|
48394
48404
|
return void 0;
|
|
48395
48405
|
}
|
|
@@ -48400,7 +48410,11 @@ ${lanes.join("\n")}
|
|
|
48400
48410
|
const symbol = getSymbolOfDeclaration(node);
|
|
48401
48411
|
const target = resolveAlias(symbol);
|
|
48402
48412
|
if (target) {
|
|
48403
|
-
const markAlias = target === unknownSymbol ||
|
|
48413
|
+
const markAlias = target === unknownSymbol || getSymbolFlags(
|
|
48414
|
+
symbol,
|
|
48415
|
+
/*excludeTypeOnlyMeanings*/
|
|
48416
|
+
true
|
|
48417
|
+
) & 111551 /* Value */ && !isConstEnumOrConstEnumOnlyModule(target);
|
|
48404
48418
|
if (markAlias) {
|
|
48405
48419
|
markAliasSymbolAsReferenced(symbol);
|
|
48406
48420
|
}
|
|
@@ -48415,7 +48429,7 @@ ${lanes.join("\n")}
|
|
|
48415
48429
|
if (!node)
|
|
48416
48430
|
return Debug.fail();
|
|
48417
48431
|
if (isInternalModuleImportEqualsDeclaration(node)) {
|
|
48418
|
-
if (
|
|
48432
|
+
if (getSymbolFlags(resolveSymbol(symbol)) & 111551 /* Value */) {
|
|
48419
48433
|
checkExpressionCached(node.moduleReference);
|
|
48420
48434
|
}
|
|
48421
48435
|
}
|
|
@@ -49266,7 +49280,7 @@ ${lanes.join("\n")}
|
|
|
49266
49280
|
return getMergedSymbol(symbol && (symbol.flags & 1048576 /* ExportValue */) !== 0 && symbol.exportSymbol || symbol);
|
|
49267
49281
|
}
|
|
49268
49282
|
function symbolIsValue(symbol, includeTypeOnlyMembers) {
|
|
49269
|
-
return !!(symbol.flags & 111551 /* Value */ || symbol.flags & 2097152 /* Alias */ &&
|
|
49283
|
+
return !!(symbol.flags & 111551 /* Value */ || symbol.flags & 2097152 /* Alias */ && getSymbolFlags(symbol, !includeTypeOnlyMembers) & 111551 /* Value */);
|
|
49270
49284
|
}
|
|
49271
49285
|
function findConstructorDeclaration(node) {
|
|
49272
49286
|
const members = node.members;
|
|
@@ -49533,7 +49547,7 @@ ${lanes.join("\n")}
|
|
|
49533
49547
|
}
|
|
49534
49548
|
const shouldResolveAlias = symbolFromSymbolTable.flags & 2097152 /* Alias */ && !getDeclarationOfKind(symbolFromSymbolTable, 281 /* ExportSpecifier */);
|
|
49535
49549
|
symbolFromSymbolTable = shouldResolveAlias ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
|
|
49536
|
-
const flags = shouldResolveAlias ?
|
|
49550
|
+
const flags = shouldResolveAlias ? getSymbolFlags(symbolFromSymbolTable) : symbolFromSymbolTable.flags;
|
|
49537
49551
|
if (flags & meaning) {
|
|
49538
49552
|
qualify = true;
|
|
49539
49553
|
return true;
|
|
@@ -52395,7 +52409,7 @@ ${lanes.join("\n")}
|
|
|
52395
52409
|
return !exports ? [] : filter(arrayFrom(exports.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
|
|
52396
52410
|
}
|
|
52397
52411
|
function isTypeOnlyNamespace(symbol) {
|
|
52398
|
-
return every(getNamespaceMembersForSerialization(symbol), (m) => !(
|
|
52412
|
+
return every(getNamespaceMembersForSerialization(symbol), (m) => !(getSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
|
|
52399
52413
|
}
|
|
52400
52414
|
function serializeModule(symbol, symbolName2, modifierFlags) {
|
|
52401
52415
|
const members = getNamespaceMembersForSerialization(symbol);
|
|
@@ -54667,7 +54681,7 @@ ${lanes.join("\n")}
|
|
|
54667
54681
|
true
|
|
54668
54682
|
);
|
|
54669
54683
|
const declaredType = firstDefined(exportSymbol == null ? void 0 : exportSymbol.declarations, (d) => isExportAssignment(d) ? tryGetTypeFromEffectiveTypeNode(d) : void 0);
|
|
54670
|
-
links.type = (exportSymbol == null ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol) : isDuplicatedCommonJSExport(symbol.declarations) ? autoType : declaredType ? declaredType :
|
|
54684
|
+
links.type = (exportSymbol == null ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol) : isDuplicatedCommonJSExport(symbol.declarations) ? autoType : declaredType ? declaredType : getSymbolFlags(targetSymbol) & 111551 /* Value */ ? getTypeOfSymbol(targetSymbol) : errorType;
|
|
54671
54685
|
}
|
|
54672
54686
|
return links.type;
|
|
54673
54687
|
}
|
|
@@ -62277,6 +62291,7 @@ ${lanes.join("\n")}
|
|
|
62277
62291
|
let errorInfo;
|
|
62278
62292
|
let relatedInfo;
|
|
62279
62293
|
let maybeKeys;
|
|
62294
|
+
let maybeKeysSet;
|
|
62280
62295
|
let sourceStack;
|
|
62281
62296
|
let targetStack;
|
|
62282
62297
|
let maybeCount = 0;
|
|
@@ -63146,9 +63161,13 @@ ${lanes.join("\n")}
|
|
|
63146
63161
|
}
|
|
63147
63162
|
if (!maybeKeys) {
|
|
63148
63163
|
maybeKeys = [];
|
|
63164
|
+
maybeKeysSet = /* @__PURE__ */ new Set();
|
|
63149
63165
|
sourceStack = [];
|
|
63150
63166
|
targetStack = [];
|
|
63151
63167
|
} else {
|
|
63168
|
+
if (maybeKeysSet.has(id)) {
|
|
63169
|
+
return 3 /* Maybe */;
|
|
63170
|
+
}
|
|
63152
63171
|
const broadestEquivalentId = id.startsWith("*") ? getRelationKey(
|
|
63153
63172
|
source2,
|
|
63154
63173
|
target2,
|
|
@@ -63157,10 +63176,8 @@ ${lanes.join("\n")}
|
|
|
63157
63176
|
/*ignoreConstraints*/
|
|
63158
63177
|
true
|
|
63159
63178
|
) : void 0;
|
|
63160
|
-
|
|
63161
|
-
|
|
63162
|
-
return 3 /* Maybe */;
|
|
63163
|
-
}
|
|
63179
|
+
if (broadestEquivalentId && maybeKeysSet.has(broadestEquivalentId)) {
|
|
63180
|
+
return 3 /* Maybe */;
|
|
63164
63181
|
}
|
|
63165
63182
|
if (sourceDepth === 100 || targetDepth === 100) {
|
|
63166
63183
|
overflow = true;
|
|
@@ -63169,6 +63186,7 @@ ${lanes.join("\n")}
|
|
|
63169
63186
|
}
|
|
63170
63187
|
const maybeStart = maybeCount;
|
|
63171
63188
|
maybeKeys[maybeCount] = id;
|
|
63189
|
+
maybeKeysSet.add(id);
|
|
63172
63190
|
maybeCount++;
|
|
63173
63191
|
const saveExpandingFlags = expandingFlags;
|
|
63174
63192
|
if (recursionFlags & 1 /* Source */) {
|
|
@@ -63221,17 +63239,34 @@ ${lanes.join("\n")}
|
|
|
63221
63239
|
if (result2) {
|
|
63222
63240
|
if (result2 === -1 /* True */ || sourceDepth === 0 && targetDepth === 0) {
|
|
63223
63241
|
if (result2 === -1 /* True */ || result2 === 3 /* Maybe */) {
|
|
63224
|
-
|
|
63225
|
-
|
|
63226
|
-
|
|
63242
|
+
resetMaybeStack(
|
|
63243
|
+
/*markAllAsSucceeded*/
|
|
63244
|
+
true
|
|
63245
|
+
);
|
|
63246
|
+
} else {
|
|
63247
|
+
resetMaybeStack(
|
|
63248
|
+
/*markAllAsSucceeded*/
|
|
63249
|
+
false
|
|
63250
|
+
);
|
|
63227
63251
|
}
|
|
63228
|
-
maybeCount = maybeStart;
|
|
63229
63252
|
}
|
|
63230
63253
|
} else {
|
|
63231
63254
|
relation.set(id, (reportErrors2 ? 4 /* Reported */ : 0) | 2 /* Failed */ | propagatingVarianceFlags);
|
|
63232
|
-
|
|
63255
|
+
resetMaybeStack(
|
|
63256
|
+
/*markAllAsSucceeded*/
|
|
63257
|
+
false
|
|
63258
|
+
);
|
|
63233
63259
|
}
|
|
63234
63260
|
return result2;
|
|
63261
|
+
function resetMaybeStack(markAllAsSucceeded) {
|
|
63262
|
+
for (let i = maybeStart; i < maybeCount; i++) {
|
|
63263
|
+
maybeKeysSet.delete(maybeKeys[i]);
|
|
63264
|
+
if (markAllAsSucceeded) {
|
|
63265
|
+
relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags);
|
|
63266
|
+
}
|
|
63267
|
+
}
|
|
63268
|
+
maybeCount = maybeStart;
|
|
63269
|
+
}
|
|
63235
63270
|
}
|
|
63236
63271
|
function structuredTypeRelatedTo(source2, target2, reportErrors2, intersectionState) {
|
|
63237
63272
|
const saveErrorInfo = captureErrorCalculationState();
|
|
@@ -68584,8 +68619,8 @@ ${lanes.join("\n")}
|
|
|
68584
68619
|
}
|
|
68585
68620
|
const parent2 = getRootDeclaration(symbol.valueDeclaration).parent;
|
|
68586
68621
|
const links = getNodeLinks(parent2);
|
|
68587
|
-
if (!(links.flags &
|
|
68588
|
-
links.flags |=
|
|
68622
|
+
if (!(links.flags & 131072 /* AssignmentsMarked */)) {
|
|
68623
|
+
links.flags |= 131072 /* AssignmentsMarked */;
|
|
68589
68624
|
if (!hasParentWithAssignmentsMarked(parent2)) {
|
|
68590
68625
|
markNodeAssignments(parent2);
|
|
68591
68626
|
}
|
|
@@ -68593,7 +68628,7 @@ ${lanes.join("\n")}
|
|
|
68593
68628
|
return symbol.isAssigned || false;
|
|
68594
68629
|
}
|
|
68595
68630
|
function hasParentWithAssignmentsMarked(node) {
|
|
68596
|
-
return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags &
|
|
68631
|
+
return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 131072 /* AssignmentsMarked */));
|
|
68597
68632
|
}
|
|
68598
68633
|
function markNodeAssignments(node) {
|
|
68599
68634
|
if (node.kind === 80 /* Identifier */) {
|
|
@@ -68675,9 +68710,13 @@ ${lanes.join("\n")}
|
|
|
68675
68710
|
symbol,
|
|
68676
68711
|
/*excludes*/
|
|
68677
68712
|
111551 /* Value */
|
|
68678
|
-
) && !isInTypeQuery(location)
|
|
68713
|
+
) && !isInTypeQuery(location)) {
|
|
68679
68714
|
const target = resolveAlias(symbol);
|
|
68680
|
-
if (
|
|
68715
|
+
if (getSymbolFlags(
|
|
68716
|
+
symbol,
|
|
68717
|
+
/*excludeTypeOnlyMeanings*/
|
|
68718
|
+
true
|
|
68719
|
+
) & (111551 /* Value */ | 1048576 /* ExportValue */)) {
|
|
68681
68720
|
if (getIsolatedModules(compilerOptions) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(location) || !isConstEnumOrConstEnumOnlyModule(getExportSymbolOfValueSymbolIfExported(target))) {
|
|
68682
68721
|
markAliasSymbolAsReferenced(symbol);
|
|
68683
68722
|
} else {
|
|
@@ -68695,11 +68734,11 @@ ${lanes.join("\n")}
|
|
|
68695
68734
|
const parent2 = declaration.parent.parent;
|
|
68696
68735
|
if (parent2.kind === 260 /* VariableDeclaration */ && getCombinedNodeFlagsCached(declaration) & 6 /* Constant */ || parent2.kind === 169 /* Parameter */) {
|
|
68697
68736
|
const links = getNodeLinks(parent2);
|
|
68698
|
-
if (!(links.flags &
|
|
68699
|
-
links.flags |=
|
|
68737
|
+
if (!(links.flags & 4194304 /* InCheckIdentifier */)) {
|
|
68738
|
+
links.flags |= 4194304 /* InCheckIdentifier */;
|
|
68700
68739
|
const parentType = getTypeForBindingElementParent(parent2, 0 /* Normal */);
|
|
68701
68740
|
const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
|
|
68702
|
-
links.flags &= ~
|
|
68741
|
+
links.flags &= ~4194304 /* InCheckIdentifier */;
|
|
68703
68742
|
if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(parent2.kind === 169 /* Parameter */ && isSymbolAssigned(symbol))) {
|
|
68704
68743
|
const pattern = declaration.parent;
|
|
68705
68744
|
const narrowedType = getFlowTypeOfReference(
|
|
@@ -68776,17 +68815,7 @@ ${lanes.join("\n")}
|
|
|
68776
68815
|
}
|
|
68777
68816
|
let declaration = localOrExportSymbol.valueDeclaration;
|
|
68778
68817
|
if (declaration && localOrExportSymbol.flags & 32 /* Class */) {
|
|
68779
|
-
if (declaration
|
|
68780
|
-
let container = getContainingClass(node);
|
|
68781
|
-
while (container !== void 0) {
|
|
68782
|
-
if (container === declaration && container.name !== node) {
|
|
68783
|
-
getNodeLinks(declaration).flags |= 1048576 /* ClassWithConstructorReference */;
|
|
68784
|
-
getNodeLinks(node).flags |= 2097152 /* ConstructorReferenceInClass */;
|
|
68785
|
-
break;
|
|
68786
|
-
}
|
|
68787
|
-
container = getContainingClass(container);
|
|
68788
|
-
}
|
|
68789
|
-
} else if (declaration.kind === 231 /* ClassExpression */) {
|
|
68818
|
+
if (isClassLike(declaration) && declaration.name !== node) {
|
|
68790
68819
|
let container = getThisContainer(
|
|
68791
68820
|
node,
|
|
68792
68821
|
/*includeArrowFunctions*/
|
|
@@ -68794,14 +68823,7 @@ ${lanes.join("\n")}
|
|
|
68794
68823
|
/*includeClassComputedPropertyName*/
|
|
68795
68824
|
false
|
|
68796
68825
|
);
|
|
68797
|
-
while (container.kind !== 312 /* SourceFile */) {
|
|
68798
|
-
if (container.parent === declaration) {
|
|
68799
|
-
if (isPropertyDeclaration(container) && isStatic(container) || isClassStaticBlockDeclaration(container)) {
|
|
68800
|
-
getNodeLinks(declaration).flags |= 1048576 /* ClassWithConstructorReference */;
|
|
68801
|
-
getNodeLinks(node).flags |= 2097152 /* ConstructorReferenceInClass */;
|
|
68802
|
-
}
|
|
68803
|
-
break;
|
|
68804
|
-
}
|
|
68826
|
+
while (container.kind !== 312 /* SourceFile */ && container.parent !== declaration) {
|
|
68805
68827
|
container = getThisContainer(
|
|
68806
68828
|
container,
|
|
68807
68829
|
/*includeArrowFunctions*/
|
|
@@ -68810,6 +68832,11 @@ ${lanes.join("\n")}
|
|
|
68810
68832
|
false
|
|
68811
68833
|
);
|
|
68812
68834
|
}
|
|
68835
|
+
if (container.kind !== 312 /* SourceFile */) {
|
|
68836
|
+
getNodeLinks(declaration).flags |= 262144 /* ContainsConstructorReference */;
|
|
68837
|
+
getNodeLinks(container).flags |= 262144 /* ContainsConstructorReference */;
|
|
68838
|
+
getNodeLinks(node).flags |= 536870912 /* ConstructorReference */;
|
|
68839
|
+
}
|
|
68813
68840
|
}
|
|
68814
68841
|
}
|
|
68815
68842
|
checkNestedBlockScopedBinding(node, symbol);
|
|
@@ -68940,7 +68967,7 @@ ${lanes.join("\n")}
|
|
|
68940
68967
|
if (isForStatement(container)) {
|
|
68941
68968
|
const varDeclList = getAncestor(symbol.valueDeclaration, 261 /* VariableDeclarationList */);
|
|
68942
68969
|
if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) {
|
|
68943
|
-
getNodeLinks(symbol.valueDeclaration).flags |=
|
|
68970
|
+
getNodeLinks(symbol.valueDeclaration).flags |= 65536 /* NeedsLoopOutParameter */;
|
|
68944
68971
|
}
|
|
68945
68972
|
}
|
|
68946
68973
|
getNodeLinks(symbol.valueDeclaration).flags |= 32768 /* BlockScopedBindingInLoop */;
|
|
@@ -69218,7 +69245,7 @@ ${lanes.join("\n")}
|
|
|
69218
69245
|
if (!isCallExpression2 && languageVersion >= 2 /* ES2015 */ && languageVersion <= 8 /* ES2021 */ && (isPropertyDeclaration(container) || isClassStaticBlockDeclaration(container))) {
|
|
69219
69246
|
forEachEnclosingBlockScopeContainer(node.parent, (current) => {
|
|
69220
69247
|
if (!isSourceFile(current) || isExternalOrCommonJsModule(current)) {
|
|
69221
|
-
getNodeLinks(current).flags |=
|
|
69248
|
+
getNodeLinks(current).flags |= 2097152 /* ContainsSuperPropertyInStaticInitializer */;
|
|
69222
69249
|
}
|
|
69223
69250
|
});
|
|
69224
69251
|
}
|
|
@@ -72760,7 +72787,7 @@ ${lanes.join("\n")}
|
|
|
72760
72787
|
}
|
|
72761
72788
|
}
|
|
72762
72789
|
function getThisArgumentOfCall(node) {
|
|
72763
|
-
const expression = node.kind === 213 /* CallExpression */ ? node.expression : node.kind === 215 /* TaggedTemplateExpression */ ? node.tag : void 0;
|
|
72790
|
+
const expression = node.kind === 213 /* CallExpression */ ? node.expression : node.kind === 215 /* TaggedTemplateExpression */ ? node.tag : node.kind === 170 /* Decorator */ && !legacyDecorators ? node.expression : void 0;
|
|
72764
72791
|
if (expression) {
|
|
72765
72792
|
const callee = skipOuterExpressions(expression);
|
|
72766
72793
|
if (isAccessExpression(callee)) {
|
|
@@ -77667,7 +77694,7 @@ ${lanes.join("\n")}
|
|
|
77667
77694
|
function setNodeLinksForPrivateIdentifierScope(node) {
|
|
77668
77695
|
if (isPrivateIdentifier(node.name) && languageVersion < 99 /* ESNext */) {
|
|
77669
77696
|
for (let lexicalScope = getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = getEnclosingBlockScopeContainer(lexicalScope)) {
|
|
77670
|
-
getNodeLinks(lexicalScope).flags |=
|
|
77697
|
+
getNodeLinks(lexicalScope).flags |= 1048576 /* ContainsClassWithPrivateIdentifiers */;
|
|
77671
77698
|
}
|
|
77672
77699
|
if (isClassExpression(node.parent)) {
|
|
77673
77700
|
const enclosingIterationStatement = getEnclosingIterationStatement(node.parent);
|
|
@@ -79420,7 +79447,7 @@ ${lanes.join("\n")}
|
|
|
79420
79447
|
}
|
|
79421
79448
|
function checkWeakMapSetCollision(node) {
|
|
79422
79449
|
const enclosingBlockScope = getEnclosingBlockScopeContainer(node);
|
|
79423
|
-
if (getNodeCheckFlags(enclosingBlockScope) &
|
|
79450
|
+
if (getNodeCheckFlags(enclosingBlockScope) & 1048576 /* ContainsClassWithPrivateIdentifiers */) {
|
|
79424
79451
|
Debug.assert(isNamedDeclaration(node) && isIdentifier(node.name) && typeof node.name.escapedText === "string", "The target of a WeakMap/WeakSet collision check should be an identifier");
|
|
79425
79452
|
errorSkippedOn("noEmit", node, Diagnostics.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel, node.name.escapedText);
|
|
79426
79453
|
}
|
|
@@ -79434,18 +79461,18 @@ ${lanes.join("\n")}
|
|
|
79434
79461
|
let hasCollision = false;
|
|
79435
79462
|
if (isClassExpression(node)) {
|
|
79436
79463
|
for (const member of node.members) {
|
|
79437
|
-
if (getNodeCheckFlags(member) &
|
|
79464
|
+
if (getNodeCheckFlags(member) & 2097152 /* ContainsSuperPropertyInStaticInitializer */) {
|
|
79438
79465
|
hasCollision = true;
|
|
79439
79466
|
break;
|
|
79440
79467
|
}
|
|
79441
79468
|
}
|
|
79442
79469
|
} else if (isFunctionExpression(node)) {
|
|
79443
|
-
if (getNodeCheckFlags(node) &
|
|
79470
|
+
if (getNodeCheckFlags(node) & 2097152 /* ContainsSuperPropertyInStaticInitializer */) {
|
|
79444
79471
|
hasCollision = true;
|
|
79445
79472
|
}
|
|
79446
79473
|
} else {
|
|
79447
79474
|
const container = getEnclosingBlockScopeContainer(node);
|
|
79448
|
-
if (container && getNodeCheckFlags(container) &
|
|
79475
|
+
if (container && getNodeCheckFlags(container) & 2097152 /* ContainsSuperPropertyInStaticInitializer */) {
|
|
79449
79476
|
hasCollision = true;
|
|
79450
79477
|
}
|
|
79451
79478
|
}
|
|
@@ -79480,9 +79507,6 @@ ${lanes.join("\n")}
|
|
|
79480
79507
|
if ((getCombinedNodeFlagsCached(node) & 7 /* BlockScoped */) !== 0 || isParameterDeclaration(node)) {
|
|
79481
79508
|
return;
|
|
79482
79509
|
}
|
|
79483
|
-
if (node.kind === 260 /* VariableDeclaration */ && !node.initializer) {
|
|
79484
|
-
return;
|
|
79485
|
-
}
|
|
79486
79510
|
const symbol = getSymbolOfDeclaration(node);
|
|
79487
79511
|
if (symbol.flags & 1 /* FunctionScopedVariable */) {
|
|
79488
79512
|
if (!isIdentifier(node.name))
|
|
@@ -82104,7 +82128,7 @@ ${lanes.join("\n")}
|
|
|
82104
82128
|
}
|
|
82105
82129
|
return;
|
|
82106
82130
|
}
|
|
82107
|
-
const targetFlags =
|
|
82131
|
+
const targetFlags = getSymbolFlags(target);
|
|
82108
82132
|
const excludedMeanings = (symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */) ? 111551 /* Value */ : 0) | (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0);
|
|
82109
82133
|
if (targetFlags & excludedMeanings) {
|
|
82110
82134
|
const message = node.kind === 281 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
|
|
@@ -82262,7 +82286,7 @@ ${lanes.join("\n")}
|
|
|
82262
82286
|
if (node.moduleReference.kind !== 283 /* ExternalModuleReference */) {
|
|
82263
82287
|
const target = resolveAlias(getSymbolOfDeclaration(node));
|
|
82264
82288
|
if (target !== unknownSymbol) {
|
|
82265
|
-
const targetFlags =
|
|
82289
|
+
const targetFlags = getSymbolFlags(target);
|
|
82266
82290
|
if (targetFlags & 111551 /* Value */) {
|
|
82267
82291
|
const moduleName = getFirstIdentifier(node.moduleReference);
|
|
82268
82292
|
if (!(resolveEntityName(moduleName, 111551 /* Value */ | 1920 /* Namespace */).flags & 1920 /* Namespace */)) {
|
|
@@ -82402,7 +82426,7 @@ ${lanes.join("\n")}
|
|
|
82402
82426
|
markExportAsReferenced(node);
|
|
82403
82427
|
}
|
|
82404
82428
|
const target = symbol && (symbol.flags & 2097152 /* Alias */ ? resolveAlias(symbol) : symbol);
|
|
82405
|
-
if (!target ||
|
|
82429
|
+
if (!target || getSymbolFlags(target) & 111551 /* Value */) {
|
|
82406
82430
|
checkExpressionCached(node.propertyName || node.name);
|
|
82407
82431
|
}
|
|
82408
82432
|
}
|
|
@@ -82447,7 +82471,7 @@ ${lanes.join("\n")}
|
|
|
82447
82471
|
));
|
|
82448
82472
|
if (sym) {
|
|
82449
82473
|
markAliasReferenced(sym, id);
|
|
82450
|
-
if (
|
|
82474
|
+
if (getSymbolFlags(sym) & 111551 /* Value */) {
|
|
82451
82475
|
checkExpressionCached(id);
|
|
82452
82476
|
if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) {
|
|
82453
82477
|
error2(
|
|
@@ -83694,7 +83718,7 @@ ${lanes.join("\n")}
|
|
|
83694
83718
|
return symbolLinks2.exportsSomeValue;
|
|
83695
83719
|
function isValue(s) {
|
|
83696
83720
|
s = resolveSymbol(s);
|
|
83697
|
-
return s && !!(
|
|
83721
|
+
return s && !!(getSymbolFlags(s) & 111551 /* Value */);
|
|
83698
83722
|
}
|
|
83699
83723
|
}
|
|
83700
83724
|
function isNameOfModuleOrEnumDeclaration(node) {
|
|
@@ -83824,7 +83848,11 @@ ${lanes.join("\n")}
|
|
|
83824
83848
|
case 276 /* ImportSpecifier */:
|
|
83825
83849
|
case 281 /* ExportSpecifier */:
|
|
83826
83850
|
const symbol = getSymbolOfDeclaration(node);
|
|
83827
|
-
return !!symbol && isAliasResolvedToValue(
|
|
83851
|
+
return !!symbol && isAliasResolvedToValue(
|
|
83852
|
+
symbol,
|
|
83853
|
+
/*excludeTypeOnlyValues*/
|
|
83854
|
+
true
|
|
83855
|
+
);
|
|
83828
83856
|
case 278 /* ExportDeclaration */:
|
|
83829
83857
|
const exportClause = node.exportClause;
|
|
83830
83858
|
return !!exportClause && (isNamespaceExport(exportClause) || some(exportClause.elements, isValueAliasDeclaration));
|
|
@@ -83841,7 +83869,7 @@ ${lanes.join("\n")}
|
|
|
83841
83869
|
const isValue = isAliasResolvedToValue(getSymbolOfDeclaration(node));
|
|
83842
83870
|
return isValue && node.moduleReference && !nodeIsMissing(node.moduleReference);
|
|
83843
83871
|
}
|
|
83844
|
-
function isAliasResolvedToValue(symbol) {
|
|
83872
|
+
function isAliasResolvedToValue(symbol, excludeTypeOnlyValues) {
|
|
83845
83873
|
if (!symbol) {
|
|
83846
83874
|
return false;
|
|
83847
83875
|
}
|
|
@@ -83849,7 +83877,12 @@ ${lanes.join("\n")}
|
|
|
83849
83877
|
if (target === unknownSymbol) {
|
|
83850
83878
|
return true;
|
|
83851
83879
|
}
|
|
83852
|
-
return !!((
|
|
83880
|
+
return !!(getSymbolFlags(
|
|
83881
|
+
symbol,
|
|
83882
|
+
excludeTypeOnlyValues,
|
|
83883
|
+
/*excludeLocalMeanings*/
|
|
83884
|
+
true
|
|
83885
|
+
) & 111551 /* Value */) && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target));
|
|
83853
83886
|
}
|
|
83854
83887
|
function isConstEnumOrConstEnumOnlyModule(s) {
|
|
83855
83888
|
return isConstEnumSymbol(s) || !!s.constEnumOnlyModule;
|
|
@@ -83863,7 +83896,7 @@ ${lanes.join("\n")}
|
|
|
83863
83896
|
return true;
|
|
83864
83897
|
}
|
|
83865
83898
|
const target = getSymbolLinks(symbol).aliasTarget;
|
|
83866
|
-
if (target && getEffectiveModifierFlags(node) & 1 /* Export */ &&
|
|
83899
|
+
if (target && getEffectiveModifierFlags(node) & 1 /* Export */ && getSymbolFlags(target) & 111551 /* Value */ && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) {
|
|
83867
83900
|
return true;
|
|
83868
83901
|
}
|
|
83869
83902
|
}
|
|
@@ -91918,6 +91951,11 @@ ${lanes.join("\n")}
|
|
|
91918
91951
|
}
|
|
91919
91952
|
}
|
|
91920
91953
|
}
|
|
91954
|
+
function getClassThis() {
|
|
91955
|
+
const lex = getClassLexicalEnvironment();
|
|
91956
|
+
const classThis = lex.classThis ?? lex.classConstructor ?? (currentClassContainer == null ? void 0 : currentClassContainer.name);
|
|
91957
|
+
return Debug.checkDefined(classThis);
|
|
91958
|
+
}
|
|
91921
91959
|
function transformAutoAccessor(node) {
|
|
91922
91960
|
const commentRange = getCommentRange(node);
|
|
91923
91961
|
const sourceMapRange = getSourceMapRange(node);
|
|
@@ -91944,11 +91982,13 @@ ${lanes.join("\n")}
|
|
|
91944
91982
|
setOriginalNode(backingField, node);
|
|
91945
91983
|
setEmitFlags(backingField, 3072 /* NoComments */);
|
|
91946
91984
|
setSourceMapRange(backingField, sourceMapRange);
|
|
91947
|
-
const
|
|
91985
|
+
const receiver = isStatic(node) ? getClassThis() : factory2.createThis();
|
|
91986
|
+
const getter = createAccessorPropertyGetRedirector(factory2, node, modifiers, getterName, receiver);
|
|
91948
91987
|
setOriginalNode(getter, node);
|
|
91949
91988
|
setCommentRange(getter, commentRange);
|
|
91950
91989
|
setSourceMapRange(getter, sourceMapRange);
|
|
91951
|
-
const
|
|
91990
|
+
const setterModifiers = factory2.createModifiersFromModifierFlags(modifiersToFlags(modifiers));
|
|
91991
|
+
const setter = createAccessorPropertySetRedirector(factory2, node, setterModifiers, setterName, receiver);
|
|
91952
91992
|
setOriginalNode(setter, node);
|
|
91953
91993
|
setEmitFlags(setter, 3072 /* NoComments */);
|
|
91954
91994
|
setSourceMapRange(setter, sourceMapRange);
|
|
@@ -92505,6 +92545,7 @@ ${lanes.join("\n")}
|
|
|
92505
92545
|
return filter(node.members, isNonStaticMethodOrAccessorWithPrivateName);
|
|
92506
92546
|
}
|
|
92507
92547
|
function getClassFacts(node) {
|
|
92548
|
+
var _a;
|
|
92508
92549
|
let facts = 0 /* None */;
|
|
92509
92550
|
const original = getOriginalNode(node);
|
|
92510
92551
|
if (isClassDeclaration(original) && classOrConstructorParameterIsDecorated(legacyDecorators, original)) {
|
|
@@ -92521,6 +92562,8 @@ ${lanes.join("\n")}
|
|
|
92521
92562
|
if (isStatic(member)) {
|
|
92522
92563
|
if (member.name && (isPrivateIdentifier(member.name) || isAutoAccessorPropertyDeclaration(member)) && shouldTransformPrivateElementsOrClassStaticBlocks) {
|
|
92523
92564
|
facts |= 2 /* NeedsClassConstructorReference */;
|
|
92565
|
+
} else if (isAutoAccessorPropertyDeclaration(member) && shouldTransformAutoAccessors === -1 /* True */ && !node.name && !((_a = node.emitNode) == null ? void 0 : _a.classThis)) {
|
|
92566
|
+
facts |= 2 /* NeedsClassConstructorReference */;
|
|
92524
92567
|
}
|
|
92525
92568
|
if (isPropertyDeclaration(member) || isClassStaticBlockDeclaration(member)) {
|
|
92526
92569
|
if (shouldTransformThisInStaticInitializers && member.transformFlags & 16384 /* ContainsLexicalThis */) {
|
|
@@ -92541,6 +92584,9 @@ ${lanes.join("\n")}
|
|
|
92541
92584
|
containsInstancePrivateElements || (containsInstancePrivateElements = isPrivateIdentifierClassElementDeclaration(member));
|
|
92542
92585
|
} else if (isPrivateIdentifierClassElementDeclaration(member)) {
|
|
92543
92586
|
containsInstancePrivateElements = true;
|
|
92587
|
+
if (resolver.getNodeCheckFlags(member) & 262144 /* ContainsConstructorReference */) {
|
|
92588
|
+
facts |= 2 /* NeedsClassConstructorReference */;
|
|
92589
|
+
}
|
|
92544
92590
|
} else if (isPropertyDeclaration(member)) {
|
|
92545
92591
|
containsPublicInstanceFields = true;
|
|
92546
92592
|
containsInitializedPublicInstanceFields || (containsInitializedPublicInstanceFields = !!member.initializer);
|
|
@@ -92641,10 +92687,11 @@ ${lanes.join("\n")}
|
|
|
92641
92687
|
getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp);
|
|
92642
92688
|
pendingClassReferenceAssignment = factory2.createAssignment(temp, factory2.getInternalName(node));
|
|
92643
92689
|
}
|
|
92644
|
-
if ((_b = node.emitNode) == null ? void 0 : _b.classThis) {
|
|
92645
|
-
getClassLexicalEnvironment().classThis = node.emitNode.classThis;
|
|
92646
|
-
}
|
|
92647
92690
|
}
|
|
92691
|
+
if ((_b = node.emitNode) == null ? void 0 : _b.classThis) {
|
|
92692
|
+
getClassLexicalEnvironment().classThis = node.emitNode.classThis;
|
|
92693
|
+
}
|
|
92694
|
+
const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 262144 /* ContainsConstructorReference */;
|
|
92648
92695
|
const isExport = hasSyntacticModifier(node, 1 /* Export */);
|
|
92649
92696
|
const isDefault = hasSyntacticModifier(node, 1024 /* Default */);
|
|
92650
92697
|
let modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier);
|
|
@@ -92679,6 +92726,11 @@ ${lanes.join("\n")}
|
|
|
92679
92726
|
)
|
|
92680
92727
|
));
|
|
92681
92728
|
}
|
|
92729
|
+
const alias = getClassLexicalEnvironment().classConstructor;
|
|
92730
|
+
if (isClassWithConstructorReference && alias) {
|
|
92731
|
+
enableSubstitutionForClassAliases();
|
|
92732
|
+
classAliases[getOriginalNodeId(node)] = alias;
|
|
92733
|
+
}
|
|
92682
92734
|
const classDecl = factory2.updateClassDeclaration(
|
|
92683
92735
|
node,
|
|
92684
92736
|
modifiers,
|
|
@@ -92701,14 +92753,14 @@ ${lanes.join("\n")}
|
|
|
92701
92753
|
var _a, _b, _c;
|
|
92702
92754
|
const isDecoratedClassDeclaration = !!(facts & 1 /* ClassWasDecorated */);
|
|
92703
92755
|
const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node);
|
|
92704
|
-
const
|
|
92756
|
+
const classCheckFlags = resolver.getNodeCheckFlags(node);
|
|
92757
|
+
const isClassWithConstructorReference = classCheckFlags & 262144 /* ContainsConstructorReference */;
|
|
92705
92758
|
let temp;
|
|
92706
92759
|
function createClassTempVar() {
|
|
92707
92760
|
var _a2;
|
|
92708
92761
|
if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_a2 = node.emitNode) == null ? void 0 : _a2.classThis)) {
|
|
92709
92762
|
return getClassLexicalEnvironment().classConstructor = node.emitNode.classThis;
|
|
92710
92763
|
}
|
|
92711
|
-
const classCheckFlags = resolver.getNodeCheckFlags(node);
|
|
92712
92764
|
const requiresBlockScopedVar = classCheckFlags & 32768 /* BlockScopedBindingInLoop */;
|
|
92713
92765
|
const temp2 = factory2.createTempVariable(
|
|
92714
92766
|
requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration,
|
|
@@ -93675,7 +93727,7 @@ ${lanes.join("\n")}
|
|
|
93675
93727
|
}
|
|
93676
93728
|
function trySubstituteClassAlias(node) {
|
|
93677
93729
|
if (enabledSubstitutions & 1 /* ClassAliases */) {
|
|
93678
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
93730
|
+
if (resolver.getNodeCheckFlags(node) & 536870912 /* ConstructorReference */) {
|
|
93679
93731
|
const declaration = resolver.getReferencedValueDeclaration(node);
|
|
93680
93732
|
if (declaration) {
|
|
93681
93733
|
const classAlias = classAliases[declaration.id];
|
|
@@ -94541,7 +94593,7 @@ ${lanes.join("\n")}
|
|
|
94541
94593
|
}
|
|
94542
94594
|
}
|
|
94543
94595
|
function getClassAliasIfNeeded(node) {
|
|
94544
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
94596
|
+
if (resolver.getNodeCheckFlags(node) & 262144 /* ContainsConstructorReference */) {
|
|
94545
94597
|
enableSubstitutionForClassAliases();
|
|
94546
94598
|
const classAlias = factory2.createUniqueName(node.name && !isGeneratedIdentifier(node.name) ? idText(node.name) : "default");
|
|
94547
94599
|
classAliases[getOriginalNodeId(node)] = classAlias;
|
|
@@ -94574,7 +94626,7 @@ ${lanes.join("\n")}
|
|
|
94574
94626
|
}
|
|
94575
94627
|
function trySubstituteClassAlias(node) {
|
|
94576
94628
|
if (classAliases) {
|
|
94577
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
94629
|
+
if (resolver.getNodeCheckFlags(node) & 536870912 /* ConstructorReference */) {
|
|
94578
94630
|
const declaration = resolver.getReferencedValueDeclaration(node);
|
|
94579
94631
|
if (declaration) {
|
|
94580
94632
|
const classAlias = classAliases[declaration.id];
|
|
@@ -94606,6 +94658,7 @@ ${lanes.join("\n")}
|
|
|
94606
94658
|
endLexicalEnvironment,
|
|
94607
94659
|
hoistVariableDeclaration
|
|
94608
94660
|
} = context;
|
|
94661
|
+
const languageVersion = getEmitScriptTarget(context.getCompilerOptions());
|
|
94609
94662
|
let top;
|
|
94610
94663
|
let classInfo;
|
|
94611
94664
|
let classThis;
|
|
@@ -96107,6 +96160,17 @@ ${lanes.join("\n")}
|
|
|
96107
96160
|
function transformDecorator(decorator) {
|
|
96108
96161
|
const expression = visitNode(decorator.expression, visitor, isExpression);
|
|
96109
96162
|
setEmitFlags(expression, 3072 /* NoComments */);
|
|
96163
|
+
const innerExpression = skipOuterExpressions(expression);
|
|
96164
|
+
if (isAccessExpression(innerExpression)) {
|
|
96165
|
+
const { target, thisArg } = factory2.createCallBinding(
|
|
96166
|
+
expression,
|
|
96167
|
+
hoistVariableDeclaration,
|
|
96168
|
+
languageVersion,
|
|
96169
|
+
/*cacheIdentifiers*/
|
|
96170
|
+
true
|
|
96171
|
+
);
|
|
96172
|
+
return factory2.restoreOuterExpressions(expression, factory2.createFunctionBindCall(target, thisArg, []));
|
|
96173
|
+
}
|
|
96110
96174
|
return expression;
|
|
96111
96175
|
}
|
|
96112
96176
|
function createDescriptorMethod(original, name, modifiers, asteriskToken, kind, parameters, body) {
|
|
@@ -102805,10 +102869,10 @@ ${lanes.join("\n")}
|
|
|
102805
102869
|
name
|
|
102806
102870
|
));
|
|
102807
102871
|
const checkFlags = resolver.getNodeCheckFlags(decl);
|
|
102808
|
-
if (checkFlags &
|
|
102872
|
+
if (checkFlags & 65536 /* NeedsLoopOutParameter */ || hasCapturedBindingsInForHead) {
|
|
102809
102873
|
const outParamName = factory2.createUniqueName("out_" + idText(name));
|
|
102810
102874
|
let flags = 0 /* None */;
|
|
102811
|
-
if (checkFlags &
|
|
102875
|
+
if (checkFlags & 65536 /* NeedsLoopOutParameter */) {
|
|
102812
102876
|
flags |= 1 /* Body */;
|
|
102813
102877
|
}
|
|
102814
102878
|
if (isForStatement(container)) {
|
|
@@ -137371,25 +137435,25 @@ ${lanes.join("\n")}
|
|
|
137371
137435
|
const { file } = context;
|
|
137372
137436
|
const range = createTextRangeFromSpan(getRefactorContextSpan(context));
|
|
137373
137437
|
const { statements } = file;
|
|
137374
|
-
|
|
137438
|
+
let startNodeIndex = findIndex(statements, (s) => s.end > range.pos);
|
|
137375
137439
|
if (startNodeIndex === -1)
|
|
137376
137440
|
return void 0;
|
|
137377
137441
|
const startStatement = statements[startNodeIndex];
|
|
137378
|
-
if (isNamedDeclaration(startStatement) && startStatement.name && rangeContainsRange(startStatement.name, range)) {
|
|
137379
|
-
return { toMove: [statements[startNodeIndex]], afterLast: statements[startNodeIndex + 1] };
|
|
137380
|
-
}
|
|
137381
137442
|
const overloadRangeToMove = getOverloadRangeToMove(file, startStatement);
|
|
137382
137443
|
if (overloadRangeToMove) {
|
|
137383
|
-
|
|
137444
|
+
startNodeIndex = overloadRangeToMove.start;
|
|
137445
|
+
}
|
|
137446
|
+
let endNodeIndex = findIndex(statements, (s) => s.end >= range.end, startNodeIndex);
|
|
137447
|
+
if (endNodeIndex !== -1 && range.end <= statements[endNodeIndex].getStart()) {
|
|
137448
|
+
endNodeIndex--;
|
|
137449
|
+
}
|
|
137450
|
+
const endingOverloadRangeToMove = getOverloadRangeToMove(file, statements[endNodeIndex]);
|
|
137451
|
+
if (endingOverloadRangeToMove) {
|
|
137452
|
+
endNodeIndex = endingOverloadRangeToMove.end;
|
|
137384
137453
|
}
|
|
137385
|
-
if (range.pos > startStatement.getStart(file))
|
|
137386
|
-
return void 0;
|
|
137387
|
-
const afterEndNodeIndex = findIndex(statements, (s) => s.end > range.end, startNodeIndex);
|
|
137388
|
-
if (afterEndNodeIndex !== -1 && (afterEndNodeIndex === 0 || statements[afterEndNodeIndex].getStart(file) < range.end))
|
|
137389
|
-
return void 0;
|
|
137390
137454
|
return {
|
|
137391
|
-
toMove: statements.slice(startNodeIndex,
|
|
137392
|
-
afterLast:
|
|
137455
|
+
toMove: statements.slice(startNodeIndex, endNodeIndex === -1 ? statements.length : endNodeIndex + 1),
|
|
137456
|
+
afterLast: endNodeIndex === -1 ? void 0 : statements[endNodeIndex + 1]
|
|
137393
137457
|
};
|
|
137394
137458
|
}
|
|
137395
137459
|
function getStatementsToMove(context) {
|
|
@@ -137644,10 +137708,12 @@ ${lanes.join("\n")}
|
|
|
137644
137708
|
if (declarations === void 0 || length(declarations) <= 1 || !contains(declarations, statement)) {
|
|
137645
137709
|
return void 0;
|
|
137646
137710
|
}
|
|
137711
|
+
const firstDecl = declarations[0];
|
|
137647
137712
|
const lastDecl = declarations[length(declarations) - 1];
|
|
137648
137713
|
const statementsToMove = mapDefined(declarations, (d) => getSourceFileOfNode(d) === sourceFile && isStatement(d) ? d : void 0);
|
|
137649
|
-
const end =
|
|
137650
|
-
|
|
137714
|
+
const end = findIndex(sourceFile.statements, (s) => s.end >= lastDecl.end);
|
|
137715
|
+
const start = findIndex(sourceFile.statements, (s) => s.end >= firstDecl.end);
|
|
137716
|
+
return { toMove: statementsToMove, start, end };
|
|
137651
137717
|
}
|
|
137652
137718
|
return void 0;
|
|
137653
137719
|
}
|
|
@@ -137694,7 +137760,7 @@ ${lanes.join("\n")}
|
|
|
137694
137760
|
if (host.fileExists(targetFile) && program.getSourceFile(targetFile) === void 0) {
|
|
137695
137761
|
return error(getLocaleSpecificMessage(Diagnostics.Cannot_move_statements_to_the_selected_file));
|
|
137696
137762
|
}
|
|
137697
|
-
const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange4(context, context.file, interactiveRefactorArguments.targetFile, program, statements, t, context.host, context.preferences));
|
|
137763
|
+
const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange4(context, context.file, interactiveRefactorArguments.targetFile, context.program, statements, t, context.host, context.preferences));
|
|
137698
137764
|
return { edits, renameFilename: void 0, renameLocation: void 0 };
|
|
137699
137765
|
}
|
|
137700
137766
|
return error(getLocaleSpecificMessage(Diagnostics.Cannot_move_to_file_selected_file_is_invalid));
|
|
@@ -159665,6 +159731,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
159665
159731
|
return cls;
|
|
159666
159732
|
}
|
|
159667
159733
|
break;
|
|
159734
|
+
case 81 /* PrivateIdentifier */:
|
|
159735
|
+
if (tryCast(location.parent, isPropertyDeclaration)) {
|
|
159736
|
+
return findAncestor(location, isClassLike);
|
|
159737
|
+
}
|
|
159738
|
+
break;
|
|
159668
159739
|
case 80 /* Identifier */: {
|
|
159669
159740
|
const originalKeywordKind = identifierToKeywordKind(location);
|
|
159670
159741
|
if (originalKeywordKind) {
|
|
@@ -164054,8 +164125,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
164054
164125
|
}
|
|
164055
164126
|
function addParameterHints(text, parameter, position, isFirstVariadicArgument, sourceFile) {
|
|
164056
164127
|
let hintText = `${isFirstVariadicArgument ? "..." : ""}${text}`;
|
|
164128
|
+
let displayParts;
|
|
164057
164129
|
if (shouldUseInteractiveInlayHints(preferences)) {
|
|
164058
|
-
|
|
164130
|
+
displayParts = [getNodeDisplayPart(hintText, parameter, sourceFile), { text: ":" }];
|
|
164131
|
+
hintText = "";
|
|
164059
164132
|
} else {
|
|
164060
164133
|
hintText += ":";
|
|
164061
164134
|
}
|
|
@@ -164063,7 +164136,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
164063
164136
|
text: hintText,
|
|
164064
164137
|
position,
|
|
164065
164138
|
kind: "Parameter" /* Parameter */,
|
|
164066
|
-
whitespaceAfter: true
|
|
164139
|
+
whitespaceAfter: true,
|
|
164140
|
+
displayParts
|
|
164067
164141
|
});
|
|
164068
164142
|
}
|
|
164069
164143
|
function addTypeHints(text, position) {
|