typescript 5.0.0-dev.20221116 → 5.0.0-dev.20221118
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 +98 -81
- package/lib/tsserver.js +124 -103
- package/lib/tsserverlibrary.d.ts +2 -0
- package/lib/tsserverlibrary.js +124 -103
- package/lib/typescript.d.ts +2 -0
- package/lib/typescript.js +124 -103
- package/lib/typingsInstaller.js +3 -1
- package/package.json +1 -1
package/lib/tsserver.js
CHANGED
|
@@ -2648,7 +2648,7 @@ var ts = (() => {
|
|
|
2648
2648
|
|
|
2649
2649
|
// src/compiler/corePublic.ts
|
|
2650
2650
|
var versionMajorMinor = "5.0";
|
|
2651
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
2651
|
+
var version = `${versionMajorMinor}.0-dev.20221118`;
|
|
2652
2652
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2653
2653
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2654
2654
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6868,6 +6868,7 @@ ${lanes.join("\n")}
|
|
|
6868
6868
|
return EnumKind2;
|
|
6869
6869
|
})(EnumKind || {});
|
|
6870
6870
|
var CheckFlags = /* @__PURE__ */ ((CheckFlags2) => {
|
|
6871
|
+
CheckFlags2[CheckFlags2["None"] = 0] = "None";
|
|
6871
6872
|
CheckFlags2[CheckFlags2["Instantiated"] = 1] = "Instantiated";
|
|
6872
6873
|
CheckFlags2[CheckFlags2["SyntheticProperty"] = 2] = "SyntheticProperty";
|
|
6873
6874
|
CheckFlags2[CheckFlags2["SyntheticMethod"] = 4] = "SyntheticMethod";
|
|
@@ -6915,31 +6916,32 @@ ${lanes.join("\n")}
|
|
|
6915
6916
|
return InternalSymbolName2;
|
|
6916
6917
|
})(InternalSymbolName || {});
|
|
6917
6918
|
var NodeCheckFlags = /* @__PURE__ */ ((NodeCheckFlags2) => {
|
|
6919
|
+
NodeCheckFlags2[NodeCheckFlags2["None"] = 0] = "None";
|
|
6918
6920
|
NodeCheckFlags2[NodeCheckFlags2["TypeChecked"] = 1] = "TypeChecked";
|
|
6919
6921
|
NodeCheckFlags2[NodeCheckFlags2["LexicalThis"] = 2] = "LexicalThis";
|
|
6920
6922
|
NodeCheckFlags2[NodeCheckFlags2["CaptureThis"] = 4] = "CaptureThis";
|
|
6921
6923
|
NodeCheckFlags2[NodeCheckFlags2["CaptureNewTarget"] = 8] = "CaptureNewTarget";
|
|
6922
|
-
NodeCheckFlags2[NodeCheckFlags2["SuperInstance"] =
|
|
6923
|
-
NodeCheckFlags2[NodeCheckFlags2["SuperStatic"] =
|
|
6924
|
-
NodeCheckFlags2[NodeCheckFlags2["ContextChecked"] =
|
|
6925
|
-
NodeCheckFlags2[NodeCheckFlags2["MethodWithSuperPropertyAccessInAsync"] =
|
|
6926
|
-
NodeCheckFlags2[NodeCheckFlags2["MethodWithSuperPropertyAssignmentInAsync"] =
|
|
6927
|
-
NodeCheckFlags2[NodeCheckFlags2["CaptureArguments"] =
|
|
6928
|
-
NodeCheckFlags2[NodeCheckFlags2["EnumValuesComputed"] =
|
|
6929
|
-
NodeCheckFlags2[NodeCheckFlags2["LexicalModuleMergesWithClass"] =
|
|
6930
|
-
NodeCheckFlags2[NodeCheckFlags2["LoopWithCapturedBlockScopedBinding"] =
|
|
6931
|
-
NodeCheckFlags2[NodeCheckFlags2["ContainsCapturedBlockScopeBinding"] =
|
|
6932
|
-
NodeCheckFlags2[NodeCheckFlags2["CapturedBlockScopedBinding"] =
|
|
6933
|
-
NodeCheckFlags2[NodeCheckFlags2["BlockScopedBindingInLoop"] =
|
|
6934
|
-
NodeCheckFlags2[NodeCheckFlags2["ClassWithBodyScopedClassBinding"] =
|
|
6935
|
-
NodeCheckFlags2[NodeCheckFlags2["BodyScopedClassBinding"] =
|
|
6936
|
-
NodeCheckFlags2[NodeCheckFlags2["NeedsLoopOutParameter"] =
|
|
6937
|
-
NodeCheckFlags2[NodeCheckFlags2["AssignmentsMarked"] =
|
|
6938
|
-
NodeCheckFlags2[NodeCheckFlags2["ClassWithConstructorReference"] =
|
|
6939
|
-
NodeCheckFlags2[NodeCheckFlags2["ConstructorReferenceInClass"] =
|
|
6940
|
-
NodeCheckFlags2[NodeCheckFlags2["ContainsClassWithPrivateIdentifiers"] =
|
|
6941
|
-
NodeCheckFlags2[NodeCheckFlags2["ContainsSuperPropertyInStaticInitializer"] =
|
|
6942
|
-
NodeCheckFlags2[NodeCheckFlags2["InCheckIdentifier"] =
|
|
6924
|
+
NodeCheckFlags2[NodeCheckFlags2["SuperInstance"] = 16] = "SuperInstance";
|
|
6925
|
+
NodeCheckFlags2[NodeCheckFlags2["SuperStatic"] = 32] = "SuperStatic";
|
|
6926
|
+
NodeCheckFlags2[NodeCheckFlags2["ContextChecked"] = 64] = "ContextChecked";
|
|
6927
|
+
NodeCheckFlags2[NodeCheckFlags2["MethodWithSuperPropertyAccessInAsync"] = 128] = "MethodWithSuperPropertyAccessInAsync";
|
|
6928
|
+
NodeCheckFlags2[NodeCheckFlags2["MethodWithSuperPropertyAssignmentInAsync"] = 256] = "MethodWithSuperPropertyAssignmentInAsync";
|
|
6929
|
+
NodeCheckFlags2[NodeCheckFlags2["CaptureArguments"] = 512] = "CaptureArguments";
|
|
6930
|
+
NodeCheckFlags2[NodeCheckFlags2["EnumValuesComputed"] = 1024] = "EnumValuesComputed";
|
|
6931
|
+
NodeCheckFlags2[NodeCheckFlags2["LexicalModuleMergesWithClass"] = 2048] = "LexicalModuleMergesWithClass";
|
|
6932
|
+
NodeCheckFlags2[NodeCheckFlags2["LoopWithCapturedBlockScopedBinding"] = 4096] = "LoopWithCapturedBlockScopedBinding";
|
|
6933
|
+
NodeCheckFlags2[NodeCheckFlags2["ContainsCapturedBlockScopeBinding"] = 8192] = "ContainsCapturedBlockScopeBinding";
|
|
6934
|
+
NodeCheckFlags2[NodeCheckFlags2["CapturedBlockScopedBinding"] = 16384] = "CapturedBlockScopedBinding";
|
|
6935
|
+
NodeCheckFlags2[NodeCheckFlags2["BlockScopedBindingInLoop"] = 32768] = "BlockScopedBindingInLoop";
|
|
6936
|
+
NodeCheckFlags2[NodeCheckFlags2["ClassWithBodyScopedClassBinding"] = 65536] = "ClassWithBodyScopedClassBinding";
|
|
6937
|
+
NodeCheckFlags2[NodeCheckFlags2["BodyScopedClassBinding"] = 131072] = "BodyScopedClassBinding";
|
|
6938
|
+
NodeCheckFlags2[NodeCheckFlags2["NeedsLoopOutParameter"] = 262144] = "NeedsLoopOutParameter";
|
|
6939
|
+
NodeCheckFlags2[NodeCheckFlags2["AssignmentsMarked"] = 524288] = "AssignmentsMarked";
|
|
6940
|
+
NodeCheckFlags2[NodeCheckFlags2["ClassWithConstructorReference"] = 1048576] = "ClassWithConstructorReference";
|
|
6941
|
+
NodeCheckFlags2[NodeCheckFlags2["ConstructorReferenceInClass"] = 2097152] = "ConstructorReferenceInClass";
|
|
6942
|
+
NodeCheckFlags2[NodeCheckFlags2["ContainsClassWithPrivateIdentifiers"] = 4194304] = "ContainsClassWithPrivateIdentifiers";
|
|
6943
|
+
NodeCheckFlags2[NodeCheckFlags2["ContainsSuperPropertyInStaticInitializer"] = 8388608] = "ContainsSuperPropertyInStaticInitializer";
|
|
6944
|
+
NodeCheckFlags2[NodeCheckFlags2["InCheckIdentifier"] = 16777216] = "InCheckIdentifier";
|
|
6943
6945
|
return NodeCheckFlags2;
|
|
6944
6946
|
})(NodeCheckFlags || {});
|
|
6945
6947
|
var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
@@ -7012,6 +7014,7 @@ ${lanes.join("\n")}
|
|
|
7012
7014
|
return TypeFlags2;
|
|
7013
7015
|
})(TypeFlags || {});
|
|
7014
7016
|
var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
|
7017
|
+
ObjectFlags3[ObjectFlags3["None"] = 0] = "None";
|
|
7015
7018
|
ObjectFlags3[ObjectFlags3["Class"] = 1] = "Class";
|
|
7016
7019
|
ObjectFlags3[ObjectFlags3["Interface"] = 2] = "Interface";
|
|
7017
7020
|
ObjectFlags3[ObjectFlags3["Reference"] = 4] = "Reference";
|
|
@@ -7129,6 +7132,7 @@ ${lanes.join("\n")}
|
|
|
7129
7132
|
return TypeMapKind2;
|
|
7130
7133
|
})(TypeMapKind || {});
|
|
7131
7134
|
var InferencePriority = /* @__PURE__ */ ((InferencePriority2) => {
|
|
7135
|
+
InferencePriority2[InferencePriority2["None"] = 0] = "None";
|
|
7132
7136
|
InferencePriority2[InferencePriority2["NakedTypeVariable"] = 1] = "NakedTypeVariable";
|
|
7133
7137
|
InferencePriority2[InferencePriority2["SpeculativeTuple"] = 2] = "SpeculativeTuple";
|
|
7134
7138
|
InferencePriority2[InferencePriority2["SubstituteSource"] = 4] = "SubstituteSource";
|
|
@@ -42900,6 +42904,7 @@ ${lanes.join("\n")}
|
|
|
42900
42904
|
return CheckMode3;
|
|
42901
42905
|
})(CheckMode || {});
|
|
42902
42906
|
var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
|
|
42907
|
+
SignatureCheckMode3[SignatureCheckMode3["None"] = 0] = "None";
|
|
42903
42908
|
SignatureCheckMode3[SignatureCheckMode3["BivariantCallback"] = 1] = "BivariantCallback";
|
|
42904
42909
|
SignatureCheckMode3[SignatureCheckMode3["StrictCallback"] = 2] = "StrictCallback";
|
|
42905
42910
|
SignatureCheckMode3[SignatureCheckMode3["IgnoreReturnTypes"] = 4] = "IgnoreReturnTypes";
|
|
@@ -42917,7 +42922,7 @@ ${lanes.join("\n")}
|
|
|
42917
42922
|
function SymbolLinks() {
|
|
42918
42923
|
}
|
|
42919
42924
|
function NodeLinks() {
|
|
42920
|
-
this.flags = 0
|
|
42925
|
+
this.flags = 0 /* None */;
|
|
42921
42926
|
}
|
|
42922
42927
|
function getNodeId(node) {
|
|
42923
42928
|
if (!node.id) {
|
|
@@ -43762,7 +43767,7 @@ ${lanes.join("\n")}
|
|
|
43762
43767
|
function createSymbol(flags, name, checkFlags) {
|
|
43763
43768
|
symbolCount++;
|
|
43764
43769
|
const symbol = new Symbol46(flags | 33554432 /* Transient */, name);
|
|
43765
|
-
symbol.checkFlags = checkFlags || 0
|
|
43770
|
+
symbol.checkFlags = checkFlags || 0 /* None */;
|
|
43766
43771
|
return symbol;
|
|
43767
43772
|
}
|
|
43768
43773
|
function getExcludedSymbolFlags(flags) {
|
|
@@ -46073,7 +46078,7 @@ ${lanes.join("\n")}
|
|
|
46073
46078
|
function createOriginType(flags) {
|
|
46074
46079
|
return new Type27(checker, flags);
|
|
46075
46080
|
}
|
|
46076
|
-
function createIntrinsicType(kind, intrinsicName, objectFlags = 0) {
|
|
46081
|
+
function createIntrinsicType(kind, intrinsicName, objectFlags = 0 /* None */) {
|
|
46077
46082
|
const type = createType(kind);
|
|
46078
46083
|
type.intrinsicName = intrinsicName;
|
|
46079
46084
|
type.objectFlags = objectFlags;
|
|
@@ -52914,7 +52919,7 @@ ${lanes.join("\n")}
|
|
|
52914
52919
|
function containsArgumentsReference(declaration) {
|
|
52915
52920
|
const links = getNodeLinks(declaration);
|
|
52916
52921
|
if (links.containsArgumentsReference === void 0) {
|
|
52917
|
-
if (links.flags &
|
|
52922
|
+
if (links.flags & 512 /* CaptureArguments */) {
|
|
52918
52923
|
links.containsArgumentsReference = true;
|
|
52919
52924
|
} else {
|
|
52920
52925
|
links.containsArgumentsReference = traverse(declaration.body);
|
|
@@ -53436,8 +53441,21 @@ ${lanes.join("\n")}
|
|
|
53436
53441
|
return errorType;
|
|
53437
53442
|
}
|
|
53438
53443
|
const aliasSymbol = getAliasSymbolForTypeNode(node);
|
|
53439
|
-
|
|
53440
|
-
|
|
53444
|
+
let newAliasSymbol = aliasSymbol && (isLocalTypeAlias(symbol) || !isLocalTypeAlias(aliasSymbol)) ? aliasSymbol : void 0;
|
|
53445
|
+
let aliasTypeArguments;
|
|
53446
|
+
if (newAliasSymbol) {
|
|
53447
|
+
aliasTypeArguments = getTypeArgumentsForAliasSymbol(newAliasSymbol);
|
|
53448
|
+
} else if (isTypeReferenceType(node)) {
|
|
53449
|
+
const aliasSymbol2 = resolveTypeReferenceName(node, 2097152 /* Alias */, true);
|
|
53450
|
+
if (aliasSymbol2 && aliasSymbol2 !== unknownSymbol) {
|
|
53451
|
+
const resolved = resolveAlias(aliasSymbol2);
|
|
53452
|
+
if (resolved && resolved.flags & 524288 /* TypeAlias */) {
|
|
53453
|
+
newAliasSymbol = resolved;
|
|
53454
|
+
aliasTypeArguments = typeArgumentsFromTypeReferenceNode(node);
|
|
53455
|
+
}
|
|
53456
|
+
}
|
|
53457
|
+
}
|
|
53458
|
+
return getTypeAliasInstantiation(symbol, typeArgumentsFromTypeReferenceNode(node), newAliasSymbol, aliasTypeArguments);
|
|
53441
53459
|
}
|
|
53442
53460
|
return checkNoTypeArguments(node, symbol) ? type : errorType;
|
|
53443
53461
|
}
|
|
@@ -56814,7 +56832,7 @@ ${lanes.join("\n")}
|
|
|
56814
56832
|
return compareSignaturesRelated(
|
|
56815
56833
|
source,
|
|
56816
56834
|
target,
|
|
56817
|
-
ignoreReturnTypes ? 4 /* IgnoreReturnTypes */ : 0
|
|
56835
|
+
ignoreReturnTypes ? 4 /* IgnoreReturnTypes */ : 0 /* None */,
|
|
56818
56836
|
false,
|
|
56819
56837
|
void 0,
|
|
56820
56838
|
void 0,
|
|
@@ -57048,7 +57066,9 @@ ${lanes.join("\n")}
|
|
|
57048
57066
|
if (relation === assignableRelation || relation === comparableRelation) {
|
|
57049
57067
|
if (s & 1 /* Any */)
|
|
57050
57068
|
return true;
|
|
57051
|
-
if (s &
|
|
57069
|
+
if (s & 8 /* Number */ && (t & 32 /* Enum */ || t & 256 /* NumberLiteral */ && t & 1024 /* EnumLiteral */))
|
|
57070
|
+
return true;
|
|
57071
|
+
if (s & 256 /* NumberLiteral */ && !(s & 1024 /* EnumLiteral */) && (t & 32 /* Enum */ || t & 256 /* NumberLiteral */ && t & 1024 /* EnumLiteral */ && source.value === target.value))
|
|
57052
57072
|
return true;
|
|
57053
57073
|
if (isUnknownLikeUnionType(target))
|
|
57054
57074
|
return true;
|
|
@@ -60111,7 +60131,7 @@ ${lanes.join("\n")}
|
|
|
60111
60131
|
pos = p;
|
|
60112
60132
|
}
|
|
60113
60133
|
}
|
|
60114
|
-
function inferTypes(inferences, originalSource, originalTarget, priority = 0
|
|
60134
|
+
function inferTypes(inferences, originalSource, originalTarget, priority = 0 /* None */, contravariant = false) {
|
|
60115
60135
|
let bivariant = false;
|
|
60116
60136
|
let propagationType;
|
|
60117
60137
|
let inferencePriority = 2048 /* MaxValue */;
|
|
@@ -62553,8 +62573,8 @@ ${lanes.join("\n")}
|
|
|
62553
62573
|
}
|
|
62554
62574
|
const parent2 = getRootDeclaration(symbol.valueDeclaration).parent;
|
|
62555
62575
|
const links = getNodeLinks(parent2);
|
|
62556
|
-
if (!(links.flags &
|
|
62557
|
-
links.flags |=
|
|
62576
|
+
if (!(links.flags & 524288 /* AssignmentsMarked */)) {
|
|
62577
|
+
links.flags |= 524288 /* AssignmentsMarked */;
|
|
62558
62578
|
if (!hasParentWithAssignmentsMarked(parent2)) {
|
|
62559
62579
|
markNodeAssignments(parent2);
|
|
62560
62580
|
}
|
|
@@ -62562,7 +62582,7 @@ ${lanes.join("\n")}
|
|
|
62562
62582
|
return symbol.isAssigned || false;
|
|
62563
62583
|
}
|
|
62564
62584
|
function hasParentWithAssignmentsMarked(node) {
|
|
62565
|
-
return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags &
|
|
62585
|
+
return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 524288 /* AssignmentsMarked */));
|
|
62566
62586
|
}
|
|
62567
62587
|
function markNodeAssignments(node) {
|
|
62568
62588
|
if (node.kind === 79 /* Identifier */) {
|
|
@@ -62641,11 +62661,11 @@ ${lanes.join("\n")}
|
|
|
62641
62661
|
const parent2 = declaration.parent.parent;
|
|
62642
62662
|
if (parent2.kind === 257 /* VariableDeclaration */ && getCombinedNodeFlags(declaration) & 2 /* Const */ || parent2.kind === 166 /* Parameter */) {
|
|
62643
62663
|
const links = getNodeLinks(parent2);
|
|
62644
|
-
if (!(links.flags &
|
|
62645
|
-
links.flags |=
|
|
62664
|
+
if (!(links.flags & 16777216 /* InCheckIdentifier */)) {
|
|
62665
|
+
links.flags |= 16777216 /* InCheckIdentifier */;
|
|
62646
62666
|
const parentType = getTypeForBindingElementParent(parent2, 0 /* Normal */);
|
|
62647
62667
|
const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
|
|
62648
|
-
links.flags &= ~
|
|
62668
|
+
links.flags &= ~16777216 /* InCheckIdentifier */;
|
|
62649
62669
|
if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(parent2.kind === 166 /* Parameter */ && isSymbolAssigned(symbol))) {
|
|
62650
62670
|
const pattern = declaration.parent;
|
|
62651
62671
|
const narrowedType = getFlowTypeOfReference(pattern, parentTypeConstraint, parentTypeConstraint, void 0, location2.flowNode);
|
|
@@ -62695,7 +62715,7 @@ ${lanes.join("\n")}
|
|
|
62695
62715
|
error(node, Diagnostics.The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method);
|
|
62696
62716
|
}
|
|
62697
62717
|
}
|
|
62698
|
-
getNodeLinks(container).flags |=
|
|
62718
|
+
getNodeLinks(container).flags |= 512 /* CaptureArguments */;
|
|
62699
62719
|
return getTypeOfSymbol(symbol);
|
|
62700
62720
|
}
|
|
62701
62721
|
if (shouldMarkIdentifierAliasReferenced(node)) {
|
|
@@ -62712,8 +62732,8 @@ ${lanes.join("\n")}
|
|
|
62712
62732
|
let container = getContainingClass(node);
|
|
62713
62733
|
while (container !== void 0) {
|
|
62714
62734
|
if (container === declaration && container.name !== node) {
|
|
62715
|
-
getNodeLinks(declaration).flags |=
|
|
62716
|
-
getNodeLinks(node).flags |=
|
|
62735
|
+
getNodeLinks(declaration).flags |= 1048576 /* ClassWithConstructorReference */;
|
|
62736
|
+
getNodeLinks(node).flags |= 2097152 /* ConstructorReferenceInClass */;
|
|
62717
62737
|
break;
|
|
62718
62738
|
}
|
|
62719
62739
|
container = getContainingClass(container);
|
|
@@ -62723,8 +62743,8 @@ ${lanes.join("\n")}
|
|
|
62723
62743
|
while (container.kind !== 308 /* SourceFile */) {
|
|
62724
62744
|
if (container.parent === declaration) {
|
|
62725
62745
|
if (isPropertyDeclaration(container) && isStatic(container) || isClassStaticBlockDeclaration(container)) {
|
|
62726
|
-
getNodeLinks(declaration).flags |=
|
|
62727
|
-
getNodeLinks(node).flags |=
|
|
62746
|
+
getNodeLinks(declaration).flags |= 1048576 /* ClassWithConstructorReference */;
|
|
62747
|
+
getNodeLinks(node).flags |= 2097152 /* ConstructorReferenceInClass */;
|
|
62728
62748
|
}
|
|
62729
62749
|
break;
|
|
62730
62750
|
}
|
|
@@ -62838,7 +62858,7 @@ ${lanes.join("\n")}
|
|
|
62838
62858
|
const part = getPartOfForStatementContainingNode(node.parent, container);
|
|
62839
62859
|
if (part) {
|
|
62840
62860
|
const links = getNodeLinks(part);
|
|
62841
|
-
links.flags |=
|
|
62861
|
+
links.flags |= 8192 /* ContainsCapturedBlockScopeBinding */;
|
|
62842
62862
|
const capturedBindings = links.capturedBlockScopeBindings || (links.capturedBlockScopeBindings = []);
|
|
62843
62863
|
pushIfUnique(capturedBindings, symbol);
|
|
62844
62864
|
if (part === container.initializer) {
|
|
@@ -62848,19 +62868,19 @@ ${lanes.join("\n")}
|
|
|
62848
62868
|
}
|
|
62849
62869
|
}
|
|
62850
62870
|
if (capturesBlockScopeBindingInLoopBody) {
|
|
62851
|
-
getNodeLinks(enclosingIterationStatement).flags |=
|
|
62871
|
+
getNodeLinks(enclosingIterationStatement).flags |= 4096 /* LoopWithCapturedBlockScopedBinding */;
|
|
62852
62872
|
}
|
|
62853
62873
|
}
|
|
62854
62874
|
if (isForStatement(container)) {
|
|
62855
62875
|
const varDeclList = getAncestor(symbol.valueDeclaration, 258 /* VariableDeclarationList */);
|
|
62856
62876
|
if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) {
|
|
62857
|
-
getNodeLinks(symbol.valueDeclaration).flags |=
|
|
62877
|
+
getNodeLinks(symbol.valueDeclaration).flags |= 262144 /* NeedsLoopOutParameter */;
|
|
62858
62878
|
}
|
|
62859
62879
|
}
|
|
62860
|
-
getNodeLinks(symbol.valueDeclaration).flags |=
|
|
62880
|
+
getNodeLinks(symbol.valueDeclaration).flags |= 32768 /* BlockScopedBindingInLoop */;
|
|
62861
62881
|
}
|
|
62862
62882
|
if (isCaptured) {
|
|
62863
|
-
getNodeLinks(symbol.valueDeclaration).flags |=
|
|
62883
|
+
getNodeLinks(symbol.valueDeclaration).flags |= 16384 /* CapturedBlockScopedBinding */;
|
|
62864
62884
|
}
|
|
62865
62885
|
}
|
|
62866
62886
|
function isBindingCapturedByNode(node, decl) {
|
|
@@ -63077,23 +63097,23 @@ ${lanes.join("\n")}
|
|
|
63077
63097
|
checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class);
|
|
63078
63098
|
}
|
|
63079
63099
|
if (isStatic(container) || isCallExpression2) {
|
|
63080
|
-
nodeCheckFlag =
|
|
63100
|
+
nodeCheckFlag = 32 /* SuperStatic */;
|
|
63081
63101
|
if (!isCallExpression2 && languageVersion >= 2 /* ES2015 */ && languageVersion <= 8 /* ES2021 */ && (isPropertyDeclaration(container) || isClassStaticBlockDeclaration(container))) {
|
|
63082
63102
|
forEachEnclosingBlockScopeContainer(node.parent, (current) => {
|
|
63083
63103
|
if (!isSourceFile(current) || isExternalOrCommonJsModule(current)) {
|
|
63084
|
-
getNodeLinks(current).flags |=
|
|
63104
|
+
getNodeLinks(current).flags |= 8388608 /* ContainsSuperPropertyInStaticInitializer */;
|
|
63085
63105
|
}
|
|
63086
63106
|
});
|
|
63087
63107
|
}
|
|
63088
63108
|
} else {
|
|
63089
|
-
nodeCheckFlag =
|
|
63109
|
+
nodeCheckFlag = 16 /* SuperInstance */;
|
|
63090
63110
|
}
|
|
63091
63111
|
getNodeLinks(node).flags |= nodeCheckFlag;
|
|
63092
63112
|
if (container.kind === 171 /* MethodDeclaration */ && inAsyncFunction) {
|
|
63093
63113
|
if (isSuperProperty(node.parent) && isAssignmentTarget(node.parent)) {
|
|
63094
|
-
getNodeLinks(container).flags |=
|
|
63114
|
+
getNodeLinks(container).flags |= 256 /* MethodWithSuperPropertyAssignmentInAsync */;
|
|
63095
63115
|
} else {
|
|
63096
|
-
getNodeLinks(container).flags |=
|
|
63116
|
+
getNodeLinks(container).flags |= 128 /* MethodWithSuperPropertyAccessInAsync */;
|
|
63097
63117
|
}
|
|
63098
63118
|
}
|
|
63099
63119
|
if (needToCaptureLexicalThis) {
|
|
@@ -63121,7 +63141,7 @@ ${lanes.join("\n")}
|
|
|
63121
63141
|
error(node, Diagnostics.super_cannot_be_referenced_in_constructor_arguments);
|
|
63122
63142
|
return errorType;
|
|
63123
63143
|
}
|
|
63124
|
-
return nodeCheckFlag ===
|
|
63144
|
+
return nodeCheckFlag === 32 /* SuperStatic */ ? getBaseConstructorTypeOfClass(classType) : getTypeWithThisArgument(baseClassType, classType.thisType);
|
|
63125
63145
|
function isLegalUsageOfSuperExpression(container2) {
|
|
63126
63146
|
if (!container2) {
|
|
63127
63147
|
return false;
|
|
@@ -64136,9 +64156,9 @@ ${lanes.join("\n")}
|
|
|
64136
64156
|
const container = getEnclosingBlockScopeContainer(node.parent.parent);
|
|
64137
64157
|
const enclosingIterationStatement = getEnclosingIterationStatement(container);
|
|
64138
64158
|
if (enclosingIterationStatement) {
|
|
64139
|
-
getNodeLinks(enclosingIterationStatement).flags |=
|
|
64140
|
-
getNodeLinks(node).flags |=
|
|
64141
|
-
getNodeLinks(node.parent.parent).flags |=
|
|
64159
|
+
getNodeLinks(enclosingIterationStatement).flags |= 4096 /* LoopWithCapturedBlockScopedBinding */;
|
|
64160
|
+
getNodeLinks(node).flags |= 32768 /* BlockScopedBindingInLoop */;
|
|
64161
|
+
getNodeLinks(node.parent.parent).flags |= 32768 /* BlockScopedBindingInLoop */;
|
|
64142
64162
|
}
|
|
64143
64163
|
}
|
|
64144
64164
|
if (links.resolvedType.flags & 98304 /* Nullable */ || !isTypeAssignableToKind(links.resolvedType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) && !isTypeAssignableTo(links.resolvedType, stringNumberSymbolType)) {
|
|
@@ -68125,10 +68145,10 @@ ${lanes.join("\n")}
|
|
|
68125
68145
|
}
|
|
68126
68146
|
function contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode) {
|
|
68127
68147
|
const links = getNodeLinks(node);
|
|
68128
|
-
if (!(links.flags &
|
|
68148
|
+
if (!(links.flags & 64 /* ContextChecked */)) {
|
|
68129
68149
|
const contextualSignature = getContextualSignature(node);
|
|
68130
|
-
if (!(links.flags &
|
|
68131
|
-
links.flags |=
|
|
68150
|
+
if (!(links.flags & 64 /* ContextChecked */)) {
|
|
68151
|
+
links.flags |= 64 /* ContextChecked */;
|
|
68132
68152
|
const signature = firstOrUndefined(getSignaturesOfType(getTypeOfSymbol(getSymbolOfNode(node)), 0 /* Call */));
|
|
68133
68153
|
if (!signature) {
|
|
68134
68154
|
return;
|
|
@@ -70118,13 +70138,13 @@ ${lanes.join("\n")}
|
|
|
70118
70138
|
function setNodeLinksForPrivateIdentifierScope(node) {
|
|
70119
70139
|
if (isPrivateIdentifier(node.name) && languageVersion < 99 /* ESNext */) {
|
|
70120
70140
|
for (let lexicalScope = getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = getEnclosingBlockScopeContainer(lexicalScope)) {
|
|
70121
|
-
getNodeLinks(lexicalScope).flags |=
|
|
70141
|
+
getNodeLinks(lexicalScope).flags |= 4194304 /* ContainsClassWithPrivateIdentifiers */;
|
|
70122
70142
|
}
|
|
70123
70143
|
if (isClassExpression(node.parent)) {
|
|
70124
70144
|
const enclosingIterationStatement = getEnclosingIterationStatement(node.parent);
|
|
70125
70145
|
if (enclosingIterationStatement) {
|
|
70126
|
-
getNodeLinks(node.name).flags |=
|
|
70127
|
-
getNodeLinks(enclosingIterationStatement).flags |=
|
|
70146
|
+
getNodeLinks(node.name).flags |= 32768 /* BlockScopedBindingInLoop */;
|
|
70147
|
+
getNodeLinks(enclosingIterationStatement).flags |= 4096 /* LoopWithCapturedBlockScopedBinding */;
|
|
70128
70148
|
}
|
|
70129
70149
|
}
|
|
70130
70150
|
}
|
|
@@ -71719,7 +71739,7 @@ ${lanes.join("\n")}
|
|
|
71719
71739
|
}
|
|
71720
71740
|
function checkWeakMapSetCollision(node) {
|
|
71721
71741
|
const enclosingBlockScope = getEnclosingBlockScopeContainer(node);
|
|
71722
|
-
if (getNodeCheckFlags(enclosingBlockScope) &
|
|
71742
|
+
if (getNodeCheckFlags(enclosingBlockScope) & 4194304 /* ContainsClassWithPrivateIdentifiers */) {
|
|
71723
71743
|
Debug.assert(isNamedDeclaration(node) && isIdentifier(node.name) && typeof node.name.escapedText === "string", "The target of a WeakMap/WeakSet collision check should be an identifier");
|
|
71724
71744
|
errorSkippedOn("noEmit", node, Diagnostics.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel, node.name.escapedText);
|
|
71725
71745
|
}
|
|
@@ -71733,18 +71753,18 @@ ${lanes.join("\n")}
|
|
|
71733
71753
|
let hasCollision = false;
|
|
71734
71754
|
if (isClassExpression(node)) {
|
|
71735
71755
|
for (const member of node.members) {
|
|
71736
|
-
if (getNodeCheckFlags(member) &
|
|
71756
|
+
if (getNodeCheckFlags(member) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
|
|
71737
71757
|
hasCollision = true;
|
|
71738
71758
|
break;
|
|
71739
71759
|
}
|
|
71740
71760
|
}
|
|
71741
71761
|
} else if (isFunctionExpression(node)) {
|
|
71742
|
-
if (getNodeCheckFlags(node) &
|
|
71762
|
+
if (getNodeCheckFlags(node) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
|
|
71743
71763
|
hasCollision = true;
|
|
71744
71764
|
}
|
|
71745
71765
|
} else {
|
|
71746
71766
|
const container = getEnclosingBlockScopeContainer(node);
|
|
71747
|
-
if (container && getNodeCheckFlags(container) &
|
|
71767
|
+
if (container && getNodeCheckFlags(container) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
|
|
71748
71768
|
hasCollision = true;
|
|
71749
71769
|
}
|
|
71750
71770
|
}
|
|
@@ -73629,8 +73649,8 @@ ${lanes.join("\n")}
|
|
|
73629
73649
|
}
|
|
73630
73650
|
function computeEnumMemberValues(node) {
|
|
73631
73651
|
const nodeLinks2 = getNodeLinks(node);
|
|
73632
|
-
if (!(nodeLinks2.flags &
|
|
73633
|
-
nodeLinks2.flags |=
|
|
73652
|
+
if (!(nodeLinks2.flags & 1024 /* EnumValuesComputed */)) {
|
|
73653
|
+
nodeLinks2.flags |= 1024 /* EnumValuesComputed */;
|
|
73634
73654
|
let autoValue = 0;
|
|
73635
73655
|
for (const member of node.members) {
|
|
73636
73656
|
const value = computeMemberValue(member, autoValue);
|
|
@@ -73906,7 +73926,7 @@ ${lanes.join("\n")}
|
|
|
73906
73926
|
}
|
|
73907
73927
|
const mergedClass = getDeclarationOfKind(symbol, 260 /* ClassDeclaration */);
|
|
73908
73928
|
if (mergedClass && inSameLexicalScope(node, mergedClass)) {
|
|
73909
|
-
getNodeLinks(node).flags |=
|
|
73929
|
+
getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */;
|
|
73910
73930
|
}
|
|
73911
73931
|
}
|
|
73912
73932
|
if (isAmbientExternalModule) {
|
|
@@ -75537,8 +75557,8 @@ ${lanes.join("\n")}
|
|
|
75537
75557
|
const nodeLinks2 = getNodeLinks(symbol.valueDeclaration);
|
|
75538
75558
|
if (resolveName(container.parent, symbol.escapedName, 111551 /* Value */, void 0, void 0, false)) {
|
|
75539
75559
|
links.isDeclarationWithCollidingName = true;
|
|
75540
|
-
} else if (nodeLinks2.flags &
|
|
75541
|
-
const isDeclaredInLoop = nodeLinks2.flags &
|
|
75560
|
+
} else if (nodeLinks2.flags & 16384 /* CapturedBlockScopedBinding */) {
|
|
75561
|
+
const isDeclaredInLoop = nodeLinks2.flags & 32768 /* BlockScopedBindingInLoop */;
|
|
75542
75562
|
const inLoopInitializer = isIterationStatement(container, false);
|
|
75543
75563
|
const inLoopBodyBlock = container.kind === 238 /* Block */ && isIterationStatement(container.parent, false);
|
|
75544
75564
|
links.isDeclarationWithCollidingName = !isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || !inLoopInitializer && !inLoopBodyBlock);
|
|
@@ -82678,12 +82698,12 @@ ${lanes.join("\n")}
|
|
|
82678
82698
|
function visitClassExpressionInNewClassLexicalEnvironment(node, facts) {
|
|
82679
82699
|
const isDecoratedClassDeclaration = !!(facts & 1 /* ClassWasDecorated */);
|
|
82680
82700
|
const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node);
|
|
82681
|
-
const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) &
|
|
82701
|
+
const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */;
|
|
82682
82702
|
let temp;
|
|
82683
82703
|
function createClassTempVar() {
|
|
82684
82704
|
const classCheckFlags = resolver.getNodeCheckFlags(node);
|
|
82685
|
-
const isClassWithConstructorReference2 = classCheckFlags &
|
|
82686
|
-
const requiresBlockScopedVar = classCheckFlags &
|
|
82705
|
+
const isClassWithConstructorReference2 = classCheckFlags & 1048576 /* ClassWithConstructorReference */;
|
|
82706
|
+
const requiresBlockScopedVar = classCheckFlags & 32768 /* BlockScopedBindingInLoop */;
|
|
82687
82707
|
return factory2.createTempVariable(requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, !!isClassWithConstructorReference2);
|
|
82688
82708
|
}
|
|
82689
82709
|
if (facts & 2 /* NeedsClassConstructorReference */) {
|
|
@@ -83196,7 +83216,7 @@ ${lanes.join("\n")}
|
|
|
83196
83216
|
}
|
|
83197
83217
|
function trySubstituteClassAlias(node) {
|
|
83198
83218
|
if (enabledSubstitutions & 1 /* ClassAliases */) {
|
|
83199
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
83219
|
+
if (resolver.getNodeCheckFlags(node) & 2097152 /* ConstructorReferenceInClass */) {
|
|
83200
83220
|
const declaration = resolver.getReferencedValueDeclaration(node);
|
|
83201
83221
|
if (declaration) {
|
|
83202
83222
|
const classAlias = classAliases[declaration.id];
|
|
@@ -83219,7 +83239,7 @@ ${lanes.join("\n")}
|
|
|
83219
83239
|
const alreadyTransformed = isAssignmentExpression(innerExpression) && isGeneratedIdentifier(innerExpression.left);
|
|
83220
83240
|
if (!alreadyTransformed && !inlinable && shouldHoist) {
|
|
83221
83241
|
const generatedName = factory2.getGeneratedNameForNode(name);
|
|
83222
|
-
if (resolver.getNodeCheckFlags(name) &
|
|
83242
|
+
if (resolver.getNodeCheckFlags(name) & 32768 /* BlockScopedBindingInLoop */) {
|
|
83223
83243
|
addBlockScopedVariable(generatedName);
|
|
83224
83244
|
} else {
|
|
83225
83245
|
hoistVariableDeclaration(generatedName);
|
|
@@ -83368,7 +83388,7 @@ ${lanes.join("\n")}
|
|
|
83368
83388
|
const { className } = getPrivateIdentifierEnvironment();
|
|
83369
83389
|
const prefix = className ? { prefix: "_", node: className, suffix: "_" } : "_";
|
|
83370
83390
|
const identifier = typeof name === "object" ? factory2.getGeneratedNameForNode(name, 16 /* Optimistic */ | 8 /* ReservedInNestedScopes */, prefix, suffix) : typeof name === "string" ? factory2.createUniqueName(name, 16 /* Optimistic */, prefix, suffix) : factory2.createTempVariable(void 0, true, prefix, suffix);
|
|
83371
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
83391
|
+
if (resolver.getNodeCheckFlags(node) & 32768 /* BlockScopedBindingInLoop */) {
|
|
83372
83392
|
addBlockScopedVariable(identifier);
|
|
83373
83393
|
} else {
|
|
83374
83394
|
hoistVariableDeclaration(identifier);
|
|
@@ -84233,7 +84253,7 @@ ${lanes.join("\n")}
|
|
|
84233
84253
|
}
|
|
84234
84254
|
}
|
|
84235
84255
|
function getClassAliasIfNeeded(node) {
|
|
84236
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
84256
|
+
if (resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */) {
|
|
84237
84257
|
enableSubstitutionForClassAliases();
|
|
84238
84258
|
const classAlias = factory2.createUniqueName(node.name && !isGeneratedIdentifier(node.name) ? idText(node.name) : "default");
|
|
84239
84259
|
classAliases[getOriginalNodeId(node)] = classAlias;
|
|
@@ -84267,7 +84287,7 @@ ${lanes.join("\n")}
|
|
|
84267
84287
|
}
|
|
84268
84288
|
function trySubstituteClassAlias(node) {
|
|
84269
84289
|
if (classAliases) {
|
|
84270
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
84290
|
+
if (resolver.getNodeCheckFlags(node) & 2097152 /* ConstructorReferenceInClass */) {
|
|
84271
84291
|
const declaration = resolver.getReferencedValueDeclaration(node);
|
|
84272
84292
|
if (declaration) {
|
|
84273
84293
|
const classAlias = classAliases[declaration.id];
|
|
@@ -84302,7 +84322,7 @@ ${lanes.join("\n")}
|
|
|
84302
84322
|
let capturedSuperProperties;
|
|
84303
84323
|
let hasSuperElementAccess;
|
|
84304
84324
|
const substitutedSuperAccessors = [];
|
|
84305
|
-
let contextFlags = 0
|
|
84325
|
+
let contextFlags = 0 /* None */;
|
|
84306
84326
|
const previousOnEmitNode = context.onEmitNode;
|
|
84307
84327
|
const previousOnSubstituteNode = context.onSubstituteNode;
|
|
84308
84328
|
context.onEmitNode = onEmitNode;
|
|
@@ -84629,7 +84649,7 @@ ${lanes.join("\n")}
|
|
|
84629
84649
|
hasSuperElementAccess = false;
|
|
84630
84650
|
let updated = visitFunctionBody(node.body, visitor, context);
|
|
84631
84651
|
const originalMethod = getOriginalNode(node, isFunctionLikeDeclaration);
|
|
84632
|
-
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (
|
|
84652
|
+
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (256 /* MethodWithSuperPropertyAssignmentInAsync */ | 128 /* MethodWithSuperPropertyAccessInAsync */) && (getFunctionFlags(originalMethod) & 3 /* AsyncGenerator */) !== 3 /* AsyncGenerator */;
|
|
84633
84653
|
if (emitSuperHelpers) {
|
|
84634
84654
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
84635
84655
|
if (capturedSuperProperties.size) {
|
|
@@ -84640,9 +84660,9 @@ ${lanes.join("\n")}
|
|
|
84640
84660
|
updated = factory2.updateBlock(updated, statements);
|
|
84641
84661
|
}
|
|
84642
84662
|
if (hasSuperElementAccess) {
|
|
84643
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
84663
|
+
if (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
84644
84664
|
addEmitHelper(updated, advancedAsyncSuperHelper);
|
|
84645
|
-
} else if (resolver.getNodeCheckFlags(node) &
|
|
84665
|
+
} else if (resolver.getNodeCheckFlags(node) & 128 /* MethodWithSuperPropertyAccessInAsync */) {
|
|
84646
84666
|
addEmitHelper(updated, asyncSuperHelper);
|
|
84647
84667
|
}
|
|
84648
84668
|
}
|
|
@@ -84657,7 +84677,7 @@ ${lanes.join("\n")}
|
|
|
84657
84677
|
const nodeType = original.type;
|
|
84658
84678
|
const promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : void 0;
|
|
84659
84679
|
const isArrowFunction2 = node.kind === 216 /* ArrowFunction */;
|
|
84660
|
-
const hasLexicalArguments = (resolver.getNodeCheckFlags(node) &
|
|
84680
|
+
const hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 512 /* CaptureArguments */) !== 0;
|
|
84661
84681
|
const savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames;
|
|
84662
84682
|
enclosingFunctionParameterNames = /* @__PURE__ */ new Set();
|
|
84663
84683
|
for (const parameter of node.parameters) {
|
|
@@ -84684,7 +84704,7 @@ ${lanes.join("\n")}
|
|
|
84684
84704
|
)
|
|
84685
84705
|
);
|
|
84686
84706
|
insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
|
|
84687
|
-
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (
|
|
84707
|
+
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (256 /* MethodWithSuperPropertyAssignmentInAsync */ | 128 /* MethodWithSuperPropertyAccessInAsync */);
|
|
84688
84708
|
if (emitSuperHelpers) {
|
|
84689
84709
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
84690
84710
|
if (capturedSuperProperties.size) {
|
|
@@ -84696,9 +84716,9 @@ ${lanes.join("\n")}
|
|
|
84696
84716
|
const block = factory2.createBlock(statements, true);
|
|
84697
84717
|
setTextRange(block, node.body);
|
|
84698
84718
|
if (emitSuperHelpers && hasSuperElementAccess) {
|
|
84699
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
84719
|
+
if (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
84700
84720
|
addEmitHelper(block, advancedAsyncSuperHelper);
|
|
84701
|
-
} else if (resolver.getNodeCheckFlags(node) &
|
|
84721
|
+
} else if (resolver.getNodeCheckFlags(node) & 128 /* MethodWithSuperPropertyAccessInAsync */) {
|
|
84702
84722
|
addEmitHelper(block, asyncSuperHelper);
|
|
84703
84723
|
}
|
|
84704
84724
|
}
|
|
@@ -84758,7 +84778,7 @@ ${lanes.join("\n")}
|
|
|
84758
84778
|
}
|
|
84759
84779
|
function onEmitNode(hint, node, emitCallback) {
|
|
84760
84780
|
if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) {
|
|
84761
|
-
const superContainerFlags = resolver.getNodeCheckFlags(node) & (
|
|
84781
|
+
const superContainerFlags = resolver.getNodeCheckFlags(node) & (128 /* MethodWithSuperPropertyAccessInAsync */ | 256 /* MethodWithSuperPropertyAssignmentInAsync */);
|
|
84762
84782
|
if (superContainerFlags !== enclosingSuperContainerFlags) {
|
|
84763
84783
|
const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
|
|
84764
84784
|
enclosingSuperContainerFlags = superContainerFlags;
|
|
@@ -84834,7 +84854,7 @@ ${lanes.join("\n")}
|
|
|
84834
84854
|
return kind === 260 /* ClassDeclaration */ || kind === 173 /* Constructor */ || kind === 171 /* MethodDeclaration */ || kind === 174 /* GetAccessor */ || kind === 175 /* SetAccessor */;
|
|
84835
84855
|
}
|
|
84836
84856
|
function createSuperElementAccessInAsyncMethod(argumentExpression, location2) {
|
|
84837
|
-
if (enclosingSuperContainerFlags &
|
|
84857
|
+
if (enclosingSuperContainerFlags & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
84838
84858
|
return setTextRange(
|
|
84839
84859
|
factory2.createPropertyAccessExpression(
|
|
84840
84860
|
factory2.createCallExpression(
|
|
@@ -84859,7 +84879,7 @@ ${lanes.join("\n")}
|
|
|
84859
84879
|
}
|
|
84860
84880
|
}
|
|
84861
84881
|
function createSuperAccessVariableStatement(factory2, resolver, node, names) {
|
|
84862
|
-
const hasBinding = (resolver.getNodeCheckFlags(node) &
|
|
84882
|
+
const hasBinding = (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) !== 0;
|
|
84863
84883
|
const accessors = [];
|
|
84864
84884
|
names.forEach((_, key) => {
|
|
84865
84885
|
const name = unescapeLeadingUnderscores(key);
|
|
@@ -85797,7 +85817,7 @@ ${lanes.join("\n")}
|
|
|
85797
85817
|
!!(hierarchyFacts & 1 /* HasLexicalThis */)
|
|
85798
85818
|
)
|
|
85799
85819
|
);
|
|
85800
|
-
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (
|
|
85820
|
+
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (256 /* MethodWithSuperPropertyAssignmentInAsync */ | 128 /* MethodWithSuperPropertyAccessInAsync */);
|
|
85801
85821
|
if (emitSuperHelpers) {
|
|
85802
85822
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
85803
85823
|
const variableStatement = createSuperAccessVariableStatement(factory2, resolver, node, capturedSuperProperties);
|
|
@@ -85808,9 +85828,9 @@ ${lanes.join("\n")}
|
|
|
85808
85828
|
insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
|
|
85809
85829
|
const block = factory2.updateBlock(node.body, statements);
|
|
85810
85830
|
if (emitSuperHelpers && hasSuperElementAccess) {
|
|
85811
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
85831
|
+
if (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
85812
85832
|
addEmitHelper(block, advancedAsyncSuperHelper);
|
|
85813
|
-
} else if (resolver.getNodeCheckFlags(node) &
|
|
85833
|
+
} else if (resolver.getNodeCheckFlags(node) & 128 /* MethodWithSuperPropertyAccessInAsync */) {
|
|
85814
85834
|
addEmitHelper(block, asyncSuperHelper);
|
|
85815
85835
|
}
|
|
85816
85836
|
}
|
|
@@ -85920,7 +85940,7 @@ ${lanes.join("\n")}
|
|
|
85920
85940
|
}
|
|
85921
85941
|
function onEmitNode(hint, node, emitCallback) {
|
|
85922
85942
|
if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) {
|
|
85923
|
-
const superContainerFlags = resolver.getNodeCheckFlags(node) & (
|
|
85943
|
+
const superContainerFlags = resolver.getNodeCheckFlags(node) & (128 /* MethodWithSuperPropertyAccessInAsync */ | 256 /* MethodWithSuperPropertyAssignmentInAsync */);
|
|
85924
85944
|
if (superContainerFlags !== enclosingSuperContainerFlags) {
|
|
85925
85945
|
const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
|
|
85926
85946
|
enclosingSuperContainerFlags = superContainerFlags;
|
|
@@ -85996,7 +86016,7 @@ ${lanes.join("\n")}
|
|
|
85996
86016
|
return kind === 260 /* ClassDeclaration */ || kind === 173 /* Constructor */ || kind === 171 /* MethodDeclaration */ || kind === 174 /* GetAccessor */ || kind === 175 /* SetAccessor */;
|
|
85997
86017
|
}
|
|
85998
86018
|
function createSuperElementAccessInAsyncMethod(argumentExpression, location2) {
|
|
85999
|
-
if (enclosingSuperContainerFlags &
|
|
86019
|
+
if (enclosingSuperContainerFlags & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
86000
86020
|
return setTextRange(
|
|
86001
86021
|
factory2.createPropertyAccessExpression(
|
|
86002
86022
|
factory2.createCallExpression(
|
|
@@ -88352,8 +88372,8 @@ ${lanes.join("\n")}
|
|
|
88352
88372
|
}
|
|
88353
88373
|
function shouldEmitExplicitInitializerForLetDeclaration(node) {
|
|
88354
88374
|
const flags = resolver.getNodeCheckFlags(node);
|
|
88355
|
-
const isCapturedInFunction = flags &
|
|
88356
|
-
const isDeclaredInLoop = flags &
|
|
88375
|
+
const isCapturedInFunction = flags & 16384 /* CapturedBlockScopedBinding */;
|
|
88376
|
+
const isDeclaredInLoop = flags & 32768 /* BlockScopedBindingInLoop */;
|
|
88357
88377
|
const emittedAsTopLevel = (hierarchyFacts & 64 /* TopLevel */) !== 0 || isCapturedInFunction && isDeclaredInLoop && (hierarchyFacts & 512 /* IterationStatementBlock */) !== 0;
|
|
88358
88378
|
const emitExplicitInitializer = !emittedAsTopLevel && (hierarchyFacts & 4096 /* ForInOrForOfStatement */) === 0 && (!resolver.isDeclarationWithCollidingName(node) || isDeclaredInLoop && !isCapturedInFunction && (hierarchyFacts & (2048 /* ForStatement */ | 4096 /* ForInOrForOfStatement */)) === 0);
|
|
88359
88379
|
return emitExplicitInitializer;
|
|
@@ -88714,7 +88734,7 @@ ${lanes.join("\n")}
|
|
|
88714
88734
|
return factory2.inlineExpressions(expressions);
|
|
88715
88735
|
}
|
|
88716
88736
|
function shouldConvertPartOfIterationStatement(node) {
|
|
88717
|
-
return (resolver.getNodeCheckFlags(node) &
|
|
88737
|
+
return (resolver.getNodeCheckFlags(node) & 8192 /* ContainsCapturedBlockScopeBinding */) !== 0;
|
|
88718
88738
|
}
|
|
88719
88739
|
function shouldConvertInitializerOfForStatement(node) {
|
|
88720
88740
|
return isForStatement(node) && !!node.initializer && shouldConvertPartOfIterationStatement(node.initializer);
|
|
@@ -88729,7 +88749,7 @@ ${lanes.join("\n")}
|
|
|
88729
88749
|
return shouldConvertBodyOfIterationStatement(node) || shouldConvertInitializerOfForStatement(node);
|
|
88730
88750
|
}
|
|
88731
88751
|
function shouldConvertBodyOfIterationStatement(node) {
|
|
88732
|
-
return (resolver.getNodeCheckFlags(node) &
|
|
88752
|
+
return (resolver.getNodeCheckFlags(node) & 4096 /* LoopWithCapturedBlockScopedBinding */) !== 0;
|
|
88733
88753
|
}
|
|
88734
88754
|
function hoistVariableDeclarationDeclaredInConvertedLoop(state, node) {
|
|
88735
88755
|
if (!state.hoistedLocalVariables) {
|
|
@@ -89190,10 +89210,10 @@ ${lanes.join("\n")}
|
|
|
89190
89210
|
} else {
|
|
89191
89211
|
loopParameters.push(factory2.createParameterDeclaration(void 0, void 0, name));
|
|
89192
89212
|
const checkFlags = resolver.getNodeCheckFlags(decl);
|
|
89193
|
-
if (checkFlags &
|
|
89213
|
+
if (checkFlags & 262144 /* NeedsLoopOutParameter */ || hasCapturedBindingsInForHead) {
|
|
89194
89214
|
const outParamName = factory2.createUniqueName("out_" + idText(name));
|
|
89195
|
-
let flags = 0
|
|
89196
|
-
if (checkFlags &
|
|
89215
|
+
let flags = 0 /* None */;
|
|
89216
|
+
if (checkFlags & 262144 /* NeedsLoopOutParameter */) {
|
|
89197
89217
|
flags |= 1 /* Body */;
|
|
89198
89218
|
}
|
|
89199
89219
|
if (isForStatement(container)) {
|
|
@@ -148071,6 +148091,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
148071
148091
|
// src/services/formatting/rule.ts
|
|
148072
148092
|
var anyContext = emptyArray;
|
|
148073
148093
|
var RuleAction = /* @__PURE__ */ ((RuleAction2) => {
|
|
148094
|
+
RuleAction2[RuleAction2["None"] = 0] = "None";
|
|
148074
148095
|
RuleAction2[RuleAction2["StopProcessingSpaceActions"] = 1] = "StopProcessingSpaceActions";
|
|
148075
148096
|
RuleAction2[RuleAction2["StopProcessingTokenActions"] = 2] = "StopProcessingTokenActions";
|
|
148076
148097
|
RuleAction2[RuleAction2["InsertSpace"] = 4] = "InsertSpace";
|
|
@@ -148718,7 +148739,7 @@ ${options.prefix}` : "\n" : options.prefix
|
|
|
148718
148739
|
return rulesMapCache;
|
|
148719
148740
|
}
|
|
148720
148741
|
function getRuleActionExclusion(ruleAction) {
|
|
148721
|
-
let mask2 = 0
|
|
148742
|
+
let mask2 = 0 /* None */;
|
|
148722
148743
|
if (ruleAction & 1 /* StopProcessingSpaceActions */) {
|
|
148723
148744
|
mask2 |= 28 /* ModifySpaceAction */;
|
|
148724
148745
|
}
|