typescript 5.4.0-dev.20240112 → 5.4.0-dev.20240114
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lib.es5.d.ts +5 -0
- package/lib/tsc.js +102 -286
- package/lib/tsserver.js +102 -286
- package/lib/typescript.js +102 -286
- package/lib/typingsInstaller.js +3 -2
- package/package.json +2 -2
package/lib/lib.es5.d.ts
CHANGED
|
@@ -1666,6 +1666,11 @@ type Capitalize<S extends string> = intrinsic;
|
|
|
1666
1666
|
*/
|
|
1667
1667
|
type Uncapitalize<S extends string> = intrinsic;
|
|
1668
1668
|
|
|
1669
|
+
/**
|
|
1670
|
+
* Marker for non-inference type position
|
|
1671
|
+
*/
|
|
1672
|
+
type NoInfer<T> = intrinsic;
|
|
1673
|
+
|
|
1669
1674
|
/**
|
|
1670
1675
|
* Marker for contextual 'this' type
|
|
1671
1676
|
*/
|
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.4";
|
|
21
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
21
|
+
var version = `${versionMajorMinor}.0-dev.20240114`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -43562,7 +43562,8 @@ var intrinsicTypeKinds = new Map(Object.entries({
|
|
|
43562
43562
|
Uppercase: 0 /* Uppercase */,
|
|
43563
43563
|
Lowercase: 1 /* Lowercase */,
|
|
43564
43564
|
Capitalize: 2 /* Capitalize */,
|
|
43565
|
-
Uncapitalize: 3 /* Uncapitalize
|
|
43565
|
+
Uncapitalize: 3 /* Uncapitalize */,
|
|
43566
|
+
NoInfer: 4 /* NoInfer */
|
|
43566
43567
|
}));
|
|
43567
43568
|
var SymbolLinks = class {
|
|
43568
43569
|
};
|
|
@@ -47928,16 +47929,12 @@ function createTypeChecker(host) {
|
|
|
47928
47929
|
}
|
|
47929
47930
|
function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) {
|
|
47930
47931
|
let aliasesToMakeVisible;
|
|
47931
|
-
let bindingElementToMakeVisible;
|
|
47932
47932
|
if (!every(filter(symbol.declarations, (d) => d.kind !== 80 /* Identifier */), getIsDeclarationVisible)) {
|
|
47933
47933
|
return void 0;
|
|
47934
47934
|
}
|
|
47935
|
-
return { accessibility: 0 /* Accessible */, aliasesToMakeVisible
|
|
47935
|
+
return { accessibility: 0 /* Accessible */, aliasesToMakeVisible };
|
|
47936
47936
|
function getIsDeclarationVisible(declaration) {
|
|
47937
47937
|
var _a, _b;
|
|
47938
|
-
if (isBindingElement(declaration) && findAncestor(declaration, isParameter)) {
|
|
47939
|
-
bindingElementToMakeVisible = declaration;
|
|
47940
|
-
}
|
|
47941
47938
|
if (!isDeclarationVisible(declaration)) {
|
|
47942
47939
|
const anyImportSyntax = getAnyImportSyntax(declaration);
|
|
47943
47940
|
if (anyImportSyntax && !hasSyntacticModifier(anyImportSyntax, 32 /* Export */) && // import clause without export
|
|
@@ -48448,7 +48445,13 @@ function createTypeChecker(host) {
|
|
|
48448
48445
|
return visitAndTransformType(type, (type2) => conditionalTypeToTypeNode(type2));
|
|
48449
48446
|
}
|
|
48450
48447
|
if (type.flags & 33554432 /* Substitution */) {
|
|
48451
|
-
|
|
48448
|
+
const typeNode = typeToTypeNodeHelper(type.baseType, context);
|
|
48449
|
+
const noInferSymbol = isNoInferType(type) && getGlobalTypeSymbol(
|
|
48450
|
+
"NoInfer",
|
|
48451
|
+
/*reportErrors*/
|
|
48452
|
+
false
|
|
48453
|
+
);
|
|
48454
|
+
return noInferSymbol ? symbolToTypeNode(noInferSymbol, context, 788968 /* Type */, [typeNode]) : typeNode;
|
|
48452
48455
|
}
|
|
48453
48456
|
return Debug.fail("Should be unreachable.");
|
|
48454
48457
|
function conditionalTypeToTypeNode(type2) {
|
|
@@ -56418,8 +56421,11 @@ function createTypeChecker(host) {
|
|
|
56418
56421
|
}
|
|
56419
56422
|
function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) {
|
|
56420
56423
|
const type = getDeclaredTypeOfSymbol(symbol);
|
|
56421
|
-
if (type === intrinsicMarkerType
|
|
56422
|
-
|
|
56424
|
+
if (type === intrinsicMarkerType) {
|
|
56425
|
+
const typeKind = intrinsicTypeKinds.get(symbol.escapedName);
|
|
56426
|
+
if (typeKind !== void 0 && typeArguments && typeArguments.length === 1) {
|
|
56427
|
+
return typeKind === 4 /* NoInfer */ ? getNoInferType(typeArguments[0]) : getStringMappingType(symbol, typeArguments[0]);
|
|
56428
|
+
}
|
|
56423
56429
|
}
|
|
56424
56430
|
const links = getSymbolLinks(symbol);
|
|
56425
56431
|
const typeParameters = links.typeParameters;
|
|
@@ -56573,10 +56579,19 @@ function createTypeChecker(host) {
|
|
|
56573
56579
|
}
|
|
56574
56580
|
return links.resolvedJSDocType;
|
|
56575
56581
|
}
|
|
56582
|
+
function getNoInferType(type) {
|
|
56583
|
+
return isNoInferTargetType(type) ? getOrCreateSubstitutionType(type, unknownType) : type;
|
|
56584
|
+
}
|
|
56585
|
+
function isNoInferTargetType(type) {
|
|
56586
|
+
return !!(type.flags & 3145728 /* UnionOrIntersection */ && some(type.types, isNoInferTargetType) || type.flags & 33554432 /* Substitution */ && !isNoInferType(type) && isNoInferTargetType(type.baseType) || type.flags & 524288 /* Object */ && !isEmptyAnonymousObjectType(type) || type.flags & (465829888 /* Instantiable */ & ~33554432 /* Substitution */) && !isPatternLiteralType(type));
|
|
56587
|
+
}
|
|
56588
|
+
function isNoInferType(type) {
|
|
56589
|
+
return !!(type.flags & 33554432 /* Substitution */ && type.constraint.flags & 2 /* Unknown */);
|
|
56590
|
+
}
|
|
56576
56591
|
function getSubstitutionType(baseType, constraint) {
|
|
56577
|
-
|
|
56578
|
-
|
|
56579
|
-
|
|
56592
|
+
return constraint.flags & 3 /* AnyOrUnknown */ || constraint === baseType || baseType.flags & 1 /* Any */ ? baseType : getOrCreateSubstitutionType(baseType, constraint);
|
|
56593
|
+
}
|
|
56594
|
+
function getOrCreateSubstitutionType(baseType, constraint) {
|
|
56580
56595
|
const id = `${getTypeId(baseType)}>${getTypeId(constraint)}`;
|
|
56581
56596
|
const cached = substitutionTypes.get(id);
|
|
56582
56597
|
if (cached) {
|
|
@@ -56589,7 +56604,7 @@ function createTypeChecker(host) {
|
|
|
56589
56604
|
return result;
|
|
56590
56605
|
}
|
|
56591
56606
|
function getSubstitutionIntersection(substitutionType) {
|
|
56592
|
-
return getIntersectionType([substitutionType.constraint, substitutionType.baseType]);
|
|
56607
|
+
return isNoInferType(substitutionType) ? substitutionType.baseType : getIntersectionType([substitutionType.constraint, substitutionType.baseType]);
|
|
56593
56608
|
}
|
|
56594
56609
|
function isUnaryTupleTypeNode(node) {
|
|
56595
56610
|
return node.kind === 189 /* TupleType */ && node.elements.length === 1;
|
|
@@ -58118,7 +58133,7 @@ function createTypeChecker(host) {
|
|
|
58118
58133
|
}
|
|
58119
58134
|
function getIndexType(type, indexFlags = defaultIndexFlags) {
|
|
58120
58135
|
type = getReducedType(type);
|
|
58121
|
-
return shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType : getLiteralTypeFromProperties(type, (indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */), indexFlags === defaultIndexFlags);
|
|
58136
|
+
return isNoInferType(type) ? getNoInferType(getIndexType(type.baseType, indexFlags)) : shouldDeferIndexType(type, indexFlags) ? getIndexTypeForGenericType(type, indexFlags) : type.flags & 1048576 /* Union */ ? getIntersectionType(map(type.types, (t) => getIndexType(t, indexFlags))) : type.flags & 2097152 /* Intersection */ ? getUnionType(map(type.types, (t) => getIndexType(t, indexFlags))) : getObjectFlags(type) & 32 /* Mapped */ ? getIndexTypeForMappedType(type, indexFlags) : type === wildcardType ? wildcardType : type.flags & 2 /* Unknown */ ? neverType : type.flags & (1 /* Any */ | 131072 /* Never */) ? keyofConstraintType : getLiteralTypeFromProperties(type, (indexFlags & 2 /* NoIndexSignatures */ ? 128 /* StringLiteral */ : 402653316 /* StringLike */) | (indexFlags & 1 /* StringsOnly */ ? 0 : 296 /* NumberLike */ | 12288 /* ESSymbolLike */), indexFlags === defaultIndexFlags);
|
|
58122
58137
|
}
|
|
58123
58138
|
function getExtractStringType(type) {
|
|
58124
58139
|
if (keyofStringsOnly) {
|
|
@@ -59861,6 +59876,9 @@ function createTypeChecker(host) {
|
|
|
59861
59876
|
}
|
|
59862
59877
|
if (flags & 33554432 /* Substitution */) {
|
|
59863
59878
|
const newBaseType = instantiateType(type.baseType, mapper);
|
|
59879
|
+
if (isNoInferType(type)) {
|
|
59880
|
+
return getNoInferType(newBaseType);
|
|
59881
|
+
}
|
|
59864
59882
|
const newConstraint = instantiateType(type.constraint, mapper);
|
|
59865
59883
|
if (newBaseType.flags & 8650752 /* TypeVariable */ && isGenericType(newConstraint)) {
|
|
59866
59884
|
return getSubstitutionType(newBaseType, newConstraint);
|
|
@@ -64653,7 +64671,7 @@ function createTypeChecker(host) {
|
|
|
64653
64671
|
let expandingFlags = 0 /* None */;
|
|
64654
64672
|
inferFromTypes(originalSource, originalTarget);
|
|
64655
64673
|
function inferFromTypes(source, target) {
|
|
64656
|
-
if (!couldContainTypeVariables(target)) {
|
|
64674
|
+
if (!couldContainTypeVariables(target) || isNoInferType(target)) {
|
|
64657
64675
|
return;
|
|
64658
64676
|
}
|
|
64659
64677
|
if (source === wildcardType || source === blockedStringType) {
|
|
@@ -64702,6 +64720,9 @@ function createTypeChecker(host) {
|
|
|
64702
64720
|
}
|
|
64703
64721
|
}
|
|
64704
64722
|
if (target.flags & (8388608 /* IndexedAccess */ | 33554432 /* Substitution */)) {
|
|
64723
|
+
if (isNoInferType(target)) {
|
|
64724
|
+
return;
|
|
64725
|
+
}
|
|
64705
64726
|
target = getActualTypeVariable(target);
|
|
64706
64727
|
}
|
|
64707
64728
|
if (target.flags & 8650752 /* TypeVariable */) {
|
|
@@ -108495,7 +108516,6 @@ function transformDeclarations(context) {
|
|
|
108495
108516
|
let lateStatementReplacementMap;
|
|
108496
108517
|
let suppressNewDiagnosticContexts;
|
|
108497
108518
|
let exportedModulesFromDeclarationEmit;
|
|
108498
|
-
const usedBindingElementAliases = /* @__PURE__ */ new Map();
|
|
108499
108519
|
const { factory: factory2 } = context;
|
|
108500
108520
|
const host = context.getEmitHost();
|
|
108501
108521
|
const symbolTracker = {
|
|
@@ -108561,17 +108581,6 @@ function transformDeclarations(context) {
|
|
|
108561
108581
|
}
|
|
108562
108582
|
}
|
|
108563
108583
|
}
|
|
108564
|
-
if (symbolAccessibilityResult.bindingElementToMakeVisible) {
|
|
108565
|
-
const bindingElement = symbolAccessibilityResult.bindingElementToMakeVisible;
|
|
108566
|
-
const parameter = findAncestor(bindingElement, isParameter);
|
|
108567
|
-
Debug.assert(parameter !== void 0);
|
|
108568
|
-
const parent = getOriginalNode(parameter.parent);
|
|
108569
|
-
let aliases = usedBindingElementAliases.get(parent);
|
|
108570
|
-
if (!aliases) {
|
|
108571
|
-
usedBindingElementAliases.set(parent, aliases = /* @__PURE__ */ new Map());
|
|
108572
|
-
}
|
|
108573
|
-
aliases.set(getOriginalNode(bindingElement), bindingElement.name);
|
|
108574
|
-
}
|
|
108575
108584
|
} else {
|
|
108576
108585
|
const errorInfo = getSymbolAccessibilityDiagnostic(symbolAccessibilityResult);
|
|
108577
108586
|
if (errorInfo) {
|
|
@@ -108904,7 +108913,7 @@ function transformDeclarations(context) {
|
|
|
108904
108913
|
});
|
|
108905
108914
|
return ret;
|
|
108906
108915
|
}
|
|
108907
|
-
function
|
|
108916
|
+
function filterBindingPatternInitializers(name) {
|
|
108908
108917
|
if (name.kind === 80 /* Identifier */) {
|
|
108909
108918
|
return name;
|
|
108910
108919
|
} else {
|
|
@@ -108921,180 +108930,15 @@ function transformDeclarations(context) {
|
|
|
108921
108930
|
if (elem.propertyName && isComputedPropertyName(elem.propertyName) && isEntityNameExpression(elem.propertyName.expression)) {
|
|
108922
108931
|
checkEntityNameVisibility(elem.propertyName.expression, enclosingDeclaration);
|
|
108923
108932
|
}
|
|
108924
|
-
if (elem.propertyName && isIdentifier(elem.propertyName) && isIdentifier(elem.name) && !isIdentifierANonContextualKeyword(elem.propertyName)) {
|
|
108925
|
-
return factory2.updateBindingElement(
|
|
108926
|
-
elem,
|
|
108927
|
-
elem.dotDotDotToken,
|
|
108928
|
-
/*propertyName*/
|
|
108929
|
-
void 0,
|
|
108930
|
-
elem.propertyName,
|
|
108931
|
-
shouldPrintWithInitializer(elem) ? elem.initializer : void 0
|
|
108932
|
-
);
|
|
108933
|
-
}
|
|
108934
108933
|
return factory2.updateBindingElement(
|
|
108935
108934
|
elem,
|
|
108936
108935
|
elem.dotDotDotToken,
|
|
108937
108936
|
elem.propertyName,
|
|
108938
|
-
|
|
108937
|
+
filterBindingPatternInitializers(elem.name),
|
|
108939
108938
|
shouldPrintWithInitializer(elem) ? elem.initializer : void 0
|
|
108940
108939
|
);
|
|
108941
108940
|
}
|
|
108942
108941
|
}
|
|
108943
|
-
function ensureBindingAliasesInParameterList(input, updatedNode) {
|
|
108944
|
-
const original = getOriginalNode(input);
|
|
108945
|
-
const params = updatedNode.parameters;
|
|
108946
|
-
const aliases = usedBindingElementAliases.get(original);
|
|
108947
|
-
if (!aliases) {
|
|
108948
|
-
return updatedNode;
|
|
108949
|
-
}
|
|
108950
|
-
usedBindingElementAliases.delete(original);
|
|
108951
|
-
const newParams = map(params, addUsedBindingPatternsToParameter);
|
|
108952
|
-
const newParamsNodeArray = factory2.createNodeArray(newParams, params.hasTrailingComma);
|
|
108953
|
-
switch (updatedNode.kind) {
|
|
108954
|
-
case 174 /* MethodDeclaration */:
|
|
108955
|
-
return factory2.updateMethodDeclaration(
|
|
108956
|
-
updatedNode,
|
|
108957
|
-
updatedNode.modifiers,
|
|
108958
|
-
updatedNode.asteriskToken,
|
|
108959
|
-
updatedNode.name,
|
|
108960
|
-
updatedNode.questionToken,
|
|
108961
|
-
updatedNode.typeParameters,
|
|
108962
|
-
newParamsNodeArray,
|
|
108963
|
-
updatedNode.type,
|
|
108964
|
-
updatedNode.body
|
|
108965
|
-
);
|
|
108966
|
-
case 176 /* Constructor */:
|
|
108967
|
-
return factory2.updateConstructorDeclaration(
|
|
108968
|
-
updatedNode,
|
|
108969
|
-
updatedNode.modifiers,
|
|
108970
|
-
newParamsNodeArray,
|
|
108971
|
-
updatedNode.body
|
|
108972
|
-
);
|
|
108973
|
-
case 177 /* GetAccessor */:
|
|
108974
|
-
return factory2.updateGetAccessorDeclaration(
|
|
108975
|
-
updatedNode,
|
|
108976
|
-
updatedNode.modifiers,
|
|
108977
|
-
updatedNode.name,
|
|
108978
|
-
newParamsNodeArray,
|
|
108979
|
-
updatedNode.type,
|
|
108980
|
-
updatedNode.body
|
|
108981
|
-
);
|
|
108982
|
-
case 178 /* SetAccessor */:
|
|
108983
|
-
return factory2.updateSetAccessorDeclaration(
|
|
108984
|
-
updatedNode,
|
|
108985
|
-
updatedNode.modifiers,
|
|
108986
|
-
updatedNode.name,
|
|
108987
|
-
newParamsNodeArray,
|
|
108988
|
-
updatedNode.body
|
|
108989
|
-
);
|
|
108990
|
-
case 219 /* ArrowFunction */:
|
|
108991
|
-
return factory2.updateArrowFunction(
|
|
108992
|
-
updatedNode,
|
|
108993
|
-
updatedNode.modifiers,
|
|
108994
|
-
updatedNode.typeParameters,
|
|
108995
|
-
newParamsNodeArray,
|
|
108996
|
-
updatedNode.type,
|
|
108997
|
-
updatedNode.equalsGreaterThanToken,
|
|
108998
|
-
updatedNode.body
|
|
108999
|
-
);
|
|
109000
|
-
case 262 /* FunctionDeclaration */:
|
|
109001
|
-
return factory2.updateFunctionDeclaration(
|
|
109002
|
-
updatedNode,
|
|
109003
|
-
updatedNode.modifiers,
|
|
109004
|
-
updatedNode.asteriskToken,
|
|
109005
|
-
updatedNode.name,
|
|
109006
|
-
updatedNode.typeParameters,
|
|
109007
|
-
newParamsNodeArray,
|
|
109008
|
-
updatedNode.type,
|
|
109009
|
-
updatedNode.body
|
|
109010
|
-
);
|
|
109011
|
-
case 179 /* CallSignature */:
|
|
109012
|
-
return factory2.updateCallSignature(
|
|
109013
|
-
updatedNode,
|
|
109014
|
-
updatedNode.typeParameters,
|
|
109015
|
-
newParamsNodeArray,
|
|
109016
|
-
updatedNode.type
|
|
109017
|
-
);
|
|
109018
|
-
case 173 /* MethodSignature */:
|
|
109019
|
-
return factory2.updateMethodSignature(
|
|
109020
|
-
updatedNode,
|
|
109021
|
-
updatedNode.modifiers,
|
|
109022
|
-
updatedNode.name,
|
|
109023
|
-
updatedNode.questionToken,
|
|
109024
|
-
updatedNode.typeParameters,
|
|
109025
|
-
newParamsNodeArray,
|
|
109026
|
-
updatedNode.type
|
|
109027
|
-
);
|
|
109028
|
-
case 180 /* ConstructSignature */:
|
|
109029
|
-
return factory2.updateConstructSignature(
|
|
109030
|
-
updatedNode,
|
|
109031
|
-
updatedNode.typeParameters,
|
|
109032
|
-
newParamsNodeArray,
|
|
109033
|
-
updatedNode.type
|
|
109034
|
-
);
|
|
109035
|
-
case 184 /* FunctionType */:
|
|
109036
|
-
return factory2.updateFunctionTypeNode(
|
|
109037
|
-
updatedNode,
|
|
109038
|
-
updatedNode.typeParameters,
|
|
109039
|
-
newParamsNodeArray,
|
|
109040
|
-
updatedNode.type
|
|
109041
|
-
);
|
|
109042
|
-
case 185 /* ConstructorType */:
|
|
109043
|
-
return factory2.updateConstructorTypeNode(
|
|
109044
|
-
updatedNode,
|
|
109045
|
-
updatedNode.modifiers,
|
|
109046
|
-
updatedNode.typeParameters,
|
|
109047
|
-
newParamsNodeArray,
|
|
109048
|
-
updatedNode.type
|
|
109049
|
-
);
|
|
109050
|
-
default:
|
|
109051
|
-
Debug.assertNever(updatedNode);
|
|
109052
|
-
}
|
|
109053
|
-
function addUsedBindingPatternsToParameter(p) {
|
|
109054
|
-
return factory2.updateParameterDeclaration(
|
|
109055
|
-
p,
|
|
109056
|
-
p.modifiers,
|
|
109057
|
-
p.dotDotDotToken,
|
|
109058
|
-
addUsedBindingPatternAliases(p.name),
|
|
109059
|
-
p.questionToken,
|
|
109060
|
-
p.type,
|
|
109061
|
-
p.initializer
|
|
109062
|
-
);
|
|
109063
|
-
}
|
|
109064
|
-
function addUsedBindingPatternAliases(name) {
|
|
109065
|
-
if (name.kind === 80 /* Identifier */) {
|
|
109066
|
-
return name;
|
|
109067
|
-
} else {
|
|
109068
|
-
if (name.kind === 207 /* ArrayBindingPattern */) {
|
|
109069
|
-
return factory2.updateArrayBindingPattern(name, visitNodes2(name.elements, visitBindingElement, isArrayBindingElement));
|
|
109070
|
-
} else {
|
|
109071
|
-
return factory2.updateObjectBindingPattern(name, visitNodes2(name.elements, visitBindingElement, isBindingElement));
|
|
109072
|
-
}
|
|
109073
|
-
}
|
|
109074
|
-
function visitBindingElement(elem) {
|
|
109075
|
-
if (elem.kind === 232 /* OmittedExpression */) {
|
|
109076
|
-
return elem;
|
|
109077
|
-
}
|
|
109078
|
-
const usedAlias = aliases.get(getOriginalNode(elem));
|
|
109079
|
-
if (usedAlias && !elem.propertyName) {
|
|
109080
|
-
return factory2.updateBindingElement(
|
|
109081
|
-
elem,
|
|
109082
|
-
elem.dotDotDotToken,
|
|
109083
|
-
elem.name,
|
|
109084
|
-
usedAlias,
|
|
109085
|
-
elem.initializer
|
|
109086
|
-
);
|
|
109087
|
-
}
|
|
109088
|
-
return factory2.updateBindingElement(
|
|
109089
|
-
elem,
|
|
109090
|
-
elem.dotDotDotToken,
|
|
109091
|
-
elem.propertyName,
|
|
109092
|
-
addUsedBindingPatternAliases(elem.name),
|
|
109093
|
-
elem.initializer
|
|
109094
|
-
);
|
|
109095
|
-
}
|
|
109096
|
-
}
|
|
109097
|
-
}
|
|
109098
108942
|
function ensureParameter(p, modifierMask, type) {
|
|
109099
108943
|
let oldDiag;
|
|
109100
108944
|
if (!suppressNewDiagnosticContexts) {
|
|
@@ -109105,7 +108949,7 @@ function transformDeclarations(context) {
|
|
|
109105
108949
|
p,
|
|
109106
108950
|
maskModifiers(factory2, p, modifierMask),
|
|
109107
108951
|
p.dotDotDotToken,
|
|
109108
|
-
|
|
108952
|
+
filterBindingPatternInitializers(p.name),
|
|
109109
108953
|
resolver.isOptionalParameter(p) ? p.questionToken || factory2.createToken(58 /* QuestionToken */) : void 0,
|
|
109110
108954
|
ensureType(
|
|
109111
108955
|
p,
|
|
@@ -109481,25 +109325,19 @@ function transformDeclarations(context) {
|
|
|
109481
109325
|
return cleanup(factory2.updateTypeReferenceNode(node, node.typeName, node.typeArguments));
|
|
109482
109326
|
}
|
|
109483
109327
|
case 180 /* ConstructSignature */:
|
|
109484
|
-
return cleanup(
|
|
109328
|
+
return cleanup(factory2.updateConstructSignature(
|
|
109485
109329
|
input,
|
|
109486
|
-
|
|
109487
|
-
|
|
109488
|
-
|
|
109489
|
-
updateParamsList(input, input.parameters),
|
|
109490
|
-
ensureType(input, input.type)
|
|
109491
|
-
)
|
|
109330
|
+
ensureTypeParams(input, input.typeParameters),
|
|
109331
|
+
updateParamsList(input, input.parameters),
|
|
109332
|
+
ensureType(input, input.type)
|
|
109492
109333
|
));
|
|
109493
109334
|
case 176 /* Constructor */: {
|
|
109494
|
-
const ctor =
|
|
109495
|
-
|
|
109496
|
-
|
|
109497
|
-
|
|
109498
|
-
|
|
109499
|
-
|
|
109500
|
-
/*body*/
|
|
109501
|
-
void 0
|
|
109502
|
-
)
|
|
109335
|
+
const ctor = factory2.createConstructorDeclaration(
|
|
109336
|
+
/*modifiers*/
|
|
109337
|
+
ensureModifiers(input),
|
|
109338
|
+
updateParamsList(input, input.parameters, 0 /* None */),
|
|
109339
|
+
/*body*/
|
|
109340
|
+
void 0
|
|
109503
109341
|
);
|
|
109504
109342
|
return cleanup(ctor);
|
|
109505
109343
|
}
|
|
@@ -109510,20 +109348,17 @@ function transformDeclarations(context) {
|
|
|
109510
109348
|
void 0
|
|
109511
109349
|
);
|
|
109512
109350
|
}
|
|
109513
|
-
const sig =
|
|
109514
|
-
input,
|
|
109515
|
-
|
|
109516
|
-
|
|
109517
|
-
|
|
109518
|
-
|
|
109519
|
-
|
|
109520
|
-
|
|
109521
|
-
|
|
109522
|
-
|
|
109523
|
-
|
|
109524
|
-
/*body*/
|
|
109525
|
-
void 0
|
|
109526
|
-
)
|
|
109351
|
+
const sig = factory2.createMethodDeclaration(
|
|
109352
|
+
ensureModifiers(input),
|
|
109353
|
+
/*asteriskToken*/
|
|
109354
|
+
void 0,
|
|
109355
|
+
input.name,
|
|
109356
|
+
input.questionToken,
|
|
109357
|
+
ensureTypeParams(input, input.typeParameters),
|
|
109358
|
+
updateParamsList(input, input.parameters),
|
|
109359
|
+
ensureType(input, input.type),
|
|
109360
|
+
/*body*/
|
|
109361
|
+
void 0
|
|
109527
109362
|
);
|
|
109528
109363
|
return cleanup(sig);
|
|
109529
109364
|
}
|
|
@@ -109535,17 +109370,14 @@ function transformDeclarations(context) {
|
|
|
109535
109370
|
);
|
|
109536
109371
|
}
|
|
109537
109372
|
const accessorType = getTypeAnnotationFromAllAccessorDeclarations(input, resolver.getAllAccessorDeclarations(input));
|
|
109538
|
-
return cleanup(
|
|
109373
|
+
return cleanup(factory2.updateGetAccessorDeclaration(
|
|
109539
109374
|
input,
|
|
109540
|
-
|
|
109541
|
-
|
|
109542
|
-
|
|
109543
|
-
|
|
109544
|
-
|
|
109545
|
-
|
|
109546
|
-
/*body*/
|
|
109547
|
-
void 0
|
|
109548
|
-
)
|
|
109375
|
+
ensureModifiers(input),
|
|
109376
|
+
input.name,
|
|
109377
|
+
updateAccessorParamsList(input, hasEffectiveModifier(input, 2 /* Private */)),
|
|
109378
|
+
ensureType(input, accessorType),
|
|
109379
|
+
/*body*/
|
|
109380
|
+
void 0
|
|
109549
109381
|
));
|
|
109550
109382
|
}
|
|
109551
109383
|
case 178 /* SetAccessor */: {
|
|
@@ -109555,16 +109387,13 @@ function transformDeclarations(context) {
|
|
|
109555
109387
|
void 0
|
|
109556
109388
|
);
|
|
109557
109389
|
}
|
|
109558
|
-
return cleanup(
|
|
109390
|
+
return cleanup(factory2.updateSetAccessorDeclaration(
|
|
109559
109391
|
input,
|
|
109560
|
-
|
|
109561
|
-
|
|
109562
|
-
|
|
109563
|
-
|
|
109564
|
-
|
|
109565
|
-
/*body*/
|
|
109566
|
-
void 0
|
|
109567
|
-
)
|
|
109392
|
+
ensureModifiers(input),
|
|
109393
|
+
input.name,
|
|
109394
|
+
updateAccessorParamsList(input, hasEffectiveModifier(input, 2 /* Private */)),
|
|
109395
|
+
/*body*/
|
|
109396
|
+
void 0
|
|
109568
109397
|
));
|
|
109569
109398
|
}
|
|
109570
109399
|
case 172 /* PropertyDeclaration */:
|
|
@@ -109603,29 +109432,25 @@ function transformDeclarations(context) {
|
|
|
109603
109432
|
void 0
|
|
109604
109433
|
);
|
|
109605
109434
|
}
|
|
109606
|
-
return cleanup(
|
|
109435
|
+
return cleanup(factory2.updateMethodSignature(
|
|
109607
109436
|
input,
|
|
109608
|
-
|
|
109609
|
-
|
|
109610
|
-
|
|
109611
|
-
|
|
109612
|
-
|
|
109613
|
-
|
|
109614
|
-
updateParamsList(input, input.parameters),
|
|
109615
|
-
ensureType(input, input.type)
|
|
109616
|
-
)
|
|
109437
|
+
ensureModifiers(input),
|
|
109438
|
+
input.name,
|
|
109439
|
+
input.questionToken,
|
|
109440
|
+
ensureTypeParams(input, input.typeParameters),
|
|
109441
|
+
updateParamsList(input, input.parameters),
|
|
109442
|
+
ensureType(input, input.type)
|
|
109617
109443
|
));
|
|
109618
109444
|
}
|
|
109619
109445
|
case 179 /* CallSignature */: {
|
|
109620
|
-
return cleanup(
|
|
109621
|
-
input,
|
|
109446
|
+
return cleanup(
|
|
109622
109447
|
factory2.updateCallSignature(
|
|
109623
109448
|
input,
|
|
109624
109449
|
ensureTypeParams(input, input.typeParameters),
|
|
109625
109450
|
updateParamsList(input, input.parameters),
|
|
109626
109451
|
ensureType(input, input.type)
|
|
109627
109452
|
)
|
|
109628
|
-
)
|
|
109453
|
+
);
|
|
109629
109454
|
}
|
|
109630
109455
|
case 181 /* IndexSignature */: {
|
|
109631
109456
|
return cleanup(factory2.updateIndexSignature(
|
|
@@ -109679,26 +109504,20 @@ function transformDeclarations(context) {
|
|
|
109679
109504
|
return cleanup(factory2.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType));
|
|
109680
109505
|
}
|
|
109681
109506
|
case 184 /* FunctionType */: {
|
|
109682
|
-
return cleanup(
|
|
109507
|
+
return cleanup(factory2.updateFunctionTypeNode(
|
|
109683
109508
|
input,
|
|
109684
|
-
|
|
109685
|
-
|
|
109686
|
-
|
|
109687
|
-
updateParamsList(input, input.parameters),
|
|
109688
|
-
Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode))
|
|
109689
|
-
)
|
|
109509
|
+
visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration),
|
|
109510
|
+
updateParamsList(input, input.parameters),
|
|
109511
|
+
Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode))
|
|
109690
109512
|
));
|
|
109691
109513
|
}
|
|
109692
109514
|
case 185 /* ConstructorType */: {
|
|
109693
|
-
return cleanup(
|
|
109515
|
+
return cleanup(factory2.updateConstructorTypeNode(
|
|
109694
109516
|
input,
|
|
109695
|
-
|
|
109696
|
-
|
|
109697
|
-
|
|
109698
|
-
|
|
109699
|
-
updateParamsList(input, input.parameters),
|
|
109700
|
-
Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode))
|
|
109701
|
-
)
|
|
109517
|
+
ensureModifiers(input),
|
|
109518
|
+
visitNodes2(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration),
|
|
109519
|
+
updateParamsList(input, input.parameters),
|
|
109520
|
+
Debug.checkDefined(visitNode(input.type, visitDeclarationSubtree, isTypeNode))
|
|
109702
109521
|
));
|
|
109703
109522
|
}
|
|
109704
109523
|
case 205 /* ImportType */: {
|
|
@@ -109884,20 +109703,17 @@ function transformDeclarations(context) {
|
|
|
109884
109703
|
));
|
|
109885
109704
|
}
|
|
109886
109705
|
case 262 /* FunctionDeclaration */: {
|
|
109887
|
-
const clean2 = cleanup(
|
|
109706
|
+
const clean2 = cleanup(factory2.updateFunctionDeclaration(
|
|
109888
109707
|
input,
|
|
109889
|
-
|
|
109890
|
-
|
|
109891
|
-
|
|
109892
|
-
|
|
109893
|
-
|
|
109894
|
-
|
|
109895
|
-
|
|
109896
|
-
|
|
109897
|
-
|
|
109898
|
-
/*body*/
|
|
109899
|
-
void 0
|
|
109900
|
-
)
|
|
109708
|
+
ensureModifiers(input),
|
|
109709
|
+
/*asteriskToken*/
|
|
109710
|
+
void 0,
|
|
109711
|
+
input.name,
|
|
109712
|
+
ensureTypeParams(input, input.typeParameters),
|
|
109713
|
+
updateParamsList(input, input.parameters),
|
|
109714
|
+
ensureType(input, input.type),
|
|
109715
|
+
/*body*/
|
|
109716
|
+
void 0
|
|
109901
109717
|
));
|
|
109902
109718
|
if (clean2 && resolver.isExpandoFunctionDeclaration(input) && shouldEmitFunctionProperties(input)) {
|
|
109903
109719
|
const props = resolver.getPropertiesOfContainerFunction(input);
|