typescript 5.0.0-dev.20221116 → 5.0.0-dev.20221117
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 +83 -79
- package/lib/tsserver.js +109 -101
- package/lib/tsserverlibrary.d.ts +2 -0
- package/lib/tsserverlibrary.js +109 -101
- package/lib/typescript.d.ts +2 -0
- package/lib/typescript.js +109 -101
- package/lib/typingsInstaller.js +3 -1
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -23,7 +23,7 @@ var __export = (target, all) => {
|
|
|
23
23
|
|
|
24
24
|
// src/compiler/corePublic.ts
|
|
25
25
|
var versionMajorMinor = "5.0";
|
|
26
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
26
|
+
var version = `${versionMajorMinor}.0-dev.20221117`;
|
|
27
27
|
|
|
28
28
|
// src/compiler/core.ts
|
|
29
29
|
var emptyArray = [];
|
|
@@ -3660,6 +3660,7 @@ var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
|
3660
3660
|
return TypeFlags2;
|
|
3661
3661
|
})(TypeFlags || {});
|
|
3662
3662
|
var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
|
3663
|
+
ObjectFlags3[ObjectFlags3["None"] = 0] = "None";
|
|
3663
3664
|
ObjectFlags3[ObjectFlags3["Class"] = 1] = "Class";
|
|
3664
3665
|
ObjectFlags3[ObjectFlags3["Interface"] = 2] = "Interface";
|
|
3665
3666
|
ObjectFlags3[ObjectFlags3["Reference"] = 4] = "Reference";
|
|
@@ -38060,6 +38061,7 @@ var CheckMode = /* @__PURE__ */ ((CheckMode3) => {
|
|
|
38060
38061
|
return CheckMode3;
|
|
38061
38062
|
})(CheckMode || {});
|
|
38062
38063
|
var SignatureCheckMode = /* @__PURE__ */ ((SignatureCheckMode3) => {
|
|
38064
|
+
SignatureCheckMode3[SignatureCheckMode3["None"] = 0] = "None";
|
|
38063
38065
|
SignatureCheckMode3[SignatureCheckMode3["BivariantCallback"] = 1] = "BivariantCallback";
|
|
38064
38066
|
SignatureCheckMode3[SignatureCheckMode3["StrictCallback"] = 2] = "StrictCallback";
|
|
38065
38067
|
SignatureCheckMode3[SignatureCheckMode3["IgnoreReturnTypes"] = 4] = "IgnoreReturnTypes";
|
|
@@ -38077,7 +38079,7 @@ var intrinsicTypeKinds = new Map(getEntries({
|
|
|
38077
38079
|
function SymbolLinks() {
|
|
38078
38080
|
}
|
|
38079
38081
|
function NodeLinks() {
|
|
38080
|
-
this.flags = 0
|
|
38082
|
+
this.flags = 0 /* None */;
|
|
38081
38083
|
}
|
|
38082
38084
|
function getNodeId(node) {
|
|
38083
38085
|
if (!node.id) {
|
|
@@ -38922,7 +38924,7 @@ function createTypeChecker(host) {
|
|
|
38922
38924
|
function createSymbol(flags, name, checkFlags) {
|
|
38923
38925
|
symbolCount++;
|
|
38924
38926
|
const symbol = new Symbol12(flags | 33554432 /* Transient */, name);
|
|
38925
|
-
symbol.checkFlags = checkFlags || 0
|
|
38927
|
+
symbol.checkFlags = checkFlags || 0 /* None */;
|
|
38926
38928
|
return symbol;
|
|
38927
38929
|
}
|
|
38928
38930
|
function getExcludedSymbolFlags(flags) {
|
|
@@ -41233,7 +41235,7 @@ function createTypeChecker(host) {
|
|
|
41233
41235
|
function createOriginType(flags) {
|
|
41234
41236
|
return new Type7(checker, flags);
|
|
41235
41237
|
}
|
|
41236
|
-
function createIntrinsicType(kind, intrinsicName, objectFlags = 0) {
|
|
41238
|
+
function createIntrinsicType(kind, intrinsicName, objectFlags = 0 /* None */) {
|
|
41237
41239
|
const type = createType(kind);
|
|
41238
41240
|
type.intrinsicName = intrinsicName;
|
|
41239
41241
|
type.objectFlags = objectFlags;
|
|
@@ -48074,7 +48076,7 @@ function createTypeChecker(host) {
|
|
|
48074
48076
|
function containsArgumentsReference(declaration) {
|
|
48075
48077
|
const links = getNodeLinks(declaration);
|
|
48076
48078
|
if (links.containsArgumentsReference === void 0) {
|
|
48077
|
-
if (links.flags &
|
|
48079
|
+
if (links.flags & 512 /* CaptureArguments */) {
|
|
48078
48080
|
links.containsArgumentsReference = true;
|
|
48079
48081
|
} else {
|
|
48080
48082
|
links.containsArgumentsReference = traverse(declaration.body);
|
|
@@ -51974,7 +51976,7 @@ function createTypeChecker(host) {
|
|
|
51974
51976
|
return compareSignaturesRelated(
|
|
51975
51977
|
source,
|
|
51976
51978
|
target,
|
|
51977
|
-
ignoreReturnTypes ? 4 /* IgnoreReturnTypes */ : 0
|
|
51979
|
+
ignoreReturnTypes ? 4 /* IgnoreReturnTypes */ : 0 /* None */,
|
|
51978
51980
|
false,
|
|
51979
51981
|
void 0,
|
|
51980
51982
|
void 0,
|
|
@@ -52208,7 +52210,9 @@ function createTypeChecker(host) {
|
|
|
52208
52210
|
if (relation === assignableRelation || relation === comparableRelation) {
|
|
52209
52211
|
if (s & 1 /* Any */)
|
|
52210
52212
|
return true;
|
|
52211
|
-
if (s &
|
|
52213
|
+
if (s & 8 /* Number */ && (t & 32 /* Enum */ || t & 256 /* NumberLiteral */ && t & 1024 /* EnumLiteral */))
|
|
52214
|
+
return true;
|
|
52215
|
+
if (s & 256 /* NumberLiteral */ && !(s & 1024 /* EnumLiteral */) && (t & 32 /* Enum */ || t & 256 /* NumberLiteral */ && t & 1024 /* EnumLiteral */ && source.value === target.value))
|
|
52212
52216
|
return true;
|
|
52213
52217
|
if (isUnknownLikeUnionType(target))
|
|
52214
52218
|
return true;
|
|
@@ -55271,7 +55275,7 @@ function createTypeChecker(host) {
|
|
|
55271
55275
|
pos = p;
|
|
55272
55276
|
}
|
|
55273
55277
|
}
|
|
55274
|
-
function inferTypes(inferences, originalSource, originalTarget, priority = 0
|
|
55278
|
+
function inferTypes(inferences, originalSource, originalTarget, priority = 0 /* None */, contravariant = false) {
|
|
55275
55279
|
let bivariant = false;
|
|
55276
55280
|
let propagationType;
|
|
55277
55281
|
let inferencePriority = 2048 /* MaxValue */;
|
|
@@ -57713,8 +57717,8 @@ function createTypeChecker(host) {
|
|
|
57713
57717
|
}
|
|
57714
57718
|
const parent = getRootDeclaration(symbol.valueDeclaration).parent;
|
|
57715
57719
|
const links = getNodeLinks(parent);
|
|
57716
|
-
if (!(links.flags &
|
|
57717
|
-
links.flags |=
|
|
57720
|
+
if (!(links.flags & 524288 /* AssignmentsMarked */)) {
|
|
57721
|
+
links.flags |= 524288 /* AssignmentsMarked */;
|
|
57718
57722
|
if (!hasParentWithAssignmentsMarked(parent)) {
|
|
57719
57723
|
markNodeAssignments(parent);
|
|
57720
57724
|
}
|
|
@@ -57722,7 +57726,7 @@ function createTypeChecker(host) {
|
|
|
57722
57726
|
return symbol.isAssigned || false;
|
|
57723
57727
|
}
|
|
57724
57728
|
function hasParentWithAssignmentsMarked(node) {
|
|
57725
|
-
return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags &
|
|
57729
|
+
return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 524288 /* AssignmentsMarked */));
|
|
57726
57730
|
}
|
|
57727
57731
|
function markNodeAssignments(node) {
|
|
57728
57732
|
if (node.kind === 79 /* Identifier */) {
|
|
@@ -57801,11 +57805,11 @@ function createTypeChecker(host) {
|
|
|
57801
57805
|
const parent = declaration.parent.parent;
|
|
57802
57806
|
if (parent.kind === 257 /* VariableDeclaration */ && getCombinedNodeFlags(declaration) & 2 /* Const */ || parent.kind === 166 /* Parameter */) {
|
|
57803
57807
|
const links = getNodeLinks(parent);
|
|
57804
|
-
if (!(links.flags &
|
|
57805
|
-
links.flags |=
|
|
57808
|
+
if (!(links.flags & 16777216 /* InCheckIdentifier */)) {
|
|
57809
|
+
links.flags |= 16777216 /* InCheckIdentifier */;
|
|
57806
57810
|
const parentType = getTypeForBindingElementParent(parent, 0 /* Normal */);
|
|
57807
57811
|
const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
|
|
57808
|
-
links.flags &= ~
|
|
57812
|
+
links.flags &= ~16777216 /* InCheckIdentifier */;
|
|
57809
57813
|
if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(parent.kind === 166 /* Parameter */ && isSymbolAssigned(symbol))) {
|
|
57810
57814
|
const pattern = declaration.parent;
|
|
57811
57815
|
const narrowedType = getFlowTypeOfReference(pattern, parentTypeConstraint, parentTypeConstraint, void 0, location.flowNode);
|
|
@@ -57855,7 +57859,7 @@ function createTypeChecker(host) {
|
|
|
57855
57859
|
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);
|
|
57856
57860
|
}
|
|
57857
57861
|
}
|
|
57858
|
-
getNodeLinks(container).flags |=
|
|
57862
|
+
getNodeLinks(container).flags |= 512 /* CaptureArguments */;
|
|
57859
57863
|
return getTypeOfSymbol(symbol);
|
|
57860
57864
|
}
|
|
57861
57865
|
if (shouldMarkIdentifierAliasReferenced(node)) {
|
|
@@ -57872,8 +57876,8 @@ function createTypeChecker(host) {
|
|
|
57872
57876
|
let container = getContainingClass(node);
|
|
57873
57877
|
while (container !== void 0) {
|
|
57874
57878
|
if (container === declaration && container.name !== node) {
|
|
57875
|
-
getNodeLinks(declaration).flags |=
|
|
57876
|
-
getNodeLinks(node).flags |=
|
|
57879
|
+
getNodeLinks(declaration).flags |= 1048576 /* ClassWithConstructorReference */;
|
|
57880
|
+
getNodeLinks(node).flags |= 2097152 /* ConstructorReferenceInClass */;
|
|
57877
57881
|
break;
|
|
57878
57882
|
}
|
|
57879
57883
|
container = getContainingClass(container);
|
|
@@ -57883,8 +57887,8 @@ function createTypeChecker(host) {
|
|
|
57883
57887
|
while (container.kind !== 308 /* SourceFile */) {
|
|
57884
57888
|
if (container.parent === declaration) {
|
|
57885
57889
|
if (isPropertyDeclaration(container) && isStatic(container) || isClassStaticBlockDeclaration(container)) {
|
|
57886
|
-
getNodeLinks(declaration).flags |=
|
|
57887
|
-
getNodeLinks(node).flags |=
|
|
57890
|
+
getNodeLinks(declaration).flags |= 1048576 /* ClassWithConstructorReference */;
|
|
57891
|
+
getNodeLinks(node).flags |= 2097152 /* ConstructorReferenceInClass */;
|
|
57888
57892
|
}
|
|
57889
57893
|
break;
|
|
57890
57894
|
}
|
|
@@ -57998,7 +58002,7 @@ function createTypeChecker(host) {
|
|
|
57998
58002
|
const part = getPartOfForStatementContainingNode(node.parent, container);
|
|
57999
58003
|
if (part) {
|
|
58000
58004
|
const links = getNodeLinks(part);
|
|
58001
|
-
links.flags |=
|
|
58005
|
+
links.flags |= 8192 /* ContainsCapturedBlockScopeBinding */;
|
|
58002
58006
|
const capturedBindings = links.capturedBlockScopeBindings || (links.capturedBlockScopeBindings = []);
|
|
58003
58007
|
pushIfUnique(capturedBindings, symbol);
|
|
58004
58008
|
if (part === container.initializer) {
|
|
@@ -58008,19 +58012,19 @@ function createTypeChecker(host) {
|
|
|
58008
58012
|
}
|
|
58009
58013
|
}
|
|
58010
58014
|
if (capturesBlockScopeBindingInLoopBody) {
|
|
58011
|
-
getNodeLinks(enclosingIterationStatement).flags |=
|
|
58015
|
+
getNodeLinks(enclosingIterationStatement).flags |= 4096 /* LoopWithCapturedBlockScopedBinding */;
|
|
58012
58016
|
}
|
|
58013
58017
|
}
|
|
58014
58018
|
if (isForStatement(container)) {
|
|
58015
58019
|
const varDeclList = getAncestor(symbol.valueDeclaration, 258 /* VariableDeclarationList */);
|
|
58016
58020
|
if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) {
|
|
58017
|
-
getNodeLinks(symbol.valueDeclaration).flags |=
|
|
58021
|
+
getNodeLinks(symbol.valueDeclaration).flags |= 262144 /* NeedsLoopOutParameter */;
|
|
58018
58022
|
}
|
|
58019
58023
|
}
|
|
58020
|
-
getNodeLinks(symbol.valueDeclaration).flags |=
|
|
58024
|
+
getNodeLinks(symbol.valueDeclaration).flags |= 32768 /* BlockScopedBindingInLoop */;
|
|
58021
58025
|
}
|
|
58022
58026
|
if (isCaptured) {
|
|
58023
|
-
getNodeLinks(symbol.valueDeclaration).flags |=
|
|
58027
|
+
getNodeLinks(symbol.valueDeclaration).flags |= 16384 /* CapturedBlockScopedBinding */;
|
|
58024
58028
|
}
|
|
58025
58029
|
}
|
|
58026
58030
|
function isBindingCapturedByNode(node, decl) {
|
|
@@ -58237,23 +58241,23 @@ function createTypeChecker(host) {
|
|
|
58237
58241
|
checkThisBeforeSuper(node, container, Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class);
|
|
58238
58242
|
}
|
|
58239
58243
|
if (isStatic(container) || isCallExpression2) {
|
|
58240
|
-
nodeCheckFlag =
|
|
58244
|
+
nodeCheckFlag = 32 /* SuperStatic */;
|
|
58241
58245
|
if (!isCallExpression2 && languageVersion >= 2 /* ES2015 */ && languageVersion <= 8 /* ES2021 */ && (isPropertyDeclaration(container) || isClassStaticBlockDeclaration(container))) {
|
|
58242
58246
|
forEachEnclosingBlockScopeContainer(node.parent, (current) => {
|
|
58243
58247
|
if (!isSourceFile(current) || isExternalOrCommonJsModule(current)) {
|
|
58244
|
-
getNodeLinks(current).flags |=
|
|
58248
|
+
getNodeLinks(current).flags |= 8388608 /* ContainsSuperPropertyInStaticInitializer */;
|
|
58245
58249
|
}
|
|
58246
58250
|
});
|
|
58247
58251
|
}
|
|
58248
58252
|
} else {
|
|
58249
|
-
nodeCheckFlag =
|
|
58253
|
+
nodeCheckFlag = 16 /* SuperInstance */;
|
|
58250
58254
|
}
|
|
58251
58255
|
getNodeLinks(node).flags |= nodeCheckFlag;
|
|
58252
58256
|
if (container.kind === 171 /* MethodDeclaration */ && inAsyncFunction) {
|
|
58253
58257
|
if (isSuperProperty(node.parent) && isAssignmentTarget(node.parent)) {
|
|
58254
|
-
getNodeLinks(container).flags |=
|
|
58258
|
+
getNodeLinks(container).flags |= 256 /* MethodWithSuperPropertyAssignmentInAsync */;
|
|
58255
58259
|
} else {
|
|
58256
|
-
getNodeLinks(container).flags |=
|
|
58260
|
+
getNodeLinks(container).flags |= 128 /* MethodWithSuperPropertyAccessInAsync */;
|
|
58257
58261
|
}
|
|
58258
58262
|
}
|
|
58259
58263
|
if (needToCaptureLexicalThis) {
|
|
@@ -58281,7 +58285,7 @@ function createTypeChecker(host) {
|
|
|
58281
58285
|
error(node, Diagnostics.super_cannot_be_referenced_in_constructor_arguments);
|
|
58282
58286
|
return errorType;
|
|
58283
58287
|
}
|
|
58284
|
-
return nodeCheckFlag ===
|
|
58288
|
+
return nodeCheckFlag === 32 /* SuperStatic */ ? getBaseConstructorTypeOfClass(classType) : getTypeWithThisArgument(baseClassType, classType.thisType);
|
|
58285
58289
|
function isLegalUsageOfSuperExpression(container2) {
|
|
58286
58290
|
if (!container2) {
|
|
58287
58291
|
return false;
|
|
@@ -59296,9 +59300,9 @@ function createTypeChecker(host) {
|
|
|
59296
59300
|
const container = getEnclosingBlockScopeContainer(node.parent.parent);
|
|
59297
59301
|
const enclosingIterationStatement = getEnclosingIterationStatement(container);
|
|
59298
59302
|
if (enclosingIterationStatement) {
|
|
59299
|
-
getNodeLinks(enclosingIterationStatement).flags |=
|
|
59300
|
-
getNodeLinks(node).flags |=
|
|
59301
|
-
getNodeLinks(node.parent.parent).flags |=
|
|
59303
|
+
getNodeLinks(enclosingIterationStatement).flags |= 4096 /* LoopWithCapturedBlockScopedBinding */;
|
|
59304
|
+
getNodeLinks(node).flags |= 32768 /* BlockScopedBindingInLoop */;
|
|
59305
|
+
getNodeLinks(node.parent.parent).flags |= 32768 /* BlockScopedBindingInLoop */;
|
|
59302
59306
|
}
|
|
59303
59307
|
}
|
|
59304
59308
|
if (links.resolvedType.flags & 98304 /* Nullable */ || !isTypeAssignableToKind(links.resolvedType, 402653316 /* StringLike */ | 296 /* NumberLike */ | 12288 /* ESSymbolLike */) && !isTypeAssignableTo(links.resolvedType, stringNumberSymbolType)) {
|
|
@@ -63285,10 +63289,10 @@ function createTypeChecker(host) {
|
|
|
63285
63289
|
}
|
|
63286
63290
|
function contextuallyCheckFunctionExpressionOrObjectLiteralMethod(node, checkMode) {
|
|
63287
63291
|
const links = getNodeLinks(node);
|
|
63288
|
-
if (!(links.flags &
|
|
63292
|
+
if (!(links.flags & 64 /* ContextChecked */)) {
|
|
63289
63293
|
const contextualSignature = getContextualSignature(node);
|
|
63290
|
-
if (!(links.flags &
|
|
63291
|
-
links.flags |=
|
|
63294
|
+
if (!(links.flags & 64 /* ContextChecked */)) {
|
|
63295
|
+
links.flags |= 64 /* ContextChecked */;
|
|
63292
63296
|
const signature = firstOrUndefined(getSignaturesOfType(getTypeOfSymbol(getSymbolOfNode(node)), 0 /* Call */));
|
|
63293
63297
|
if (!signature) {
|
|
63294
63298
|
return;
|
|
@@ -65278,13 +65282,13 @@ function createTypeChecker(host) {
|
|
|
65278
65282
|
function setNodeLinksForPrivateIdentifierScope(node) {
|
|
65279
65283
|
if (isPrivateIdentifier(node.name) && languageVersion < 99 /* ESNext */) {
|
|
65280
65284
|
for (let lexicalScope = getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = getEnclosingBlockScopeContainer(lexicalScope)) {
|
|
65281
|
-
getNodeLinks(lexicalScope).flags |=
|
|
65285
|
+
getNodeLinks(lexicalScope).flags |= 4194304 /* ContainsClassWithPrivateIdentifiers */;
|
|
65282
65286
|
}
|
|
65283
65287
|
if (isClassExpression(node.parent)) {
|
|
65284
65288
|
const enclosingIterationStatement = getEnclosingIterationStatement(node.parent);
|
|
65285
65289
|
if (enclosingIterationStatement) {
|
|
65286
|
-
getNodeLinks(node.name).flags |=
|
|
65287
|
-
getNodeLinks(enclosingIterationStatement).flags |=
|
|
65290
|
+
getNodeLinks(node.name).flags |= 32768 /* BlockScopedBindingInLoop */;
|
|
65291
|
+
getNodeLinks(enclosingIterationStatement).flags |= 4096 /* LoopWithCapturedBlockScopedBinding */;
|
|
65288
65292
|
}
|
|
65289
65293
|
}
|
|
65290
65294
|
}
|
|
@@ -66879,7 +66883,7 @@ function createTypeChecker(host) {
|
|
|
66879
66883
|
}
|
|
66880
66884
|
function checkWeakMapSetCollision(node) {
|
|
66881
66885
|
const enclosingBlockScope = getEnclosingBlockScopeContainer(node);
|
|
66882
|
-
if (getNodeCheckFlags(enclosingBlockScope) &
|
|
66886
|
+
if (getNodeCheckFlags(enclosingBlockScope) & 4194304 /* ContainsClassWithPrivateIdentifiers */) {
|
|
66883
66887
|
Debug.assert(isNamedDeclaration(node) && isIdentifier(node.name) && typeof node.name.escapedText === "string", "The target of a WeakMap/WeakSet collision check should be an identifier");
|
|
66884
66888
|
errorSkippedOn("noEmit", node, Diagnostics.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel, node.name.escapedText);
|
|
66885
66889
|
}
|
|
@@ -66893,18 +66897,18 @@ function createTypeChecker(host) {
|
|
|
66893
66897
|
let hasCollision = false;
|
|
66894
66898
|
if (isClassExpression(node)) {
|
|
66895
66899
|
for (const member of node.members) {
|
|
66896
|
-
if (getNodeCheckFlags(member) &
|
|
66900
|
+
if (getNodeCheckFlags(member) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
|
|
66897
66901
|
hasCollision = true;
|
|
66898
66902
|
break;
|
|
66899
66903
|
}
|
|
66900
66904
|
}
|
|
66901
66905
|
} else if (isFunctionExpression(node)) {
|
|
66902
|
-
if (getNodeCheckFlags(node) &
|
|
66906
|
+
if (getNodeCheckFlags(node) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
|
|
66903
66907
|
hasCollision = true;
|
|
66904
66908
|
}
|
|
66905
66909
|
} else {
|
|
66906
66910
|
const container = getEnclosingBlockScopeContainer(node);
|
|
66907
|
-
if (container && getNodeCheckFlags(container) &
|
|
66911
|
+
if (container && getNodeCheckFlags(container) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
|
|
66908
66912
|
hasCollision = true;
|
|
66909
66913
|
}
|
|
66910
66914
|
}
|
|
@@ -68789,8 +68793,8 @@ function createTypeChecker(host) {
|
|
|
68789
68793
|
}
|
|
68790
68794
|
function computeEnumMemberValues(node) {
|
|
68791
68795
|
const nodeLinks2 = getNodeLinks(node);
|
|
68792
|
-
if (!(nodeLinks2.flags &
|
|
68793
|
-
nodeLinks2.flags |=
|
|
68796
|
+
if (!(nodeLinks2.flags & 1024 /* EnumValuesComputed */)) {
|
|
68797
|
+
nodeLinks2.flags |= 1024 /* EnumValuesComputed */;
|
|
68794
68798
|
let autoValue = 0;
|
|
68795
68799
|
for (const member of node.members) {
|
|
68796
68800
|
const value = computeMemberValue(member, autoValue);
|
|
@@ -69066,7 +69070,7 @@ function createTypeChecker(host) {
|
|
|
69066
69070
|
}
|
|
69067
69071
|
const mergedClass = getDeclarationOfKind(symbol, 260 /* ClassDeclaration */);
|
|
69068
69072
|
if (mergedClass && inSameLexicalScope(node, mergedClass)) {
|
|
69069
|
-
getNodeLinks(node).flags |=
|
|
69073
|
+
getNodeLinks(node).flags |= 2048 /* LexicalModuleMergesWithClass */;
|
|
69070
69074
|
}
|
|
69071
69075
|
}
|
|
69072
69076
|
if (isAmbientExternalModule) {
|
|
@@ -70697,8 +70701,8 @@ function createTypeChecker(host) {
|
|
|
70697
70701
|
const nodeLinks2 = getNodeLinks(symbol.valueDeclaration);
|
|
70698
70702
|
if (resolveName(container.parent, symbol.escapedName, 111551 /* Value */, void 0, void 0, false)) {
|
|
70699
70703
|
links.isDeclarationWithCollidingName = true;
|
|
70700
|
-
} else if (nodeLinks2.flags &
|
|
70701
|
-
const isDeclaredInLoop = nodeLinks2.flags &
|
|
70704
|
+
} else if (nodeLinks2.flags & 16384 /* CapturedBlockScopedBinding */) {
|
|
70705
|
+
const isDeclaredInLoop = nodeLinks2.flags & 32768 /* BlockScopedBindingInLoop */;
|
|
70702
70706
|
const inLoopInitializer = isIterationStatement(container, false);
|
|
70703
70707
|
const inLoopBodyBlock = container.kind === 238 /* Block */ && isIterationStatement(container.parent, false);
|
|
70704
70708
|
links.isDeclarationWithCollidingName = !isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || !inLoopInitializer && !inLoopBodyBlock);
|
|
@@ -77673,12 +77677,12 @@ function transformClassFields(context) {
|
|
|
77673
77677
|
function visitClassExpressionInNewClassLexicalEnvironment(node, facts) {
|
|
77674
77678
|
const isDecoratedClassDeclaration = !!(facts & 1 /* ClassWasDecorated */);
|
|
77675
77679
|
const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node);
|
|
77676
|
-
const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) &
|
|
77680
|
+
const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */;
|
|
77677
77681
|
let temp;
|
|
77678
77682
|
function createClassTempVar() {
|
|
77679
77683
|
const classCheckFlags = resolver.getNodeCheckFlags(node);
|
|
77680
|
-
const isClassWithConstructorReference2 = classCheckFlags &
|
|
77681
|
-
const requiresBlockScopedVar = classCheckFlags &
|
|
77684
|
+
const isClassWithConstructorReference2 = classCheckFlags & 1048576 /* ClassWithConstructorReference */;
|
|
77685
|
+
const requiresBlockScopedVar = classCheckFlags & 32768 /* BlockScopedBindingInLoop */;
|
|
77682
77686
|
return factory2.createTempVariable(requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration, !!isClassWithConstructorReference2);
|
|
77683
77687
|
}
|
|
77684
77688
|
if (facts & 2 /* NeedsClassConstructorReference */) {
|
|
@@ -78191,7 +78195,7 @@ function transformClassFields(context) {
|
|
|
78191
78195
|
}
|
|
78192
78196
|
function trySubstituteClassAlias(node) {
|
|
78193
78197
|
if (enabledSubstitutions & 1 /* ClassAliases */) {
|
|
78194
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
78198
|
+
if (resolver.getNodeCheckFlags(node) & 2097152 /* ConstructorReferenceInClass */) {
|
|
78195
78199
|
const declaration = resolver.getReferencedValueDeclaration(node);
|
|
78196
78200
|
if (declaration) {
|
|
78197
78201
|
const classAlias = classAliases[declaration.id];
|
|
@@ -78214,7 +78218,7 @@ function transformClassFields(context) {
|
|
|
78214
78218
|
const alreadyTransformed = isAssignmentExpression(innerExpression) && isGeneratedIdentifier(innerExpression.left);
|
|
78215
78219
|
if (!alreadyTransformed && !inlinable && shouldHoist) {
|
|
78216
78220
|
const generatedName = factory2.getGeneratedNameForNode(name);
|
|
78217
|
-
if (resolver.getNodeCheckFlags(name) &
|
|
78221
|
+
if (resolver.getNodeCheckFlags(name) & 32768 /* BlockScopedBindingInLoop */) {
|
|
78218
78222
|
addBlockScopedVariable(generatedName);
|
|
78219
78223
|
} else {
|
|
78220
78224
|
hoistVariableDeclaration(generatedName);
|
|
@@ -78363,7 +78367,7 @@ function transformClassFields(context) {
|
|
|
78363
78367
|
const { className } = getPrivateIdentifierEnvironment();
|
|
78364
78368
|
const prefix = className ? { prefix: "_", node: className, suffix: "_" } : "_";
|
|
78365
78369
|
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);
|
|
78366
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
78370
|
+
if (resolver.getNodeCheckFlags(node) & 32768 /* BlockScopedBindingInLoop */) {
|
|
78367
78371
|
addBlockScopedVariable(identifier);
|
|
78368
78372
|
} else {
|
|
78369
78373
|
hoistVariableDeclaration(identifier);
|
|
@@ -79228,7 +79232,7 @@ function transformLegacyDecorators(context) {
|
|
|
79228
79232
|
}
|
|
79229
79233
|
}
|
|
79230
79234
|
function getClassAliasIfNeeded(node) {
|
|
79231
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
79235
|
+
if (resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */) {
|
|
79232
79236
|
enableSubstitutionForClassAliases();
|
|
79233
79237
|
const classAlias = factory2.createUniqueName(node.name && !isGeneratedIdentifier(node.name) ? idText(node.name) : "default");
|
|
79234
79238
|
classAliases[getOriginalNodeId(node)] = classAlias;
|
|
@@ -79262,7 +79266,7 @@ function transformLegacyDecorators(context) {
|
|
|
79262
79266
|
}
|
|
79263
79267
|
function trySubstituteClassAlias(node) {
|
|
79264
79268
|
if (classAliases) {
|
|
79265
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
79269
|
+
if (resolver.getNodeCheckFlags(node) & 2097152 /* ConstructorReferenceInClass */) {
|
|
79266
79270
|
const declaration = resolver.getReferencedValueDeclaration(node);
|
|
79267
79271
|
if (declaration) {
|
|
79268
79272
|
const classAlias = classAliases[declaration.id];
|
|
@@ -79297,7 +79301,7 @@ function transformES2017(context) {
|
|
|
79297
79301
|
let capturedSuperProperties;
|
|
79298
79302
|
let hasSuperElementAccess;
|
|
79299
79303
|
const substitutedSuperAccessors = [];
|
|
79300
|
-
let contextFlags = 0
|
|
79304
|
+
let contextFlags = 0 /* None */;
|
|
79301
79305
|
const previousOnEmitNode = context.onEmitNode;
|
|
79302
79306
|
const previousOnSubstituteNode = context.onSubstituteNode;
|
|
79303
79307
|
context.onEmitNode = onEmitNode;
|
|
@@ -79624,7 +79628,7 @@ function transformES2017(context) {
|
|
|
79624
79628
|
hasSuperElementAccess = false;
|
|
79625
79629
|
let updated = visitFunctionBody(node.body, visitor, context);
|
|
79626
79630
|
const originalMethod = getOriginalNode(node, isFunctionLikeDeclaration);
|
|
79627
|
-
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (
|
|
79631
|
+
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (256 /* MethodWithSuperPropertyAssignmentInAsync */ | 128 /* MethodWithSuperPropertyAccessInAsync */) && (getFunctionFlags(originalMethod) & 3 /* AsyncGenerator */) !== 3 /* AsyncGenerator */;
|
|
79628
79632
|
if (emitSuperHelpers) {
|
|
79629
79633
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
79630
79634
|
if (capturedSuperProperties.size) {
|
|
@@ -79635,9 +79639,9 @@ function transformES2017(context) {
|
|
|
79635
79639
|
updated = factory2.updateBlock(updated, statements);
|
|
79636
79640
|
}
|
|
79637
79641
|
if (hasSuperElementAccess) {
|
|
79638
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
79642
|
+
if (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
79639
79643
|
addEmitHelper(updated, advancedAsyncSuperHelper);
|
|
79640
|
-
} else if (resolver.getNodeCheckFlags(node) &
|
|
79644
|
+
} else if (resolver.getNodeCheckFlags(node) & 128 /* MethodWithSuperPropertyAccessInAsync */) {
|
|
79641
79645
|
addEmitHelper(updated, asyncSuperHelper);
|
|
79642
79646
|
}
|
|
79643
79647
|
}
|
|
@@ -79652,7 +79656,7 @@ function transformES2017(context) {
|
|
|
79652
79656
|
const nodeType = original.type;
|
|
79653
79657
|
const promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : void 0;
|
|
79654
79658
|
const isArrowFunction2 = node.kind === 216 /* ArrowFunction */;
|
|
79655
|
-
const hasLexicalArguments = (resolver.getNodeCheckFlags(node) &
|
|
79659
|
+
const hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 512 /* CaptureArguments */) !== 0;
|
|
79656
79660
|
const savedEnclosingFunctionParameterNames = enclosingFunctionParameterNames;
|
|
79657
79661
|
enclosingFunctionParameterNames = /* @__PURE__ */ new Set();
|
|
79658
79662
|
for (const parameter of node.parameters) {
|
|
@@ -79679,7 +79683,7 @@ function transformES2017(context) {
|
|
|
79679
79683
|
)
|
|
79680
79684
|
);
|
|
79681
79685
|
insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
|
|
79682
|
-
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (
|
|
79686
|
+
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (256 /* MethodWithSuperPropertyAssignmentInAsync */ | 128 /* MethodWithSuperPropertyAccessInAsync */);
|
|
79683
79687
|
if (emitSuperHelpers) {
|
|
79684
79688
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
79685
79689
|
if (capturedSuperProperties.size) {
|
|
@@ -79691,9 +79695,9 @@ function transformES2017(context) {
|
|
|
79691
79695
|
const block = factory2.createBlock(statements, true);
|
|
79692
79696
|
setTextRange(block, node.body);
|
|
79693
79697
|
if (emitSuperHelpers && hasSuperElementAccess) {
|
|
79694
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
79698
|
+
if (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
79695
79699
|
addEmitHelper(block, advancedAsyncSuperHelper);
|
|
79696
|
-
} else if (resolver.getNodeCheckFlags(node) &
|
|
79700
|
+
} else if (resolver.getNodeCheckFlags(node) & 128 /* MethodWithSuperPropertyAccessInAsync */) {
|
|
79697
79701
|
addEmitHelper(block, asyncSuperHelper);
|
|
79698
79702
|
}
|
|
79699
79703
|
}
|
|
@@ -79753,7 +79757,7 @@ function transformES2017(context) {
|
|
|
79753
79757
|
}
|
|
79754
79758
|
function onEmitNode(hint, node, emitCallback) {
|
|
79755
79759
|
if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) {
|
|
79756
|
-
const superContainerFlags = resolver.getNodeCheckFlags(node) & (
|
|
79760
|
+
const superContainerFlags = resolver.getNodeCheckFlags(node) & (128 /* MethodWithSuperPropertyAccessInAsync */ | 256 /* MethodWithSuperPropertyAssignmentInAsync */);
|
|
79757
79761
|
if (superContainerFlags !== enclosingSuperContainerFlags) {
|
|
79758
79762
|
const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
|
|
79759
79763
|
enclosingSuperContainerFlags = superContainerFlags;
|
|
@@ -79829,7 +79833,7 @@ function transformES2017(context) {
|
|
|
79829
79833
|
return kind === 260 /* ClassDeclaration */ || kind === 173 /* Constructor */ || kind === 171 /* MethodDeclaration */ || kind === 174 /* GetAccessor */ || kind === 175 /* SetAccessor */;
|
|
79830
79834
|
}
|
|
79831
79835
|
function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
|
|
79832
|
-
if (enclosingSuperContainerFlags &
|
|
79836
|
+
if (enclosingSuperContainerFlags & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
79833
79837
|
return setTextRange(
|
|
79834
79838
|
factory2.createPropertyAccessExpression(
|
|
79835
79839
|
factory2.createCallExpression(
|
|
@@ -79854,7 +79858,7 @@ function transformES2017(context) {
|
|
|
79854
79858
|
}
|
|
79855
79859
|
}
|
|
79856
79860
|
function createSuperAccessVariableStatement(factory2, resolver, node, names) {
|
|
79857
|
-
const hasBinding = (resolver.getNodeCheckFlags(node) &
|
|
79861
|
+
const hasBinding = (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) !== 0;
|
|
79858
79862
|
const accessors = [];
|
|
79859
79863
|
names.forEach((_, key) => {
|
|
79860
79864
|
const name = unescapeLeadingUnderscores(key);
|
|
@@ -80792,7 +80796,7 @@ function transformES2018(context) {
|
|
|
80792
80796
|
!!(hierarchyFacts & 1 /* HasLexicalThis */)
|
|
80793
80797
|
)
|
|
80794
80798
|
);
|
|
80795
|
-
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (
|
|
80799
|
+
const emitSuperHelpers = languageVersion >= 2 /* ES2015 */ && resolver.getNodeCheckFlags(node) & (256 /* MethodWithSuperPropertyAssignmentInAsync */ | 128 /* MethodWithSuperPropertyAccessInAsync */);
|
|
80796
80800
|
if (emitSuperHelpers) {
|
|
80797
80801
|
enableSubstitutionForAsyncMethodsWithSuper();
|
|
80798
80802
|
const variableStatement = createSuperAccessVariableStatement(factory2, resolver, node, capturedSuperProperties);
|
|
@@ -80803,9 +80807,9 @@ function transformES2018(context) {
|
|
|
80803
80807
|
insertStatementsAfterStandardPrologue(statements, endLexicalEnvironment());
|
|
80804
80808
|
const block = factory2.updateBlock(node.body, statements);
|
|
80805
80809
|
if (emitSuperHelpers && hasSuperElementAccess) {
|
|
80806
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
80810
|
+
if (resolver.getNodeCheckFlags(node) & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
80807
80811
|
addEmitHelper(block, advancedAsyncSuperHelper);
|
|
80808
|
-
} else if (resolver.getNodeCheckFlags(node) &
|
|
80812
|
+
} else if (resolver.getNodeCheckFlags(node) & 128 /* MethodWithSuperPropertyAccessInAsync */) {
|
|
80809
80813
|
addEmitHelper(block, asyncSuperHelper);
|
|
80810
80814
|
}
|
|
80811
80815
|
}
|
|
@@ -80915,7 +80919,7 @@ function transformES2018(context) {
|
|
|
80915
80919
|
}
|
|
80916
80920
|
function onEmitNode(hint, node, emitCallback) {
|
|
80917
80921
|
if (enabledSubstitutions & 1 /* AsyncMethodsWithSuper */ && isSuperContainer(node)) {
|
|
80918
|
-
const superContainerFlags = resolver.getNodeCheckFlags(node) & (
|
|
80922
|
+
const superContainerFlags = resolver.getNodeCheckFlags(node) & (128 /* MethodWithSuperPropertyAccessInAsync */ | 256 /* MethodWithSuperPropertyAssignmentInAsync */);
|
|
80919
80923
|
if (superContainerFlags !== enclosingSuperContainerFlags) {
|
|
80920
80924
|
const savedEnclosingSuperContainerFlags = enclosingSuperContainerFlags;
|
|
80921
80925
|
enclosingSuperContainerFlags = superContainerFlags;
|
|
@@ -80991,7 +80995,7 @@ function transformES2018(context) {
|
|
|
80991
80995
|
return kind === 260 /* ClassDeclaration */ || kind === 173 /* Constructor */ || kind === 171 /* MethodDeclaration */ || kind === 174 /* GetAccessor */ || kind === 175 /* SetAccessor */;
|
|
80992
80996
|
}
|
|
80993
80997
|
function createSuperElementAccessInAsyncMethod(argumentExpression, location) {
|
|
80994
|
-
if (enclosingSuperContainerFlags &
|
|
80998
|
+
if (enclosingSuperContainerFlags & 256 /* MethodWithSuperPropertyAssignmentInAsync */) {
|
|
80995
80999
|
return setTextRange(
|
|
80996
81000
|
factory2.createPropertyAccessExpression(
|
|
80997
81001
|
factory2.createCallExpression(
|
|
@@ -83347,8 +83351,8 @@ function transformES2015(context) {
|
|
|
83347
83351
|
}
|
|
83348
83352
|
function shouldEmitExplicitInitializerForLetDeclaration(node) {
|
|
83349
83353
|
const flags = resolver.getNodeCheckFlags(node);
|
|
83350
|
-
const isCapturedInFunction = flags &
|
|
83351
|
-
const isDeclaredInLoop = flags &
|
|
83354
|
+
const isCapturedInFunction = flags & 16384 /* CapturedBlockScopedBinding */;
|
|
83355
|
+
const isDeclaredInLoop = flags & 32768 /* BlockScopedBindingInLoop */;
|
|
83352
83356
|
const emittedAsTopLevel = (hierarchyFacts & 64 /* TopLevel */) !== 0 || isCapturedInFunction && isDeclaredInLoop && (hierarchyFacts & 512 /* IterationStatementBlock */) !== 0;
|
|
83353
83357
|
const emitExplicitInitializer = !emittedAsTopLevel && (hierarchyFacts & 4096 /* ForInOrForOfStatement */) === 0 && (!resolver.isDeclarationWithCollidingName(node) || isDeclaredInLoop && !isCapturedInFunction && (hierarchyFacts & (2048 /* ForStatement */ | 4096 /* ForInOrForOfStatement */)) === 0);
|
|
83354
83358
|
return emitExplicitInitializer;
|
|
@@ -83709,7 +83713,7 @@ function transformES2015(context) {
|
|
|
83709
83713
|
return factory2.inlineExpressions(expressions);
|
|
83710
83714
|
}
|
|
83711
83715
|
function shouldConvertPartOfIterationStatement(node) {
|
|
83712
|
-
return (resolver.getNodeCheckFlags(node) &
|
|
83716
|
+
return (resolver.getNodeCheckFlags(node) & 8192 /* ContainsCapturedBlockScopeBinding */) !== 0;
|
|
83713
83717
|
}
|
|
83714
83718
|
function shouldConvertInitializerOfForStatement(node) {
|
|
83715
83719
|
return isForStatement(node) && !!node.initializer && shouldConvertPartOfIterationStatement(node.initializer);
|
|
@@ -83724,7 +83728,7 @@ function transformES2015(context) {
|
|
|
83724
83728
|
return shouldConvertBodyOfIterationStatement(node) || shouldConvertInitializerOfForStatement(node);
|
|
83725
83729
|
}
|
|
83726
83730
|
function shouldConvertBodyOfIterationStatement(node) {
|
|
83727
|
-
return (resolver.getNodeCheckFlags(node) &
|
|
83731
|
+
return (resolver.getNodeCheckFlags(node) & 4096 /* LoopWithCapturedBlockScopedBinding */) !== 0;
|
|
83728
83732
|
}
|
|
83729
83733
|
function hoistVariableDeclarationDeclaredInConvertedLoop(state, node) {
|
|
83730
83734
|
if (!state.hoistedLocalVariables) {
|
|
@@ -84185,10 +84189,10 @@ function transformES2015(context) {
|
|
|
84185
84189
|
} else {
|
|
84186
84190
|
loopParameters.push(factory2.createParameterDeclaration(void 0, void 0, name));
|
|
84187
84191
|
const checkFlags = resolver.getNodeCheckFlags(decl);
|
|
84188
|
-
if (checkFlags &
|
|
84192
|
+
if (checkFlags & 262144 /* NeedsLoopOutParameter */ || hasCapturedBindingsInForHead) {
|
|
84189
84193
|
const outParamName = factory2.createUniqueName("out_" + idText(name));
|
|
84190
|
-
let flags = 0
|
|
84191
|
-
if (checkFlags &
|
|
84194
|
+
let flags = 0 /* None */;
|
|
84195
|
+
if (checkFlags & 262144 /* NeedsLoopOutParameter */) {
|
|
84192
84196
|
flags |= 1 /* Body */;
|
|
84193
84197
|
}
|
|
84194
84198
|
if (isForStatement(container)) {
|