@typescript-deploys/pr-build 5.2.0-pr-55267-8 → 5.3.0-pr-54778-3
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 +141 -95
- package/lib/tsserver.js +162 -116
- package/lib/tsserverlibrary.d.ts +7 -3
- package/lib/tsserverlibrary.js +162 -116
- package/lib/typescript.d.ts +4 -2
- package/lib/typescript.js +153 -106
- package/lib/typingsInstaller.js +5 -3
- package/package.json +3 -3
package/lib/tsserver.js
CHANGED
|
@@ -2330,8 +2330,8 @@ __export(server_exports, {
|
|
|
2330
2330
|
module.exports = __toCommonJS(server_exports);
|
|
2331
2331
|
|
|
2332
2332
|
// src/compiler/corePublic.ts
|
|
2333
|
-
var versionMajorMinor = "5.
|
|
2334
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2333
|
+
var versionMajorMinor = "5.3";
|
|
2334
|
+
var version = `${versionMajorMinor}.0-insiders.20230809`;
|
|
2335
2335
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2336
2336
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2337
2337
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6625,15 +6625,13 @@ var NodeCheckFlags = /* @__PURE__ */ ((NodeCheckFlags2) => {
|
|
|
6625
6625
|
NodeCheckFlags2[NodeCheckFlags2["ContainsCapturedBlockScopeBinding"] = 8192] = "ContainsCapturedBlockScopeBinding";
|
|
6626
6626
|
NodeCheckFlags2[NodeCheckFlags2["CapturedBlockScopedBinding"] = 16384] = "CapturedBlockScopedBinding";
|
|
6627
6627
|
NodeCheckFlags2[NodeCheckFlags2["BlockScopedBindingInLoop"] = 32768] = "BlockScopedBindingInLoop";
|
|
6628
|
-
NodeCheckFlags2[NodeCheckFlags2["
|
|
6629
|
-
NodeCheckFlags2[NodeCheckFlags2["
|
|
6630
|
-
NodeCheckFlags2[NodeCheckFlags2["
|
|
6631
|
-
NodeCheckFlags2[NodeCheckFlags2["
|
|
6632
|
-
NodeCheckFlags2[NodeCheckFlags2["
|
|
6633
|
-
NodeCheckFlags2[NodeCheckFlags2["
|
|
6634
|
-
NodeCheckFlags2[NodeCheckFlags2["
|
|
6635
|
-
NodeCheckFlags2[NodeCheckFlags2["ContainsSuperPropertyInStaticInitializer"] = 8388608] = "ContainsSuperPropertyInStaticInitializer";
|
|
6636
|
-
NodeCheckFlags2[NodeCheckFlags2["InCheckIdentifier"] = 16777216] = "InCheckIdentifier";
|
|
6628
|
+
NodeCheckFlags2[NodeCheckFlags2["NeedsLoopOutParameter"] = 65536] = "NeedsLoopOutParameter";
|
|
6629
|
+
NodeCheckFlags2[NodeCheckFlags2["AssignmentsMarked"] = 131072] = "AssignmentsMarked";
|
|
6630
|
+
NodeCheckFlags2[NodeCheckFlags2["ContainsConstructorReference"] = 262144] = "ContainsConstructorReference";
|
|
6631
|
+
NodeCheckFlags2[NodeCheckFlags2["ConstructorReference"] = 536870912] = "ConstructorReference";
|
|
6632
|
+
NodeCheckFlags2[NodeCheckFlags2["ContainsClassWithPrivateIdentifiers"] = 1048576] = "ContainsClassWithPrivateIdentifiers";
|
|
6633
|
+
NodeCheckFlags2[NodeCheckFlags2["ContainsSuperPropertyInStaticInitializer"] = 2097152] = "ContainsSuperPropertyInStaticInitializer";
|
|
6634
|
+
NodeCheckFlags2[NodeCheckFlags2["InCheckIdentifier"] = 4194304] = "InCheckIdentifier";
|
|
6637
6635
|
return NodeCheckFlags2;
|
|
6638
6636
|
})(NodeCheckFlags || {});
|
|
6639
6637
|
var TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
|
|
@@ -22935,8 +22933,10 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22935
22933
|
return update(updated, original);
|
|
22936
22934
|
}
|
|
22937
22935
|
function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
|
|
22936
|
+
const text = typeof value === "number" ? value + "" : value;
|
|
22937
|
+
Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
|
|
22938
22938
|
const node = createBaseDeclaration(9 /* NumericLiteral */);
|
|
22939
|
-
node.text =
|
|
22939
|
+
node.text = text;
|
|
22940
22940
|
node.numericLiteralFlags = numericLiteralFlags;
|
|
22941
22941
|
if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
|
|
22942
22942
|
node.transformFlags |= 1024 /* ContainsES2015 */;
|
|
@@ -29939,7 +29939,7 @@ function createAccessorPropertyBackingField(factory2, node, modifiers, initializ
|
|
|
29939
29939
|
initializer
|
|
29940
29940
|
);
|
|
29941
29941
|
}
|
|
29942
|
-
function createAccessorPropertyGetRedirector(factory2, node, modifiers, name) {
|
|
29942
|
+
function createAccessorPropertyGetRedirector(factory2, node, modifiers, name, receiver = factory2.createThis()) {
|
|
29943
29943
|
return factory2.createGetAccessorDeclaration(
|
|
29944
29944
|
modifiers,
|
|
29945
29945
|
name,
|
|
@@ -29949,7 +29949,7 @@ function createAccessorPropertyGetRedirector(factory2, node, modifiers, name) {
|
|
|
29949
29949
|
factory2.createBlock([
|
|
29950
29950
|
factory2.createReturnStatement(
|
|
29951
29951
|
factory2.createPropertyAccessExpression(
|
|
29952
|
-
|
|
29952
|
+
receiver,
|
|
29953
29953
|
factory2.getGeneratedPrivateNameForNode(
|
|
29954
29954
|
node.name,
|
|
29955
29955
|
/*prefix*/
|
|
@@ -29961,7 +29961,7 @@ function createAccessorPropertyGetRedirector(factory2, node, modifiers, name) {
|
|
|
29961
29961
|
])
|
|
29962
29962
|
);
|
|
29963
29963
|
}
|
|
29964
|
-
function createAccessorPropertySetRedirector(factory2, node, modifiers, name) {
|
|
29964
|
+
function createAccessorPropertySetRedirector(factory2, node, modifiers, name, receiver = factory2.createThis()) {
|
|
29965
29965
|
return factory2.createSetAccessorDeclaration(
|
|
29966
29966
|
modifiers,
|
|
29967
29967
|
name,
|
|
@@ -29976,7 +29976,7 @@ function createAccessorPropertySetRedirector(factory2, node, modifiers, name) {
|
|
|
29976
29976
|
factory2.createExpressionStatement(
|
|
29977
29977
|
factory2.createAssignment(
|
|
29978
29978
|
factory2.createPropertyAccessExpression(
|
|
29979
|
-
|
|
29979
|
+
receiver,
|
|
29980
29980
|
factory2.getGeneratedPrivateNameForNode(
|
|
29981
29981
|
node.name,
|
|
29982
29982
|
/*prefix*/
|
|
@@ -53872,7 +53872,7 @@ function createTypeChecker(host) {
|
|
|
53872
53872
|
return factory.createStringLiteral(name, !!singleQuote);
|
|
53873
53873
|
}
|
|
53874
53874
|
if (isNumericLiteralName(name) && startsWith(name, "-")) {
|
|
53875
|
-
return factory.createComputedPropertyName(factory.createNumericLiteral(+name));
|
|
53875
|
+
return factory.createComputedPropertyName(factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(Math.abs(+name))));
|
|
53876
53876
|
}
|
|
53877
53877
|
return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions));
|
|
53878
53878
|
}
|
|
@@ -56637,7 +56637,7 @@ function createTypeChecker(host) {
|
|
|
56637
56637
|
if (reportErrors2) {
|
|
56638
56638
|
reportErrorsFromWidening(declaration, type);
|
|
56639
56639
|
}
|
|
56640
|
-
if (type.flags & 8192 /* UniqueESSymbol */ &&
|
|
56640
|
+
if (type.flags & 8192 /* UniqueESSymbol */ && !declaration.type && type.symbol !== getSymbolOfDeclaration(declaration) && !isValueSymbolAccessible(type.symbol, type.symbol.valueDeclaration)) {
|
|
56641
56641
|
type = esSymbolType;
|
|
56642
56642
|
}
|
|
56643
56643
|
return getWidenedType(type);
|
|
@@ -64539,6 +64539,7 @@ function createTypeChecker(host) {
|
|
|
64539
64539
|
let expandingFlags = 0 /* None */;
|
|
64540
64540
|
let overflow = false;
|
|
64541
64541
|
let overrideNextErrorInfo = 0;
|
|
64542
|
+
let skipParentCounter = 0;
|
|
64542
64543
|
let lastSkippedInfo;
|
|
64543
64544
|
let incompatibleStack;
|
|
64544
64545
|
Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
|
|
@@ -64604,6 +64605,7 @@ function createTypeChecker(host) {
|
|
|
64604
64605
|
lastSkippedInfo = saved.lastSkippedInfo;
|
|
64605
64606
|
incompatibleStack = saved.incompatibleStack;
|
|
64606
64607
|
overrideNextErrorInfo = saved.overrideNextErrorInfo;
|
|
64608
|
+
skipParentCounter = saved.skipParentCounter;
|
|
64607
64609
|
relatedInfo = saved.relatedInfo;
|
|
64608
64610
|
}
|
|
64609
64611
|
function captureErrorCalculationState() {
|
|
@@ -64612,6 +64614,7 @@ function createTypeChecker(host) {
|
|
|
64612
64614
|
lastSkippedInfo,
|
|
64613
64615
|
incompatibleStack: incompatibleStack == null ? void 0 : incompatibleStack.slice(),
|
|
64614
64616
|
overrideNextErrorInfo,
|
|
64617
|
+
skipParentCounter,
|
|
64615
64618
|
relatedInfo: relatedInfo == null ? void 0 : relatedInfo.slice()
|
|
64616
64619
|
};
|
|
64617
64620
|
}
|
|
@@ -64716,7 +64719,15 @@ function createTypeChecker(host) {
|
|
|
64716
64719
|
reportIncompatibleStack();
|
|
64717
64720
|
if (message.elidedInCompatabilityPyramid)
|
|
64718
64721
|
return;
|
|
64719
|
-
|
|
64722
|
+
if (skipParentCounter === 0) {
|
|
64723
|
+
errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
|
|
64724
|
+
} else {
|
|
64725
|
+
skipParentCounter--;
|
|
64726
|
+
}
|
|
64727
|
+
}
|
|
64728
|
+
function reportParentSkippedError(message, ...args) {
|
|
64729
|
+
reportError(message, ...args);
|
|
64730
|
+
skipParentCounter++;
|
|
64720
64731
|
}
|
|
64721
64732
|
function associateRelatedInfo(info) {
|
|
64722
64733
|
Debug.assert(!!errorInfo);
|
|
@@ -65053,14 +65064,14 @@ function createTypeChecker(host) {
|
|
|
65053
65064
|
}
|
|
65054
65065
|
}
|
|
65055
65066
|
if (suggestion !== void 0) {
|
|
65056
|
-
|
|
65067
|
+
reportParentSkippedError(
|
|
65057
65068
|
Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2,
|
|
65058
65069
|
symbolToString(prop),
|
|
65059
65070
|
typeToString(errorTarget),
|
|
65060
65071
|
suggestion
|
|
65061
65072
|
);
|
|
65062
65073
|
} else {
|
|
65063
|
-
|
|
65074
|
+
reportParentSkippedError(
|
|
65064
65075
|
Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,
|
|
65065
65076
|
symbolToString(prop),
|
|
65066
65077
|
typeToString(errorTarget)
|
|
@@ -70858,8 +70869,8 @@ function createTypeChecker(host) {
|
|
|
70858
70869
|
}
|
|
70859
70870
|
const parent2 = getRootDeclaration(symbol.valueDeclaration).parent;
|
|
70860
70871
|
const links = getNodeLinks(parent2);
|
|
70861
|
-
if (!(links.flags &
|
|
70862
|
-
links.flags |=
|
|
70872
|
+
if (!(links.flags & 131072 /* AssignmentsMarked */)) {
|
|
70873
|
+
links.flags |= 131072 /* AssignmentsMarked */;
|
|
70863
70874
|
if (!hasParentWithAssignmentsMarked(parent2)) {
|
|
70864
70875
|
markNodeAssignments(parent2);
|
|
70865
70876
|
}
|
|
@@ -70867,7 +70878,7 @@ function createTypeChecker(host) {
|
|
|
70867
70878
|
return symbol.isAssigned || false;
|
|
70868
70879
|
}
|
|
70869
70880
|
function hasParentWithAssignmentsMarked(node) {
|
|
70870
|
-
return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags &
|
|
70881
|
+
return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 131072 /* AssignmentsMarked */));
|
|
70871
70882
|
}
|
|
70872
70883
|
function markNodeAssignments(node) {
|
|
70873
70884
|
if (node.kind === 80 /* Identifier */) {
|
|
@@ -70973,11 +70984,11 @@ function createTypeChecker(host) {
|
|
|
70973
70984
|
const parent2 = declaration.parent.parent;
|
|
70974
70985
|
if (parent2.kind === 260 /* VariableDeclaration */ && getCombinedNodeFlagsCached(declaration) & 6 /* Constant */ || parent2.kind === 169 /* Parameter */) {
|
|
70975
70986
|
const links = getNodeLinks(parent2);
|
|
70976
|
-
if (!(links.flags &
|
|
70977
|
-
links.flags |=
|
|
70987
|
+
if (!(links.flags & 4194304 /* InCheckIdentifier */)) {
|
|
70988
|
+
links.flags |= 4194304 /* InCheckIdentifier */;
|
|
70978
70989
|
const parentType = getTypeForBindingElementParent(parent2, 0 /* Normal */);
|
|
70979
70990
|
const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
|
|
70980
|
-
links.flags &= ~
|
|
70991
|
+
links.flags &= ~4194304 /* InCheckIdentifier */;
|
|
70981
70992
|
if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(parent2.kind === 169 /* Parameter */ && isSymbolAssigned(symbol))) {
|
|
70982
70993
|
const pattern = declaration.parent;
|
|
70983
70994
|
const narrowedType = getFlowTypeOfReference(
|
|
@@ -71054,17 +71065,7 @@ function createTypeChecker(host) {
|
|
|
71054
71065
|
}
|
|
71055
71066
|
let declaration = localOrExportSymbol.valueDeclaration;
|
|
71056
71067
|
if (declaration && localOrExportSymbol.flags & 32 /* Class */) {
|
|
71057
|
-
if (declaration
|
|
71058
|
-
let container = getContainingClass(node);
|
|
71059
|
-
while (container !== void 0) {
|
|
71060
|
-
if (container === declaration && container.name !== node) {
|
|
71061
|
-
getNodeLinks(declaration).flags |= 1048576 /* ClassWithConstructorReference */;
|
|
71062
|
-
getNodeLinks(node).flags |= 2097152 /* ConstructorReferenceInClass */;
|
|
71063
|
-
break;
|
|
71064
|
-
}
|
|
71065
|
-
container = getContainingClass(container);
|
|
71066
|
-
}
|
|
71067
|
-
} else if (declaration.kind === 231 /* ClassExpression */) {
|
|
71068
|
+
if (isClassLike(declaration) && declaration.name !== node) {
|
|
71068
71069
|
let container = getThisContainer(
|
|
71069
71070
|
node,
|
|
71070
71071
|
/*includeArrowFunctions*/
|
|
@@ -71072,14 +71073,7 @@ function createTypeChecker(host) {
|
|
|
71072
71073
|
/*includeClassComputedPropertyName*/
|
|
71073
71074
|
false
|
|
71074
71075
|
);
|
|
71075
|
-
while (container.kind !== 312 /* SourceFile */) {
|
|
71076
|
-
if (container.parent === declaration) {
|
|
71077
|
-
if (isPropertyDeclaration(container) && isStatic(container) || isClassStaticBlockDeclaration(container)) {
|
|
71078
|
-
getNodeLinks(declaration).flags |= 1048576 /* ClassWithConstructorReference */;
|
|
71079
|
-
getNodeLinks(node).flags |= 2097152 /* ConstructorReferenceInClass */;
|
|
71080
|
-
}
|
|
71081
|
-
break;
|
|
71082
|
-
}
|
|
71076
|
+
while (container.kind !== 312 /* SourceFile */ && container.parent !== declaration) {
|
|
71083
71077
|
container = getThisContainer(
|
|
71084
71078
|
container,
|
|
71085
71079
|
/*includeArrowFunctions*/
|
|
@@ -71088,6 +71082,11 @@ function createTypeChecker(host) {
|
|
|
71088
71082
|
false
|
|
71089
71083
|
);
|
|
71090
71084
|
}
|
|
71085
|
+
if (container.kind !== 312 /* SourceFile */) {
|
|
71086
|
+
getNodeLinks(declaration).flags |= 262144 /* ContainsConstructorReference */;
|
|
71087
|
+
getNodeLinks(container).flags |= 262144 /* ContainsConstructorReference */;
|
|
71088
|
+
getNodeLinks(node).flags |= 536870912 /* ConstructorReference */;
|
|
71089
|
+
}
|
|
71091
71090
|
}
|
|
71092
71091
|
}
|
|
71093
71092
|
checkNestedBlockScopedBinding(node, symbol);
|
|
@@ -71218,7 +71217,7 @@ function createTypeChecker(host) {
|
|
|
71218
71217
|
if (isForStatement(container)) {
|
|
71219
71218
|
const varDeclList = getAncestor(symbol.valueDeclaration, 261 /* VariableDeclarationList */);
|
|
71220
71219
|
if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) {
|
|
71221
|
-
getNodeLinks(symbol.valueDeclaration).flags |=
|
|
71220
|
+
getNodeLinks(symbol.valueDeclaration).flags |= 65536 /* NeedsLoopOutParameter */;
|
|
71222
71221
|
}
|
|
71223
71222
|
}
|
|
71224
71223
|
getNodeLinks(symbol.valueDeclaration).flags |= 32768 /* BlockScopedBindingInLoop */;
|
|
@@ -71496,7 +71495,7 @@ function createTypeChecker(host) {
|
|
|
71496
71495
|
if (!isCallExpression2 && languageVersion >= 2 /* ES2015 */ && languageVersion <= 8 /* ES2021 */ && (isPropertyDeclaration(container) || isClassStaticBlockDeclaration(container))) {
|
|
71497
71496
|
forEachEnclosingBlockScopeContainer(node.parent, (current) => {
|
|
71498
71497
|
if (!isSourceFile(current) || isExternalOrCommonJsModule(current)) {
|
|
71499
|
-
getNodeLinks(current).flags |=
|
|
71498
|
+
getNodeLinks(current).flags |= 2097152 /* ContainsSuperPropertyInStaticInitializer */;
|
|
71500
71499
|
}
|
|
71501
71500
|
});
|
|
71502
71501
|
}
|
|
@@ -72023,7 +72022,7 @@ function createTypeChecker(host) {
|
|
|
72023
72022
|
} else if (t.flags & 3670016 /* StructuredType */) {
|
|
72024
72023
|
const prop = getPropertyOfType(t, name);
|
|
72025
72024
|
if (prop) {
|
|
72026
|
-
return isCircularMappedProperty(prop) ? void 0 : getTypeOfSymbol(prop);
|
|
72025
|
+
return isCircularMappedProperty(prop) ? void 0 : removeMissingType(getTypeOfSymbol(prop), !!(prop && prop.flags & 16777216 /* Optional */));
|
|
72027
72026
|
}
|
|
72028
72027
|
if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) {
|
|
72029
72028
|
const restType = getElementTypeOfSliceOfTupleType(
|
|
@@ -72108,7 +72107,7 @@ function createTypeChecker(host) {
|
|
|
72108
72107
|
(t) => {
|
|
72109
72108
|
if (isTupleType(t)) {
|
|
72110
72109
|
if ((firstSpreadIndex === void 0 || index < firstSpreadIndex) && index < t.target.fixedLength) {
|
|
72111
|
-
return getTypeArguments(t)[index];
|
|
72110
|
+
return removeMissingType(getTypeArguments(t)[index], !!(t.target.elementFlags[index] && 2 /* Optional */));
|
|
72112
72111
|
}
|
|
72113
72112
|
const offset = length2 !== void 0 && (lastSpreadIndex === void 0 || index > lastSpreadIndex) ? length2 - index : 0;
|
|
72114
72113
|
const fixedEndLength = offset > 0 && t.target.hasRestElement ? getEndElementCount(t.target, 3 /* Fixed */) : 0;
|
|
@@ -73269,13 +73268,18 @@ function createTypeChecker(host) {
|
|
|
73269
73268
|
if (!isErrorType(intrinsicElementsType)) {
|
|
73270
73269
|
if (!isIdentifier(node.tagName) && !isJsxNamespacedName(node.tagName))
|
|
73271
73270
|
return Debug.fail();
|
|
73272
|
-
const
|
|
73271
|
+
const propName = isJsxNamespacedName(node.tagName) ? getEscapedTextOfJsxNamespacedName(node.tagName) : node.tagName.escapedText;
|
|
73272
|
+
const intrinsicProp = getPropertyOfType(intrinsicElementsType, propName);
|
|
73273
73273
|
if (intrinsicProp) {
|
|
73274
73274
|
links.jsxFlags |= 1 /* IntrinsicNamedElement */;
|
|
73275
73275
|
return links.resolvedSymbol = intrinsicProp;
|
|
73276
73276
|
}
|
|
73277
|
-
const
|
|
73278
|
-
if (
|
|
73277
|
+
const indexSymbol = getApplicableIndexSymbol(intrinsicElementsType, getStringLiteralType(unescapeLeadingUnderscores(propName)));
|
|
73278
|
+
if (indexSymbol) {
|
|
73279
|
+
links.jsxFlags |= 2 /* IntrinsicIndexedElement */;
|
|
73280
|
+
return links.resolvedSymbol = indexSymbol;
|
|
73281
|
+
}
|
|
73282
|
+
if (getTypeOfPropertyOrIndexSignatureOfType(intrinsicElementsType, propName)) {
|
|
73279
73283
|
links.jsxFlags |= 2 /* IntrinsicIndexedElement */;
|
|
73280
73284
|
return links.resolvedSymbol = intrinsicElementsType.symbol;
|
|
73281
73285
|
}
|
|
@@ -73453,6 +73457,7 @@ function createTypeChecker(host) {
|
|
|
73453
73457
|
}
|
|
73454
73458
|
}
|
|
73455
73459
|
function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) {
|
|
73460
|
+
var _a;
|
|
73456
73461
|
Debug.assert(isJsxIntrinsicTagName(node.tagName));
|
|
73457
73462
|
const links = getNodeLinks(node);
|
|
73458
73463
|
if (!links.resolvedJsxElementAttributesType) {
|
|
@@ -73460,7 +73465,8 @@ function createTypeChecker(host) {
|
|
|
73460
73465
|
if (links.jsxFlags & 1 /* IntrinsicNamedElement */) {
|
|
73461
73466
|
return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol) || errorType;
|
|
73462
73467
|
} else if (links.jsxFlags & 2 /* IntrinsicIndexedElement */) {
|
|
73463
|
-
|
|
73468
|
+
const propName = isJsxNamespacedName(node.tagName) ? getEscapedTextOfJsxNamespacedName(node.tagName) : node.tagName.escapedText;
|
|
73469
|
+
return links.resolvedJsxElementAttributesType = ((_a = getApplicableIndexInfoForName(getJsxType(JsxNames.IntrinsicElements, node), propName)) == null ? void 0 : _a.type) || errorType;
|
|
73464
73470
|
} else {
|
|
73465
73471
|
return links.resolvedJsxElementAttributesType = errorType;
|
|
73466
73472
|
}
|
|
@@ -75038,7 +75044,7 @@ function createTypeChecker(host) {
|
|
|
75038
75044
|
}
|
|
75039
75045
|
}
|
|
75040
75046
|
function getThisArgumentOfCall(node) {
|
|
75041
|
-
const expression = node.kind === 213 /* CallExpression */ ? node.expression : node.kind === 215 /* TaggedTemplateExpression */ ? node.tag : void 0;
|
|
75047
|
+
const expression = node.kind === 213 /* CallExpression */ ? node.expression : node.kind === 215 /* TaggedTemplateExpression */ ? node.tag : node.kind === 170 /* Decorator */ && !legacyDecorators ? node.expression : void 0;
|
|
75042
75048
|
if (expression) {
|
|
75043
75049
|
const callee = skipOuterExpressions(expression);
|
|
75044
75050
|
if (isAccessExpression(callee)) {
|
|
@@ -79113,7 +79119,7 @@ function createTypeChecker(host) {
|
|
|
79113
79119
|
return createTupleType(elementTypes, elementFlags, type.target.readonly);
|
|
79114
79120
|
}
|
|
79115
79121
|
function widenTypeInferredFromInitializer(declaration, type) {
|
|
79116
|
-
const widened = getCombinedNodeFlagsCached(declaration) & 6 /* Constant */ || isDeclarationReadonly(declaration) ? type : getWidenedLiteralType(type);
|
|
79122
|
+
const widened = getCombinedNodeFlagsCached(declaration) & 6 /* Constant */ || isDeclarationReadonly(declaration) ? type : getWidenedUniqueESSymbolType(getWidenedLiteralType(type));
|
|
79117
79123
|
if (isInJSFile(declaration)) {
|
|
79118
79124
|
if (isEmptyLiteralType(widened)) {
|
|
79119
79125
|
reportImplicitAny(declaration, anyType);
|
|
@@ -79443,9 +79449,14 @@ function createTypeChecker(host) {
|
|
|
79443
79449
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
79444
79450
|
case 11 /* StringLiteral */:
|
|
79445
79451
|
return hasSkipDirectInferenceFlag(node) ? wildcardType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
|
|
79446
|
-
case 9 /* NumericLiteral */:
|
|
79452
|
+
case 9 /* NumericLiteral */: {
|
|
79447
79453
|
checkGrammarNumericLiteral(node);
|
|
79448
|
-
|
|
79454
|
+
const value = +node.text;
|
|
79455
|
+
if (!isFinite(value)) {
|
|
79456
|
+
return numberType;
|
|
79457
|
+
}
|
|
79458
|
+
return getFreshTypeOfLiteralType(getNumberLiteralType(value));
|
|
79459
|
+
}
|
|
79449
79460
|
case 10 /* BigIntLiteral */:
|
|
79450
79461
|
checkGrammarBigIntLiteral(node);
|
|
79451
79462
|
return getFreshTypeOfLiteralType(getBigIntLiteralType({
|
|
@@ -79945,7 +79956,7 @@ function createTypeChecker(host) {
|
|
|
79945
79956
|
function setNodeLinksForPrivateIdentifierScope(node) {
|
|
79946
79957
|
if (isPrivateIdentifier(node.name) && languageVersion < 99 /* ESNext */) {
|
|
79947
79958
|
for (let lexicalScope = getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = getEnclosingBlockScopeContainer(lexicalScope)) {
|
|
79948
|
-
getNodeLinks(lexicalScope).flags |=
|
|
79959
|
+
getNodeLinks(lexicalScope).flags |= 1048576 /* ContainsClassWithPrivateIdentifiers */;
|
|
79949
79960
|
}
|
|
79950
79961
|
if (isClassExpression(node.parent)) {
|
|
79951
79962
|
const enclosingIterationStatement = getEnclosingIterationStatement(node.parent);
|
|
@@ -81698,7 +81709,7 @@ function createTypeChecker(host) {
|
|
|
81698
81709
|
}
|
|
81699
81710
|
function checkWeakMapSetCollision(node) {
|
|
81700
81711
|
const enclosingBlockScope = getEnclosingBlockScopeContainer(node);
|
|
81701
|
-
if (getNodeCheckFlags(enclosingBlockScope) &
|
|
81712
|
+
if (getNodeCheckFlags(enclosingBlockScope) & 1048576 /* ContainsClassWithPrivateIdentifiers */) {
|
|
81702
81713
|
Debug.assert(isNamedDeclaration(node) && isIdentifier(node.name) && typeof node.name.escapedText === "string", "The target of a WeakMap/WeakSet collision check should be an identifier");
|
|
81703
81714
|
errorSkippedOn("noEmit", node, Diagnostics.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel, node.name.escapedText);
|
|
81704
81715
|
}
|
|
@@ -81712,18 +81723,18 @@ function createTypeChecker(host) {
|
|
|
81712
81723
|
let hasCollision = false;
|
|
81713
81724
|
if (isClassExpression(node)) {
|
|
81714
81725
|
for (const member of node.members) {
|
|
81715
|
-
if (getNodeCheckFlags(member) &
|
|
81726
|
+
if (getNodeCheckFlags(member) & 2097152 /* ContainsSuperPropertyInStaticInitializer */) {
|
|
81716
81727
|
hasCollision = true;
|
|
81717
81728
|
break;
|
|
81718
81729
|
}
|
|
81719
81730
|
}
|
|
81720
81731
|
} else if (isFunctionExpression(node)) {
|
|
81721
|
-
if (getNodeCheckFlags(node) &
|
|
81732
|
+
if (getNodeCheckFlags(node) & 2097152 /* ContainsSuperPropertyInStaticInitializer */) {
|
|
81722
81733
|
hasCollision = true;
|
|
81723
81734
|
}
|
|
81724
81735
|
} else {
|
|
81725
81736
|
const container = getEnclosingBlockScopeContainer(node);
|
|
81726
|
-
if (container && getNodeCheckFlags(container) &
|
|
81737
|
+
if (container && getNodeCheckFlags(container) & 2097152 /* ContainsSuperPropertyInStaticInitializer */) {
|
|
81727
81738
|
hasCollision = true;
|
|
81728
81739
|
}
|
|
81729
81740
|
}
|
|
@@ -85577,31 +85588,7 @@ function createTypeChecker(host) {
|
|
|
85577
85588
|
if (name.kind === 211 /* PropertyAccessExpression */) {
|
|
85578
85589
|
checkPropertyAccessExpression(name, 0 /* Normal */);
|
|
85579
85590
|
if (!links.resolvedSymbol) {
|
|
85580
|
-
|
|
85581
|
-
const infos = getApplicableIndexInfos(expressionType, getLiteralTypeFromPropertyName(name.name));
|
|
85582
|
-
if (infos.length && expressionType.members) {
|
|
85583
|
-
const resolved = resolveStructuredTypeMembers(expressionType);
|
|
85584
|
-
const symbol = resolved.members.get("__index" /* Index */);
|
|
85585
|
-
if (infos === getIndexInfosOfType(expressionType)) {
|
|
85586
|
-
links.resolvedSymbol = symbol;
|
|
85587
|
-
} else if (symbol) {
|
|
85588
|
-
const symbolLinks2 = getSymbolLinks(symbol);
|
|
85589
|
-
const declarationList = mapDefined(infos, (i) => i.declaration);
|
|
85590
|
-
const nodeListId = map(declarationList, getNodeId).join(",");
|
|
85591
|
-
if (!symbolLinks2.filteredIndexSymbolCache) {
|
|
85592
|
-
symbolLinks2.filteredIndexSymbolCache = /* @__PURE__ */ new Map();
|
|
85593
|
-
}
|
|
85594
|
-
if (symbolLinks2.filteredIndexSymbolCache.has(nodeListId)) {
|
|
85595
|
-
links.resolvedSymbol = symbolLinks2.filteredIndexSymbolCache.get(nodeListId);
|
|
85596
|
-
} else {
|
|
85597
|
-
const copy = createSymbol(131072 /* Signature */, "__index" /* Index */);
|
|
85598
|
-
copy.declarations = mapDefined(infos, (i) => i.declaration);
|
|
85599
|
-
copy.parent = expressionType.aliasSymbol ? expressionType.aliasSymbol : expressionType.symbol ? expressionType.symbol : getSymbolAtLocation(copy.declarations[0].parent);
|
|
85600
|
-
symbolLinks2.filteredIndexSymbolCache.set(nodeListId, copy);
|
|
85601
|
-
links.resolvedSymbol = symbolLinks2.filteredIndexSymbolCache.get(nodeListId);
|
|
85602
|
-
}
|
|
85603
|
-
}
|
|
85604
|
-
}
|
|
85591
|
+
links.resolvedSymbol = getApplicableIndexSymbol(checkExpressionCached(name.expression), getLiteralTypeFromPropertyName(name.name));
|
|
85605
85592
|
}
|
|
85606
85593
|
} else {
|
|
85607
85594
|
checkQualifiedName(name, 0 /* Normal */);
|
|
@@ -85634,6 +85621,31 @@ function createTypeChecker(host) {
|
|
|
85634
85621
|
}
|
|
85635
85622
|
return void 0;
|
|
85636
85623
|
}
|
|
85624
|
+
function getApplicableIndexSymbol(type, keyType) {
|
|
85625
|
+
const infos = getApplicableIndexInfos(type, keyType);
|
|
85626
|
+
if (infos.length && type.members) {
|
|
85627
|
+
const symbol = getIndexSymbolFromSymbolTable(resolveStructuredTypeMembers(type).members);
|
|
85628
|
+
if (infos === getIndexInfosOfType(type)) {
|
|
85629
|
+
return symbol;
|
|
85630
|
+
} else if (symbol) {
|
|
85631
|
+
const symbolLinks2 = getSymbolLinks(symbol);
|
|
85632
|
+
const declarationList = mapDefined(infos, (i) => i.declaration);
|
|
85633
|
+
const nodeListId = map(declarationList, getNodeId).join(",");
|
|
85634
|
+
if (!symbolLinks2.filteredIndexSymbolCache) {
|
|
85635
|
+
symbolLinks2.filteredIndexSymbolCache = /* @__PURE__ */ new Map();
|
|
85636
|
+
}
|
|
85637
|
+
if (symbolLinks2.filteredIndexSymbolCache.has(nodeListId)) {
|
|
85638
|
+
return symbolLinks2.filteredIndexSymbolCache.get(nodeListId);
|
|
85639
|
+
} else {
|
|
85640
|
+
const copy = createSymbol(131072 /* Signature */, "__index" /* Index */);
|
|
85641
|
+
copy.declarations = mapDefined(infos, (i) => i.declaration);
|
|
85642
|
+
copy.parent = type.aliasSymbol ? type.aliasSymbol : type.symbol ? type.symbol : getSymbolAtLocation(copy.declarations[0].parent);
|
|
85643
|
+
symbolLinks2.filteredIndexSymbolCache.set(nodeListId, copy);
|
|
85644
|
+
return copy;
|
|
85645
|
+
}
|
|
85646
|
+
}
|
|
85647
|
+
}
|
|
85648
|
+
}
|
|
85637
85649
|
function resolveJSDocMemberName(name, ignoreErrors, container) {
|
|
85638
85650
|
if (isEntityName(name)) {
|
|
85639
85651
|
const meaning = 788968 /* Type */ | 1920 /* Namespace */ | 111551 /* Value */;
|
|
@@ -86462,7 +86474,7 @@ function createTypeChecker(host) {
|
|
|
86462
86474
|
if (enumResult)
|
|
86463
86475
|
return enumResult;
|
|
86464
86476
|
const literalValue = type.value;
|
|
86465
|
-
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "
|
|
86477
|
+
return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "string" ? factory.createStringLiteral(literalValue) : literalValue < 0 ? factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(Math.abs(literalValue))) : factory.createNumericLiteral(literalValue);
|
|
86466
86478
|
}
|
|
86467
86479
|
function createLiteralConstValue(node, tracker) {
|
|
86468
86480
|
const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
|
|
@@ -93058,7 +93070,7 @@ function transformTypeScript(context) {
|
|
|
93058
93070
|
function transformEnumMemberDeclarationValue(member) {
|
|
93059
93071
|
const value = resolver.getConstantValue(member);
|
|
93060
93072
|
if (value !== void 0) {
|
|
93061
|
-
return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
|
|
93073
|
+
return typeof value === "string" ? factory2.createStringLiteral(value) : value < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(Math.abs(value))) : factory2.createNumericLiteral(value);
|
|
93062
93074
|
} else {
|
|
93063
93075
|
enableSubstitutionForNonQualifiedEnumMembers();
|
|
93064
93076
|
if (member.initializer) {
|
|
@@ -94013,6 +94025,11 @@ function transformClassFields(context) {
|
|
|
94013
94025
|
}
|
|
94014
94026
|
}
|
|
94015
94027
|
}
|
|
94028
|
+
function getClassThis() {
|
|
94029
|
+
const lex = getClassLexicalEnvironment();
|
|
94030
|
+
const classThis = lex.classThis ?? lex.classConstructor ?? (currentClassContainer == null ? void 0 : currentClassContainer.name);
|
|
94031
|
+
return Debug.checkDefined(classThis);
|
|
94032
|
+
}
|
|
94016
94033
|
function transformAutoAccessor(node) {
|
|
94017
94034
|
const commentRange = getCommentRange(node);
|
|
94018
94035
|
const sourceMapRange = getSourceMapRange(node);
|
|
@@ -94039,11 +94056,13 @@ function transformClassFields(context) {
|
|
|
94039
94056
|
setOriginalNode(backingField, node);
|
|
94040
94057
|
setEmitFlags(backingField, 3072 /* NoComments */);
|
|
94041
94058
|
setSourceMapRange(backingField, sourceMapRange);
|
|
94042
|
-
const
|
|
94059
|
+
const receiver = isStatic(node) ? getClassThis() : factory2.createThis();
|
|
94060
|
+
const getter = createAccessorPropertyGetRedirector(factory2, node, modifiers, getterName, receiver);
|
|
94043
94061
|
setOriginalNode(getter, node);
|
|
94044
94062
|
setCommentRange(getter, commentRange);
|
|
94045
94063
|
setSourceMapRange(getter, sourceMapRange);
|
|
94046
|
-
const
|
|
94064
|
+
const setterModifiers = factory2.createModifiersFromModifierFlags(modifiersToFlags(modifiers));
|
|
94065
|
+
const setter = createAccessorPropertySetRedirector(factory2, node, setterModifiers, setterName, receiver);
|
|
94047
94066
|
setOriginalNode(setter, node);
|
|
94048
94067
|
setEmitFlags(setter, 3072 /* NoComments */);
|
|
94049
94068
|
setSourceMapRange(setter, sourceMapRange);
|
|
@@ -94600,6 +94619,7 @@ function transformClassFields(context) {
|
|
|
94600
94619
|
return filter(node.members, isNonStaticMethodOrAccessorWithPrivateName);
|
|
94601
94620
|
}
|
|
94602
94621
|
function getClassFacts(node) {
|
|
94622
|
+
var _a;
|
|
94603
94623
|
let facts = 0 /* None */;
|
|
94604
94624
|
const original = getOriginalNode(node);
|
|
94605
94625
|
if (isClassDeclaration(original) && classOrConstructorParameterIsDecorated(legacyDecorators, original)) {
|
|
@@ -94616,6 +94636,8 @@ function transformClassFields(context) {
|
|
|
94616
94636
|
if (isStatic(member)) {
|
|
94617
94637
|
if (member.name && (isPrivateIdentifier(member.name) || isAutoAccessorPropertyDeclaration(member)) && shouldTransformPrivateElementsOrClassStaticBlocks) {
|
|
94618
94638
|
facts |= 2 /* NeedsClassConstructorReference */;
|
|
94639
|
+
} else if (isAutoAccessorPropertyDeclaration(member) && shouldTransformAutoAccessors === -1 /* True */ && !node.name && !((_a = node.emitNode) == null ? void 0 : _a.classThis)) {
|
|
94640
|
+
facts |= 2 /* NeedsClassConstructorReference */;
|
|
94619
94641
|
}
|
|
94620
94642
|
if (isPropertyDeclaration(member) || isClassStaticBlockDeclaration(member)) {
|
|
94621
94643
|
if (shouldTransformThisInStaticInitializers && member.transformFlags & 16384 /* ContainsLexicalThis */) {
|
|
@@ -94636,6 +94658,9 @@ function transformClassFields(context) {
|
|
|
94636
94658
|
containsInstancePrivateElements || (containsInstancePrivateElements = isPrivateIdentifierClassElementDeclaration(member));
|
|
94637
94659
|
} else if (isPrivateIdentifierClassElementDeclaration(member)) {
|
|
94638
94660
|
containsInstancePrivateElements = true;
|
|
94661
|
+
if (resolver.getNodeCheckFlags(member) & 262144 /* ContainsConstructorReference */) {
|
|
94662
|
+
facts |= 2 /* NeedsClassConstructorReference */;
|
|
94663
|
+
}
|
|
94639
94664
|
} else if (isPropertyDeclaration(member)) {
|
|
94640
94665
|
containsPublicInstanceFields = true;
|
|
94641
94666
|
containsInitializedPublicInstanceFields || (containsInitializedPublicInstanceFields = !!member.initializer);
|
|
@@ -94736,10 +94761,11 @@ function transformClassFields(context) {
|
|
|
94736
94761
|
getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp);
|
|
94737
94762
|
pendingClassReferenceAssignment = factory2.createAssignment(temp, factory2.getInternalName(node));
|
|
94738
94763
|
}
|
|
94739
|
-
if ((_b = node.emitNode) == null ? void 0 : _b.classThis) {
|
|
94740
|
-
getClassLexicalEnvironment().classThis = node.emitNode.classThis;
|
|
94741
|
-
}
|
|
94742
94764
|
}
|
|
94765
|
+
if ((_b = node.emitNode) == null ? void 0 : _b.classThis) {
|
|
94766
|
+
getClassLexicalEnvironment().classThis = node.emitNode.classThis;
|
|
94767
|
+
}
|
|
94768
|
+
const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 262144 /* ContainsConstructorReference */;
|
|
94743
94769
|
const isExport = hasSyntacticModifier(node, 1 /* Export */);
|
|
94744
94770
|
const isDefault = hasSyntacticModifier(node, 1024 /* Default */);
|
|
94745
94771
|
let modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier);
|
|
@@ -94774,6 +94800,11 @@ function transformClassFields(context) {
|
|
|
94774
94800
|
)
|
|
94775
94801
|
));
|
|
94776
94802
|
}
|
|
94803
|
+
const alias = getClassLexicalEnvironment().classConstructor;
|
|
94804
|
+
if (isClassWithConstructorReference && alias) {
|
|
94805
|
+
enableSubstitutionForClassAliases();
|
|
94806
|
+
classAliases[getOriginalNodeId(node)] = alias;
|
|
94807
|
+
}
|
|
94777
94808
|
const classDecl = factory2.updateClassDeclaration(
|
|
94778
94809
|
node,
|
|
94779
94810
|
modifiers,
|
|
@@ -94796,14 +94827,14 @@ function transformClassFields(context) {
|
|
|
94796
94827
|
var _a, _b, _c;
|
|
94797
94828
|
const isDecoratedClassDeclaration = !!(facts & 1 /* ClassWasDecorated */);
|
|
94798
94829
|
const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node);
|
|
94799
|
-
const
|
|
94830
|
+
const classCheckFlags = resolver.getNodeCheckFlags(node);
|
|
94831
|
+
const isClassWithConstructorReference = classCheckFlags & 262144 /* ContainsConstructorReference */;
|
|
94800
94832
|
let temp;
|
|
94801
94833
|
function createClassTempVar() {
|
|
94802
94834
|
var _a2;
|
|
94803
94835
|
if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_a2 = node.emitNode) == null ? void 0 : _a2.classThis)) {
|
|
94804
94836
|
return getClassLexicalEnvironment().classConstructor = node.emitNode.classThis;
|
|
94805
94837
|
}
|
|
94806
|
-
const classCheckFlags = resolver.getNodeCheckFlags(node);
|
|
94807
94838
|
const requiresBlockScopedVar = classCheckFlags & 32768 /* BlockScopedBindingInLoop */;
|
|
94808
94839
|
const temp2 = factory2.createTempVariable(
|
|
94809
94840
|
requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration,
|
|
@@ -95770,7 +95801,7 @@ function transformClassFields(context) {
|
|
|
95770
95801
|
}
|
|
95771
95802
|
function trySubstituteClassAlias(node) {
|
|
95772
95803
|
if (enabledSubstitutions & 1 /* ClassAliases */) {
|
|
95773
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
95804
|
+
if (resolver.getNodeCheckFlags(node) & 536870912 /* ConstructorReference */) {
|
|
95774
95805
|
const declaration = resolver.getReferencedValueDeclaration(node);
|
|
95775
95806
|
if (declaration) {
|
|
95776
95807
|
const classAlias = classAliases[declaration.id];
|
|
@@ -96624,7 +96655,7 @@ function transformLegacyDecorators(context) {
|
|
|
96624
96655
|
}
|
|
96625
96656
|
}
|
|
96626
96657
|
function getClassAliasIfNeeded(node) {
|
|
96627
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
96658
|
+
if (resolver.getNodeCheckFlags(node) & 262144 /* ContainsConstructorReference */) {
|
|
96628
96659
|
enableSubstitutionForClassAliases();
|
|
96629
96660
|
const classAlias = factory2.createUniqueName(node.name && !isGeneratedIdentifier(node.name) ? idText(node.name) : "default");
|
|
96630
96661
|
classAliases[getOriginalNodeId(node)] = classAlias;
|
|
@@ -96657,7 +96688,7 @@ function transformLegacyDecorators(context) {
|
|
|
96657
96688
|
}
|
|
96658
96689
|
function trySubstituteClassAlias(node) {
|
|
96659
96690
|
if (classAliases) {
|
|
96660
|
-
if (resolver.getNodeCheckFlags(node) &
|
|
96691
|
+
if (resolver.getNodeCheckFlags(node) & 536870912 /* ConstructorReference */) {
|
|
96661
96692
|
const declaration = resolver.getReferencedValueDeclaration(node);
|
|
96662
96693
|
if (declaration) {
|
|
96663
96694
|
const classAlias = classAliases[declaration.id];
|
|
@@ -96683,6 +96714,7 @@ function transformESDecorators(context) {
|
|
|
96683
96714
|
endLexicalEnvironment,
|
|
96684
96715
|
hoistVariableDeclaration
|
|
96685
96716
|
} = context;
|
|
96717
|
+
const languageVersion = getEmitScriptTarget(context.getCompilerOptions());
|
|
96686
96718
|
let top;
|
|
96687
96719
|
let classInfo;
|
|
96688
96720
|
let classThis;
|
|
@@ -98184,6 +98216,17 @@ function transformESDecorators(context) {
|
|
|
98184
98216
|
function transformDecorator(decorator) {
|
|
98185
98217
|
const expression = visitNode(decorator.expression, visitor, isExpression);
|
|
98186
98218
|
setEmitFlags(expression, 3072 /* NoComments */);
|
|
98219
|
+
const innerExpression = skipOuterExpressions(expression);
|
|
98220
|
+
if (isAccessExpression(innerExpression)) {
|
|
98221
|
+
const { target, thisArg } = factory2.createCallBinding(
|
|
98222
|
+
expression,
|
|
98223
|
+
hoistVariableDeclaration,
|
|
98224
|
+
languageVersion,
|
|
98225
|
+
/*cacheIdentifiers*/
|
|
98226
|
+
true
|
|
98227
|
+
);
|
|
98228
|
+
return factory2.restoreOuterExpressions(expression, factory2.createFunctionBindCall(target, thisArg, []));
|
|
98229
|
+
}
|
|
98187
98230
|
return expression;
|
|
98188
98231
|
}
|
|
98189
98232
|
function createDescriptorMethod(original, name, modifiers, asteriskToken, kind, parameters, body) {
|
|
@@ -104827,10 +104870,10 @@ function transformES2015(context) {
|
|
|
104827
104870
|
name
|
|
104828
104871
|
));
|
|
104829
104872
|
const checkFlags = resolver.getNodeCheckFlags(decl);
|
|
104830
|
-
if (checkFlags &
|
|
104873
|
+
if (checkFlags & 65536 /* NeedsLoopOutParameter */ || hasCapturedBindingsInForHead) {
|
|
104831
104874
|
const outParamName = factory2.createUniqueName("out_" + idText(name));
|
|
104832
104875
|
let flags = 0 /* None */;
|
|
104833
|
-
if (checkFlags &
|
|
104876
|
+
if (checkFlags & 65536 /* NeedsLoopOutParameter */) {
|
|
104834
104877
|
flags |= 1 /* Body */;
|
|
104835
104878
|
}
|
|
104836
104879
|
if (isForStatement(container)) {
|
|
@@ -107038,7 +107081,7 @@ function transformGenerators(context) {
|
|
|
107038
107081
|
if (labelExpressions === void 0) {
|
|
107039
107082
|
labelExpressions = [];
|
|
107040
107083
|
}
|
|
107041
|
-
const expression = factory2.createNumericLiteral(
|
|
107084
|
+
const expression = factory2.createNumericLiteral(Number.MAX_SAFE_INTEGER);
|
|
107042
107085
|
if (labelExpressions[label] === void 0) {
|
|
107043
107086
|
labelExpressions[label] = [expression];
|
|
107044
107087
|
} else {
|
|
@@ -112896,7 +112939,8 @@ function transformDeclarations(context) {
|
|
|
112896
112939
|
if (shouldStripInternal(m))
|
|
112897
112940
|
return;
|
|
112898
112941
|
const constValue = resolver.getConstantValue(m);
|
|
112899
|
-
|
|
112942
|
+
const newInitializer = constValue === void 0 ? void 0 : typeof constValue === "string" ? factory2.createStringLiteral(constValue) : constValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(Math.abs(constValue))) : factory2.createNumericLiteral(constValue);
|
|
112943
|
+
return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
|
|
112900
112944
|
}))));
|
|
112901
112945
|
}
|
|
112902
112946
|
}
|
|
@@ -164745,8 +164789,10 @@ function provideInlayHints(context) {
|
|
|
164745
164789
|
}
|
|
164746
164790
|
function addParameterHints(text, parameter, position, isFirstVariadicArgument, sourceFile) {
|
|
164747
164791
|
let hintText = `${isFirstVariadicArgument ? "..." : ""}${text}`;
|
|
164792
|
+
let displayParts;
|
|
164748
164793
|
if (shouldUseInteractiveInlayHints(preferences)) {
|
|
164749
|
-
|
|
164794
|
+
displayParts = [getNodeDisplayPart(hintText, parameter, sourceFile), { text: ":" }];
|
|
164795
|
+
hintText = "";
|
|
164750
164796
|
} else {
|
|
164751
164797
|
hintText += ":";
|
|
164752
164798
|
}
|
|
@@ -164754,7 +164800,8 @@ function provideInlayHints(context) {
|
|
|
164754
164800
|
text: hintText,
|
|
164755
164801
|
position,
|
|
164756
164802
|
kind: "Parameter" /* Parameter */,
|
|
164757
|
-
whitespaceAfter: true
|
|
164803
|
+
whitespaceAfter: true,
|
|
164804
|
+
displayParts
|
|
164758
164805
|
});
|
|
164759
164806
|
}
|
|
164760
164807
|
function addTypeHints(text, position) {
|
|
@@ -183642,19 +183689,18 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
|
|
|
183642
183689
|
const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file);
|
|
183643
183690
|
const hints = project.getLanguageService().provideInlayHints(file, args, this.getPreferences(file));
|
|
183644
183691
|
return hints.map((hint) => {
|
|
183645
|
-
const {
|
|
183646
|
-
const hintText = typeof text === "string" ? text : text.map(({ text: text2, span, file: file2 }) => ({
|
|
183647
|
-
text: text2,
|
|
183648
|
-
span: span && {
|
|
183649
|
-
start: scriptInfo.positionToLineOffset(span.start),
|
|
183650
|
-
end: scriptInfo.positionToLineOffset(span.start + span.length),
|
|
183651
|
-
file: file2
|
|
183652
|
-
}
|
|
183653
|
-
}));
|
|
183692
|
+
const { position, displayParts } = hint;
|
|
183654
183693
|
return {
|
|
183655
183694
|
...hint,
|
|
183656
183695
|
position: scriptInfo.positionToLineOffset(position),
|
|
183657
|
-
text:
|
|
183696
|
+
displayParts: displayParts == null ? void 0 : displayParts.map(({ text, span, file: file2 }) => ({
|
|
183697
|
+
text,
|
|
183698
|
+
span: span && {
|
|
183699
|
+
start: scriptInfo.positionToLineOffset(span.start),
|
|
183700
|
+
end: scriptInfo.positionToLineOffset(span.start + span.length),
|
|
183701
|
+
file: file2
|
|
183702
|
+
}
|
|
183703
|
+
}))
|
|
183658
183704
|
};
|
|
183659
183705
|
});
|
|
183660
183706
|
}
|