@typescript-deploys/pr-build 5.5.0-pr-57403-34 → 5.5.0-pr-57589-6
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 +219 -101
- package/lib/tsserver.js +245 -113
- package/lib/typescript.d.ts +0 -1
- package/lib/typescript.js +245 -113
- package/lib/typingsInstaller.js +2 -2
- package/package.json +18 -19
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.5";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240308`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -3692,7 +3692,6 @@ var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
|
|
3692
3692
|
ObjectFlags3[ObjectFlags3["ContainsSpread"] = 2097152] = "ContainsSpread";
|
|
3693
3693
|
ObjectFlags3[ObjectFlags3["ObjectRestType"] = 4194304] = "ObjectRestType";
|
|
3694
3694
|
ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] = 8388608] = "InstantiationExpressionType";
|
|
3695
|
-
ObjectFlags3[ObjectFlags3["SingleSignatureType"] = 134217728] = "SingleSignatureType";
|
|
3696
3695
|
ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] = 16777216] = "IsClassInstanceClone";
|
|
3697
3696
|
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] = 33554432] = "IdenticalBaseTypeCalculated";
|
|
3698
3697
|
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] = 67108864] = "IdenticalBaseTypeExists";
|
|
@@ -7555,6 +7554,7 @@ var Diagnostics = {
|
|
|
7555
7554
|
Update_import_from_0: diag(90058, 3 /* Message */, "Update_import_from_0_90058", 'Update import from "{0}"'),
|
|
7556
7555
|
Export_0_from_module_1: diag(90059, 3 /* Message */, "Export_0_from_module_1_90059", "Export '{0}' from module '{1}'"),
|
|
7557
7556
|
Export_all_referenced_locals: diag(90060, 3 /* Message */, "Export_all_referenced_locals_90060", "Export all referenced locals"),
|
|
7557
|
+
Update_modifiers_of_0: diag(90061, 3 /* Message */, "Update_modifiers_of_0_90061", "Update modifiers of '{0}'"),
|
|
7558
7558
|
Convert_function_to_an_ES2015_class: diag(95001, 3 /* Message */, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
|
|
7559
7559
|
Convert_0_to_1_in_0: diag(95003, 3 /* Message */, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
|
|
7560
7560
|
Extract_to_0_in_1: diag(95004, 3 /* Message */, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
|
|
@@ -48378,7 +48378,7 @@ function createTypeChecker(host) {
|
|
|
48378
48378
|
}
|
|
48379
48379
|
const abstractSignatures = filter(resolved.constructSignatures, (signature) => !!(signature.flags & 4 /* Abstract */));
|
|
48380
48380
|
if (some(abstractSignatures)) {
|
|
48381
|
-
const types = map(abstractSignatures,
|
|
48381
|
+
const types = map(abstractSignatures, getOrCreateTypeFromSignature);
|
|
48382
48382
|
const typeElementCount = resolved.callSignatures.length + (resolved.constructSignatures.length - abstractSignatures.length) + resolved.indexInfos.length + // exclude `prototype` when writing a class expression as a type literal, as per
|
|
48383
48383
|
// the logic in `createTypeNodesFromResolvedType`.
|
|
48384
48384
|
(context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ ? countWhere(resolved.properties, (p) => !(p.flags & 4194304 /* Prototype */)) : length(resolved.properties));
|
|
@@ -55779,12 +55779,6 @@ function createTypeChecker(host) {
|
|
|
55779
55779
|
isInJSFile(signature.declaration)
|
|
55780
55780
|
);
|
|
55781
55781
|
}
|
|
55782
|
-
function getImplementationSignature(signature) {
|
|
55783
|
-
return signature.typeParameters ? signature.implementationSignatureCache || (signature.implementationSignatureCache = createImplementationSignature(signature)) : signature;
|
|
55784
|
-
}
|
|
55785
|
-
function createImplementationSignature(signature) {
|
|
55786
|
-
return signature.typeParameters ? instantiateSignature(signature, createTypeMapper([], [])) : signature;
|
|
55787
|
-
}
|
|
55788
55782
|
function getBaseSignature(signature) {
|
|
55789
55783
|
const typeParameters = signature.typeParameters;
|
|
55790
55784
|
if (typeParameters) {
|
|
@@ -55807,22 +55801,12 @@ function createTypeChecker(host) {
|
|
|
55807
55801
|
}
|
|
55808
55802
|
return signature;
|
|
55809
55803
|
}
|
|
55810
|
-
function getOrCreateTypeFromSignature(signature
|
|
55804
|
+
function getOrCreateTypeFromSignature(signature) {
|
|
55811
55805
|
var _a;
|
|
55812
55806
|
if (!signature.isolatedSignatureType) {
|
|
55813
55807
|
const kind = (_a = signature.declaration) == null ? void 0 : _a.kind;
|
|
55814
55808
|
const isConstructor = kind === void 0 || kind === 176 /* Constructor */ || kind === 180 /* ConstructSignature */ || kind === 185 /* ConstructorType */;
|
|
55815
|
-
const type = createObjectType(16 /* Anonymous */
|
|
55816
|
-
if (signature.declaration && !nodeIsSynthesized(signature.declaration)) {
|
|
55817
|
-
type.symbol.declarations = [signature.declaration];
|
|
55818
|
-
type.symbol.valueDeclaration = signature.declaration;
|
|
55819
|
-
}
|
|
55820
|
-
outerTypeParameters || (outerTypeParameters = signature.declaration && getOuterTypeParameters(
|
|
55821
|
-
signature.declaration,
|
|
55822
|
-
/*includeThisTypes*/
|
|
55823
|
-
true
|
|
55824
|
-
));
|
|
55825
|
-
type.outerTypeParameters = outerTypeParameters;
|
|
55809
|
+
const type = createObjectType(16 /* Anonymous */);
|
|
55826
55810
|
type.members = emptySymbols;
|
|
55827
55811
|
type.properties = emptyArray;
|
|
55828
55812
|
type.callSignatures = !isConstructor ? [signature] : emptyArray;
|
|
@@ -59218,7 +59202,7 @@ function createTypeChecker(host) {
|
|
|
59218
59202
|
const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags & 8388608 /* InstantiationExpressionType */ ? type.node : type.symbol.declarations[0];
|
|
59219
59203
|
const links = getNodeLinks(declaration);
|
|
59220
59204
|
const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags & 64 /* Instantiated */ ? type.target : type;
|
|
59221
|
-
let typeParameters =
|
|
59205
|
+
let typeParameters = links.outerTypeParameters;
|
|
59222
59206
|
if (!typeParameters) {
|
|
59223
59207
|
let outerTypeParameters = getOuterTypeParameters(
|
|
59224
59208
|
declaration,
|
|
@@ -59399,9 +59383,6 @@ function createTypeChecker(host) {
|
|
|
59399
59383
|
if (type.objectFlags & 8388608 /* InstantiationExpressionType */) {
|
|
59400
59384
|
result.node = type.node;
|
|
59401
59385
|
}
|
|
59402
|
-
if (type.objectFlags & 134217728 /* SingleSignatureType */) {
|
|
59403
|
-
result.outerTypeParameters = type.outerTypeParameters;
|
|
59404
|
-
}
|
|
59405
59386
|
result.target = type;
|
|
59406
59387
|
result.mapper = mapper;
|
|
59407
59388
|
result.aliasSymbol = aliasSymbol || type.aliasSymbol;
|
|
@@ -64022,7 +64003,7 @@ function createTypeChecker(host) {
|
|
|
64022
64003
|
if (objectFlags & 524288 /* CouldContainTypeVariablesComputed */) {
|
|
64023
64004
|
return !!(objectFlags & 1048576 /* CouldContainTypeVariables */);
|
|
64024
64005
|
}
|
|
64025
|
-
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags &
|
|
64006
|
+
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 1024 /* ReverseMapped */ | 4194304 /* ObjectRestType */ | 8388608 /* InstantiationExpressionType */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
64026
64007
|
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
64027
64008
|
type.objectFlags |= 524288 /* CouldContainTypeVariablesComputed */ | (result ? 1048576 /* CouldContainTypeVariables */ : 0);
|
|
64028
64009
|
}
|
|
@@ -64304,9 +64285,6 @@ function createTypeChecker(host) {
|
|
|
64304
64285
|
pos = p;
|
|
64305
64286
|
}
|
|
64306
64287
|
}
|
|
64307
|
-
function isTupleOfSelf(typeParameter, type) {
|
|
64308
|
-
return isTupleType(type) && getTupleElementType(type, 0) === getIndexedAccessType(typeParameter, getNumberLiteralType(0)) && !getTypeOfPropertyOfType(type, "1");
|
|
64309
|
-
}
|
|
64310
64288
|
function inferTypes(inferences, originalSource, originalTarget, priority = 0 /* None */, contravariant = false) {
|
|
64311
64289
|
let bivariant = false;
|
|
64312
64290
|
let propagationType;
|
|
@@ -64392,9 +64370,6 @@ function createTypeChecker(host) {
|
|
|
64392
64370
|
inference.priority = priority;
|
|
64393
64371
|
}
|
|
64394
64372
|
if (priority === inference.priority) {
|
|
64395
|
-
if (isTupleOfSelf(inference.typeParameter, candidate)) {
|
|
64396
|
-
return;
|
|
64397
|
-
}
|
|
64398
64373
|
if (contravariant && !bivariant) {
|
|
64399
64374
|
if (!contains(inference.contraCandidates, candidate)) {
|
|
64400
64375
|
inference.contraCandidates = append(inference.contraCandidates, candidate);
|
|
@@ -71317,7 +71292,7 @@ function createTypeChecker(host) {
|
|
|
71317
71292
|
argument = skipParentheses(argument);
|
|
71318
71293
|
return isSatisfiesExpression(argument) ? skipParentheses(argument.expression) : argument;
|
|
71319
71294
|
}
|
|
71320
|
-
function getSignatureApplicabilityError(node, args, signature, relation, checkMode, reportErrors2, containingMessageChain
|
|
71295
|
+
function getSignatureApplicabilityError(node, args, signature, relation, checkMode, reportErrors2, containingMessageChain) {
|
|
71321
71296
|
const errorOutputContainer = { errors: void 0, skipLogging: true };
|
|
71322
71297
|
if (isJsxOpeningLikeElement(node)) {
|
|
71323
71298
|
if (!checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation, checkMode, reportErrors2, containingMessageChain, errorOutputContainer)) {
|
|
@@ -71351,8 +71326,7 @@ function createTypeChecker(host) {
|
|
|
71351
71326
|
void 0,
|
|
71352
71327
|
checkMode
|
|
71353
71328
|
);
|
|
71354
|
-
const
|
|
71355
|
-
const checkArgType = inferenceContext ? instantiateType(regularArgType, inferenceContext.nonFixingMapper) : regularArgType;
|
|
71329
|
+
const checkArgType = checkMode & 4 /* SkipContextSensitive */ ? getRegularTypeOfObjectLiteral(argType) : argType;
|
|
71356
71330
|
const effectiveCheckArgumentNode = getEffectiveCheckNode(arg);
|
|
71357
71331
|
if (!checkTypeRelatedToAndOptionallyElaborate(checkArgType, paramType, relation, reportErrors2 ? effectiveCheckArgumentNode : void 0, effectiveCheckArgumentNode, headMessage, containingMessageChain, errorOutputContainer)) {
|
|
71358
71332
|
Debug.assert(!reportErrors2 || !!errorOutputContainer.errors, "parameter should have errors when reporting errors");
|
|
@@ -71761,9 +71735,7 @@ function createTypeChecker(host) {
|
|
|
71761
71735
|
0 /* Normal */,
|
|
71762
71736
|
/*reportErrors*/
|
|
71763
71737
|
true,
|
|
71764
|
-
() => chain
|
|
71765
|
-
/*inferenceContext*/
|
|
71766
|
-
void 0
|
|
71738
|
+
() => chain
|
|
71767
71739
|
);
|
|
71768
71740
|
if (diags) {
|
|
71769
71741
|
for (const d of diags) {
|
|
@@ -71799,9 +71771,7 @@ function createTypeChecker(host) {
|
|
|
71799
71771
|
0 /* Normal */,
|
|
71800
71772
|
/*reportErrors*/
|
|
71801
71773
|
true,
|
|
71802
|
-
chain2
|
|
71803
|
-
/*inferenceContext*/
|
|
71804
|
-
void 0
|
|
71774
|
+
chain2
|
|
71805
71775
|
);
|
|
71806
71776
|
if (diags2) {
|
|
71807
71777
|
if (diags2.length <= min2) {
|
|
@@ -71892,8 +71862,6 @@ function createTypeChecker(host) {
|
|
|
71892
71862
|
/*reportErrors*/
|
|
71893
71863
|
false,
|
|
71894
71864
|
/*containingMessageChain*/
|
|
71895
|
-
void 0,
|
|
71896
|
-
/*inferenceContext*/
|
|
71897
71865
|
void 0
|
|
71898
71866
|
)) {
|
|
71899
71867
|
candidatesForArgumentError = [candidate];
|
|
@@ -71902,16 +71870,13 @@ function createTypeChecker(host) {
|
|
|
71902
71870
|
return candidate;
|
|
71903
71871
|
}
|
|
71904
71872
|
for (let candidateIndex = 0; candidateIndex < candidates2.length; candidateIndex++) {
|
|
71905
|
-
|
|
71873
|
+
const candidate = candidates2[candidateIndex];
|
|
71906
71874
|
if (!hasCorrectTypeArgumentArity(candidate, typeArguments) || !hasCorrectArity(node, args, candidate, signatureHelpTrailingComma2)) {
|
|
71907
71875
|
continue;
|
|
71908
71876
|
}
|
|
71909
71877
|
let checkCandidate;
|
|
71910
71878
|
let inferenceContext;
|
|
71911
71879
|
if (candidate.typeParameters) {
|
|
71912
|
-
if (candidate.declaration && findAncestor(node, (a) => a === candidate.declaration)) {
|
|
71913
|
-
candidate = getImplementationSignature(candidate);
|
|
71914
|
-
}
|
|
71915
71880
|
let typeArgumentTypes;
|
|
71916
71881
|
if (some(typeArguments)) {
|
|
71917
71882
|
typeArgumentTypes = checkTypeArguments(
|
|
@@ -71931,7 +71896,7 @@ function createTypeChecker(host) {
|
|
|
71931
71896
|
/*flags*/
|
|
71932
71897
|
isInJSFile(node) ? 2 /* AnyDefault */ : 0 /* None */
|
|
71933
71898
|
);
|
|
71934
|
-
typeArgumentTypes =
|
|
71899
|
+
typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode | 8 /* SkipGenericFunctions */, inferenceContext);
|
|
71935
71900
|
argCheckMode |= inferenceContext.flags & 4 /* SkippedGenericFunction */ ? 8 /* SkipGenericFunctions */ : 0 /* Normal */;
|
|
71936
71901
|
}
|
|
71937
71902
|
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext && inferenceContext.inferredTypeParameters);
|
|
@@ -71951,8 +71916,7 @@ function createTypeChecker(host) {
|
|
|
71951
71916
|
/*reportErrors*/
|
|
71952
71917
|
false,
|
|
71953
71918
|
/*containingMessageChain*/
|
|
71954
|
-
void 0
|
|
71955
|
-
inferenceContext
|
|
71919
|
+
void 0
|
|
71956
71920
|
)) {
|
|
71957
71921
|
(candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate);
|
|
71958
71922
|
continue;
|
|
@@ -71960,7 +71924,7 @@ function createTypeChecker(host) {
|
|
|
71960
71924
|
if (argCheckMode) {
|
|
71961
71925
|
argCheckMode = 0 /* Normal */;
|
|
71962
71926
|
if (inferenceContext) {
|
|
71963
|
-
const typeArgumentTypes =
|
|
71927
|
+
const typeArgumentTypes = inferTypeArguments(node, candidate, args, argCheckMode, inferenceContext);
|
|
71964
71928
|
checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJSFile(candidate.declaration), inferenceContext.inferredTypeParameters);
|
|
71965
71929
|
if (getNonArrayRestType(candidate) && !hasCorrectArity(node, args, checkCandidate, signatureHelpTrailingComma2)) {
|
|
71966
71930
|
candidateForArgumentArityError = checkCandidate;
|
|
@@ -71976,8 +71940,7 @@ function createTypeChecker(host) {
|
|
|
71976
71940
|
/*reportErrors*/
|
|
71977
71941
|
false,
|
|
71978
71942
|
/*containingMessageChain*/
|
|
71979
|
-
void 0
|
|
71980
|
-
inferenceContext
|
|
71943
|
+
void 0
|
|
71981
71944
|
)) {
|
|
71982
71945
|
(candidatesForArgumentError || (candidatesForArgumentError = [])).push(checkCandidate);
|
|
71983
71946
|
continue;
|
|
@@ -75674,7 +75637,7 @@ function createTypeChecker(host) {
|
|
|
75674
75637
|
}
|
|
75675
75638
|
}
|
|
75676
75639
|
}
|
|
75677
|
-
return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, context)
|
|
75640
|
+
return getOrCreateTypeFromSignature(instantiateSignatureInContextOf(signature, contextualSignature, context));
|
|
75678
75641
|
}
|
|
75679
75642
|
}
|
|
75680
75643
|
}
|
|
@@ -86852,6 +86815,7 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
86852
86815
|
const exportedBindings = [];
|
|
86853
86816
|
const uniqueExports = /* @__PURE__ */ new Map();
|
|
86854
86817
|
let exportedNames;
|
|
86818
|
+
let exportedFunctions;
|
|
86855
86819
|
let hasExportDefault = false;
|
|
86856
86820
|
let exportEquals;
|
|
86857
86821
|
let hasExportStarsToExportValues = false;
|
|
@@ -86910,6 +86874,7 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
86910
86874
|
break;
|
|
86911
86875
|
case 262 /* FunctionDeclaration */:
|
|
86912
86876
|
if (hasSyntacticModifier(node, 32 /* Export */)) {
|
|
86877
|
+
exportedFunctions = append(exportedFunctions, node);
|
|
86913
86878
|
if (hasSyntacticModifier(node, 2048 /* Default */)) {
|
|
86914
86879
|
if (!hasExportDefault) {
|
|
86915
86880
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), context.factory.getDeclarationName(node));
|
|
@@ -86920,7 +86885,6 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
86920
86885
|
if (!uniqueExports.get(idText(name))) {
|
|
86921
86886
|
multiMapSparseArrayAdd(exportedBindings, getOriginalNodeId(node), name);
|
|
86922
86887
|
uniqueExports.set(idText(name), true);
|
|
86923
|
-
exportedNames = append(exportedNames, name);
|
|
86924
86888
|
}
|
|
86925
86889
|
}
|
|
86926
86890
|
}
|
|
@@ -86948,7 +86912,7 @@ function collectExternalModuleInfo(context, sourceFile) {
|
|
|
86948
86912
|
if (externalHelpersImportDeclaration) {
|
|
86949
86913
|
externalImports.unshift(externalHelpersImportDeclaration);
|
|
86950
86914
|
}
|
|
86951
|
-
return { externalImports, exportSpecifiers, exportEquals, hasExportStarsToExportValues, exportedBindings, exportedNames, externalHelpersImportDeclaration };
|
|
86915
|
+
return { externalImports, exportSpecifiers, exportEquals, hasExportStarsToExportValues, exportedBindings, exportedNames, exportedFunctions, externalHelpersImportDeclaration };
|
|
86952
86916
|
function addExportedNamesForExportDeclaration(node) {
|
|
86953
86917
|
for (const specifier of cast(node.exportClause, isNamedExports).elements) {
|
|
86954
86918
|
if (!uniqueExports.get(idText(specifier.name))) {
|
|
@@ -104279,7 +104243,7 @@ function transformModule(context) {
|
|
|
104279
104243
|
if (shouldEmitUnderscoreUnderscoreESModule()) {
|
|
104280
104244
|
append(statements, createUnderscoreUnderscoreESModule());
|
|
104281
104245
|
}
|
|
104282
|
-
if (
|
|
104246
|
+
if (some(currentModuleInfo.exportedNames)) {
|
|
104283
104247
|
const chunkSize = 50;
|
|
104284
104248
|
for (let i = 0; i < currentModuleInfo.exportedNames.length; i += chunkSize) {
|
|
104285
104249
|
append(
|
|
@@ -104294,6 +104258,11 @@ function transformModule(context) {
|
|
|
104294
104258
|
);
|
|
104295
104259
|
}
|
|
104296
104260
|
}
|
|
104261
|
+
if (some(currentModuleInfo.exportedFunctions)) {
|
|
104262
|
+
for (const f of currentModuleInfo.exportedFunctions) {
|
|
104263
|
+
appendExportsOfHoistedDeclaration(statements, f);
|
|
104264
|
+
}
|
|
104265
|
+
}
|
|
104297
104266
|
append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, isStatement));
|
|
104298
104267
|
addRange(statements, visitNodes2(node.statements, topLevelVisitor, isStatement, statementOffset));
|
|
104299
104268
|
addExportEqualsIfNeeded(
|
|
@@ -104606,9 +104575,14 @@ function transformModule(context) {
|
|
|
104606
104575
|
if (shouldEmitUnderscoreUnderscoreESModule()) {
|
|
104607
104576
|
append(statements, createUnderscoreUnderscoreESModule());
|
|
104608
104577
|
}
|
|
104609
|
-
if (
|
|
104578
|
+
if (some(currentModuleInfo.exportedNames)) {
|
|
104610
104579
|
append(statements, factory2.createExpressionStatement(reduceLeft(currentModuleInfo.exportedNames, (prev, nextId) => factory2.createAssignment(factory2.createPropertyAccessExpression(factory2.createIdentifier("exports"), factory2.createIdentifier(idText(nextId))), prev), factory2.createVoidZero())));
|
|
104611
104580
|
}
|
|
104581
|
+
if (some(currentModuleInfo.exportedFunctions)) {
|
|
104582
|
+
for (const f of currentModuleInfo.exportedFunctions) {
|
|
104583
|
+
appendExportsOfHoistedDeclaration(statements, f);
|
|
104584
|
+
}
|
|
104585
|
+
}
|
|
104612
104586
|
append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, topLevelVisitor, isStatement));
|
|
104613
104587
|
if (moduleKind === 2 /* AMD */) {
|
|
104614
104588
|
addRange(statements, mapDefined(currentModuleInfo.externalImports, getAMDImportExpressionForImport));
|
|
@@ -105579,7 +105553,6 @@ function transformModule(context) {
|
|
|
105579
105553
|
} else {
|
|
105580
105554
|
statements = append(statements, visitEachChild(node, visitor, context));
|
|
105581
105555
|
}
|
|
105582
|
-
statements = appendExportsOfHoistedDeclaration(statements, node);
|
|
105583
105556
|
return singleOrMany(statements);
|
|
105584
105557
|
}
|
|
105585
105558
|
function visitClassDeclaration(node) {
|
|
@@ -106322,7 +106295,7 @@ function transformSystemModule(context) {
|
|
|
106322
106295
|
if (!moduleInfo.hasExportStarsToExportValues) {
|
|
106323
106296
|
return;
|
|
106324
106297
|
}
|
|
106325
|
-
if (!moduleInfo.exportedNames && moduleInfo.exportSpecifiers.size === 0) {
|
|
106298
|
+
if (!some(moduleInfo.exportedNames) && !some(moduleInfo.exportedFunctions) && moduleInfo.exportSpecifiers.size === 0) {
|
|
106326
106299
|
let hasExportDeclarationWithExportClause = false;
|
|
106327
106300
|
for (const externalImport of moduleInfo.externalImports) {
|
|
106328
106301
|
if (externalImport.kind === 278 /* ExportDeclaration */ && externalImport.exportClause) {
|
|
@@ -106353,6 +106326,20 @@ function transformSystemModule(context) {
|
|
|
106353
106326
|
);
|
|
106354
106327
|
}
|
|
106355
106328
|
}
|
|
106329
|
+
if (moduleInfo.exportedFunctions) {
|
|
106330
|
+
for (const f of moduleInfo.exportedFunctions) {
|
|
106331
|
+
if (hasSyntacticModifier(f, 2048 /* Default */)) {
|
|
106332
|
+
continue;
|
|
106333
|
+
}
|
|
106334
|
+
Debug.assert(!!f.name);
|
|
106335
|
+
exportedNames.push(
|
|
106336
|
+
factory2.createPropertyAssignment(
|
|
106337
|
+
factory2.createStringLiteralFromNode(f.name),
|
|
106338
|
+
factory2.createTrue()
|
|
106339
|
+
)
|
|
106340
|
+
);
|
|
106341
|
+
}
|
|
106342
|
+
}
|
|
106356
106343
|
const exportedNamesStorageRef = factory2.createUniqueName("exportedNames");
|
|
106357
106344
|
statements.push(
|
|
106358
106345
|
factory2.createVariableStatement(
|
|
@@ -107854,9 +107841,17 @@ function createGetSymbolAccessibilityDiagnosticForNode(node) {
|
|
|
107854
107841
|
return getImportEntityNameVisibilityError;
|
|
107855
107842
|
} else if (isTypeAliasDeclaration(node) || isJSDocTypeAlias(node)) {
|
|
107856
107843
|
return getTypeAliasDeclarationVisibilityError;
|
|
107844
|
+
} else if (isExportAssignment(node)) {
|
|
107845
|
+
return getExportAssignmentTypeVisibilityDiagnosticMessage;
|
|
107857
107846
|
} else {
|
|
107858
107847
|
return Debug.assertNever(node, `Attempted to set a declaration diagnostic context for unhandled node kind: ${Debug.formatSyntaxKind(node.kind)}`);
|
|
107859
107848
|
}
|
|
107849
|
+
function getExportAssignmentTypeVisibilityDiagnosticMessage() {
|
|
107850
|
+
return {
|
|
107851
|
+
diagnosticMessage: Diagnostics.Default_export_of_the_module_has_or_is_using_private_name_0,
|
|
107852
|
+
errorNode: node
|
|
107853
|
+
};
|
|
107854
|
+
}
|
|
107860
107855
|
function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) {
|
|
107861
107856
|
if (node.kind === 260 /* VariableDeclaration */ || node.kind === 208 /* BindingElement */) {
|
|
107862
107857
|
return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : Diagnostics.Exported_variable_0_has_or_is_using_private_name_1;
|
|
@@ -108102,6 +108097,7 @@ function transformDeclarations(context) {
|
|
|
108102
108097
|
const resolver = context.getEmitResolver();
|
|
108103
108098
|
const options = context.getCompilerOptions();
|
|
108104
108099
|
const { noResolve, stripInternal } = options;
|
|
108100
|
+
const strictNullChecks = getStrictOptionValue(options, "strictNullChecks");
|
|
108105
108101
|
return transformRoot;
|
|
108106
108102
|
function recordTypeReferenceDirectivesIfNecessary(typeReferenceDirectives) {
|
|
108107
108103
|
if (!typeReferenceDirectives) {
|
|
@@ -108489,7 +108485,7 @@ function transformDeclarations(context) {
|
|
|
108489
108485
|
);
|
|
108490
108486
|
}
|
|
108491
108487
|
}
|
|
108492
|
-
function ensureParameter(p, modifierMask
|
|
108488
|
+
function ensureParameter(p, modifierMask) {
|
|
108493
108489
|
let oldDiag;
|
|
108494
108490
|
if (!suppressNewDiagnosticContexts) {
|
|
108495
108491
|
oldDiag = getSymbolAccessibilityDiagnostic;
|
|
@@ -108503,7 +108499,6 @@ function transformDeclarations(context) {
|
|
|
108503
108499
|
resolver.isOptionalParameter(p) ? p.questionToken || factory2.createToken(58 /* QuestionToken */) : void 0,
|
|
108504
108500
|
ensureType(
|
|
108505
108501
|
p,
|
|
108506
|
-
type || p.type,
|
|
108507
108502
|
/*ignorePrivate*/
|
|
108508
108503
|
true
|
|
108509
108504
|
),
|
|
@@ -108524,18 +108519,37 @@ function transformDeclarations(context) {
|
|
|
108524
108519
|
}
|
|
108525
108520
|
return void 0;
|
|
108526
108521
|
}
|
|
108527
|
-
function ensureType(node,
|
|
108522
|
+
function ensureType(node, ignorePrivate) {
|
|
108528
108523
|
if (!ignorePrivate && hasEffectiveModifier(node, 2 /* Private */)) {
|
|
108529
108524
|
return;
|
|
108530
108525
|
}
|
|
108531
108526
|
if (shouldPrintWithInitializer(node)) {
|
|
108532
108527
|
return;
|
|
108533
108528
|
}
|
|
108534
|
-
|
|
108535
|
-
|
|
108536
|
-
|
|
108529
|
+
return typeFromDeclaration(node);
|
|
108530
|
+
}
|
|
108531
|
+
function inferVariableLikeType(node, addUndefined) {
|
|
108532
|
+
const flags = node.kind === 303 /* PropertyAssignment */ ? 4194304 /* InObjectTypeLiteral */ : 0 /* None */;
|
|
108533
|
+
return resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags | flags, symbolTracker, addUndefined) ?? factory2.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
108534
|
+
}
|
|
108535
|
+
function inferExpressionType(node) {
|
|
108536
|
+
return resolver.createTypeOfExpression(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker) ?? factory2.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
108537
|
+
}
|
|
108538
|
+
function inferReturnTypeOfSignatureSignature(node) {
|
|
108539
|
+
return resolver.createReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker) ?? factory2.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
108540
|
+
}
|
|
108541
|
+
function inferAccessorType(node) {
|
|
108542
|
+
if (node.kind === 177 /* GetAccessor */) {
|
|
108543
|
+
return inferReturnTypeOfSignatureSignature(node);
|
|
108544
|
+
} else {
|
|
108545
|
+
return factory2.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
108537
108546
|
}
|
|
108547
|
+
}
|
|
108548
|
+
function typeFromDeclaration(node) {
|
|
108549
|
+
const savedErrorNameNode = errorNameNode;
|
|
108550
|
+
const savedErrorFallbackNode = errorFallbackNode;
|
|
108538
108551
|
errorNameNode = node.name;
|
|
108552
|
+
errorFallbackNode = node;
|
|
108539
108553
|
let oldDiag;
|
|
108540
108554
|
if (!suppressNewDiagnosticContexts) {
|
|
108541
108555
|
oldDiag = getSymbolAccessibilityDiagnostic;
|
|
@@ -108544,28 +108558,142 @@ function transformDeclarations(context) {
|
|
|
108544
108558
|
let typeNode;
|
|
108545
108559
|
switch (node.kind) {
|
|
108546
108560
|
case 169 /* Parameter */:
|
|
108547
|
-
|
|
108561
|
+
typeNode = typeFromParameter(node);
|
|
108562
|
+
break;
|
|
108563
|
+
case 260 /* VariableDeclaration */:
|
|
108564
|
+
typeNode = typeFromVariable(node);
|
|
108565
|
+
break;
|
|
108548
108566
|
case 172 /* PropertyDeclaration */:
|
|
108567
|
+
typeNode = typeFromProperty(node);
|
|
108568
|
+
break;
|
|
108569
|
+
case 177 /* GetAccessor */:
|
|
108570
|
+
typeNode = typeFromAccessor(node);
|
|
108571
|
+
break;
|
|
108549
108572
|
case 208 /* BindingElement */:
|
|
108550
|
-
|
|
108551
|
-
typeNode = resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldAddImplicitUndefined);
|
|
108573
|
+
typeNode = inferVariableLikeType(node);
|
|
108552
108574
|
break;
|
|
108553
|
-
case 262 /* FunctionDeclaration */:
|
|
108554
108575
|
case 180 /* ConstructSignature */:
|
|
108576
|
+
case 171 /* PropertySignature */:
|
|
108555
108577
|
case 173 /* MethodSignature */:
|
|
108556
|
-
case 174 /* MethodDeclaration */:
|
|
108557
|
-
case 177 /* GetAccessor */:
|
|
108558
108578
|
case 179 /* CallSignature */:
|
|
108559
|
-
typeNode =
|
|
108579
|
+
typeNode = visitTypeNode(node.type) ?? factory2.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
108580
|
+
break;
|
|
108581
|
+
case 174 /* MethodDeclaration */:
|
|
108582
|
+
case 262 /* FunctionDeclaration */:
|
|
108583
|
+
typeNode = visitTypeNode(node.type) ?? inferReturnTypeOfSignatureSignature(node);
|
|
108584
|
+
break;
|
|
108585
|
+
case 277 /* ExportAssignment */:
|
|
108586
|
+
typeNode = typeFromExpression(node.expression) ?? inferExpressionType(node.expression);
|
|
108560
108587
|
break;
|
|
108561
108588
|
default:
|
|
108562
|
-
Debug.assertNever(node);
|
|
108589
|
+
Debug.assertNever(node, `Node needs to be an inferrable node, found ${Debug.formatSyntaxKind(node.kind)}`);
|
|
108563
108590
|
}
|
|
108564
|
-
errorNameNode =
|
|
108591
|
+
errorNameNode = savedErrorNameNode;
|
|
108592
|
+
errorFallbackNode = savedErrorFallbackNode;
|
|
108565
108593
|
if (!suppressNewDiagnosticContexts) {
|
|
108566
108594
|
getSymbolAccessibilityDiagnostic = oldDiag;
|
|
108567
108595
|
}
|
|
108568
|
-
return typeNode
|
|
108596
|
+
return typeNode;
|
|
108597
|
+
}
|
|
108598
|
+
function visitTypeNode(type) {
|
|
108599
|
+
return visitNode(type, visitDeclarationSubtree, isTypeNode);
|
|
108600
|
+
}
|
|
108601
|
+
function addUndefinedInUnion(type) {
|
|
108602
|
+
if (!strictNullChecks)
|
|
108603
|
+
return type;
|
|
108604
|
+
if (isUnionTypeNode(type)) {
|
|
108605
|
+
const hasUndefined = type.types.some((p) => p.kind === 157 /* UndefinedKeyword */);
|
|
108606
|
+
if (hasUndefined)
|
|
108607
|
+
return type;
|
|
108608
|
+
return factory2.createUnionTypeNode([
|
|
108609
|
+
...type.types,
|
|
108610
|
+
factory2.createKeywordTypeNode(157 /* UndefinedKeyword */)
|
|
108611
|
+
]);
|
|
108612
|
+
}
|
|
108613
|
+
return factory2.createUnionTypeNode([
|
|
108614
|
+
type,
|
|
108615
|
+
factory2.createKeywordTypeNode(157 /* UndefinedKeyword */)
|
|
108616
|
+
]);
|
|
108617
|
+
}
|
|
108618
|
+
function canAddUndefined(node) {
|
|
108619
|
+
if (!strictNullChecks)
|
|
108620
|
+
return true;
|
|
108621
|
+
if (isKeyword(node.kind) || node.kind === 201 /* LiteralType */ || node.kind === 184 /* FunctionType */ || node.kind === 185 /* ConstructorType */ || node.kind === 188 /* ArrayType */ || node.kind === 189 /* TupleType */ || node.kind === 187 /* TypeLiteral */ || node.kind === 203 /* TemplateLiteralType */ || node.kind === 197 /* ThisType */) {
|
|
108622
|
+
return true;
|
|
108623
|
+
}
|
|
108624
|
+
if (node.kind === 196 /* ParenthesizedType */) {
|
|
108625
|
+
return canAddUndefined(node.type);
|
|
108626
|
+
}
|
|
108627
|
+
if (node.kind === 192 /* UnionType */ || node.kind === 193 /* IntersectionType */) {
|
|
108628
|
+
return node.types.every(canAddUndefined);
|
|
108629
|
+
}
|
|
108630
|
+
return false;
|
|
108631
|
+
}
|
|
108632
|
+
function typeFromExpression(node, requiresUndefined) {
|
|
108633
|
+
switch (node.kind) {
|
|
108634
|
+
case 216 /* TypeAssertionExpression */:
|
|
108635
|
+
case 234 /* AsExpression */:
|
|
108636
|
+
const asExpression = node;
|
|
108637
|
+
const type = asExpression.type;
|
|
108638
|
+
if (isConstTypeReference(asExpression.type) || requiresUndefined && !canAddUndefined(type)) {
|
|
108639
|
+
return void 0;
|
|
108640
|
+
} else {
|
|
108641
|
+
return visitTypeNode(type);
|
|
108642
|
+
}
|
|
108643
|
+
}
|
|
108644
|
+
return void 0;
|
|
108645
|
+
}
|
|
108646
|
+
function typeFromAccessor(node) {
|
|
108647
|
+
const accessorDeclarations = resolver.getAllAccessorDeclarations(node);
|
|
108648
|
+
const accessorType = getTypeAnnotationFromAllAccessorDeclarations(node, accessorDeclarations);
|
|
108649
|
+
if (accessorType) {
|
|
108650
|
+
return visitTypeNode(accessorType);
|
|
108651
|
+
}
|
|
108652
|
+
return inferAccessorType(accessorDeclarations.getAccessor ?? node);
|
|
108653
|
+
}
|
|
108654
|
+
function typeFromVariable(node) {
|
|
108655
|
+
const declaredType = node.type;
|
|
108656
|
+
if (declaredType) {
|
|
108657
|
+
return visitNode(declaredType, visitDeclarationSubtree, isTypeNode);
|
|
108658
|
+
}
|
|
108659
|
+
let resultType;
|
|
108660
|
+
if (node.initializer) {
|
|
108661
|
+
resultType = typeFromExpression(node.initializer);
|
|
108662
|
+
}
|
|
108663
|
+
return resultType ?? inferVariableLikeType(node);
|
|
108664
|
+
}
|
|
108665
|
+
function typeFromParameter(node) {
|
|
108666
|
+
const parent = node.parent;
|
|
108667
|
+
if (parent.kind === 178 /* SetAccessor */) {
|
|
108668
|
+
return typeFromAccessor(parent);
|
|
108669
|
+
}
|
|
108670
|
+
const declaredType = node.type;
|
|
108671
|
+
const addUndefined = resolver.requiresAddingImplicitUndefined(node);
|
|
108672
|
+
let resultType;
|
|
108673
|
+
if (!addUndefined) {
|
|
108674
|
+
if (declaredType) {
|
|
108675
|
+
return visitTypeNode(declaredType);
|
|
108676
|
+
}
|
|
108677
|
+
if (node.initializer && isIdentifier(node.name)) {
|
|
108678
|
+
resultType = typeFromExpression(node.initializer);
|
|
108679
|
+
}
|
|
108680
|
+
}
|
|
108681
|
+
return resultType ?? inferVariableLikeType(node, addUndefined);
|
|
108682
|
+
}
|
|
108683
|
+
function typeFromProperty(node) {
|
|
108684
|
+
const declaredType = node.type;
|
|
108685
|
+
if (declaredType) {
|
|
108686
|
+
return visitTypeNode(declaredType);
|
|
108687
|
+
}
|
|
108688
|
+
let resultType;
|
|
108689
|
+
if (node.initializer) {
|
|
108690
|
+
const isOptional = isOptionalDeclaration(node);
|
|
108691
|
+
resultType = typeFromExpression(node.initializer, isOptional);
|
|
108692
|
+
if (isOptional && resultType) {
|
|
108693
|
+
return addUndefinedInUnion(resultType);
|
|
108694
|
+
}
|
|
108695
|
+
}
|
|
108696
|
+
return resultType ?? inferVariableLikeType(node);
|
|
108569
108697
|
}
|
|
108570
108698
|
function isDeclarationAndNotVisible(node) {
|
|
108571
108699
|
node = getParseTreeNode(node);
|
|
@@ -108630,12 +108758,10 @@ function transformDeclarations(context) {
|
|
|
108630
108758
|
if (!isPrivate) {
|
|
108631
108759
|
const valueParameter = getSetAccessorValueParameter(input);
|
|
108632
108760
|
if (valueParameter) {
|
|
108633
|
-
const accessorType = getTypeAnnotationFromAllAccessorDeclarations(input, resolver.getAllAccessorDeclarations(input));
|
|
108634
108761
|
newValueParameter = ensureParameter(
|
|
108635
108762
|
valueParameter,
|
|
108636
108763
|
/*modifierMask*/
|
|
108637
|
-
void 0
|
|
108638
|
-
accessorType
|
|
108764
|
+
void 0
|
|
108639
108765
|
);
|
|
108640
108766
|
}
|
|
108641
108767
|
}
|
|
@@ -108882,7 +109008,7 @@ function transformDeclarations(context) {
|
|
|
108882
109008
|
input,
|
|
108883
109009
|
ensureTypeParams(input, input.typeParameters),
|
|
108884
109010
|
updateParamsList(input, input.parameters),
|
|
108885
|
-
ensureType(input
|
|
109011
|
+
ensureType(input)
|
|
108886
109012
|
));
|
|
108887
109013
|
case 176 /* Constructor */: {
|
|
108888
109014
|
const ctor = factory2.createConstructorDeclaration(
|
|
@@ -108909,7 +109035,7 @@ function transformDeclarations(context) {
|
|
|
108909
109035
|
input.questionToken,
|
|
108910
109036
|
ensureTypeParams(input, input.typeParameters),
|
|
108911
109037
|
updateParamsList(input, input.parameters),
|
|
108912
|
-
ensureType(input
|
|
109038
|
+
ensureType(input),
|
|
108913
109039
|
/*body*/
|
|
108914
109040
|
void 0
|
|
108915
109041
|
);
|
|
@@ -108922,13 +109048,12 @@ function transformDeclarations(context) {
|
|
|
108922
109048
|
void 0
|
|
108923
109049
|
);
|
|
108924
109050
|
}
|
|
108925
|
-
const accessorType = getTypeAnnotationFromAllAccessorDeclarations(input, resolver.getAllAccessorDeclarations(input));
|
|
108926
109051
|
return cleanup(factory2.updateGetAccessorDeclaration(
|
|
108927
109052
|
input,
|
|
108928
109053
|
ensureModifiers(input),
|
|
108929
109054
|
input.name,
|
|
108930
109055
|
updateAccessorParamsList(input, hasEffectiveModifier(input, 2 /* Private */)),
|
|
108931
|
-
ensureType(input
|
|
109056
|
+
ensureType(input),
|
|
108932
109057
|
/*body*/
|
|
108933
109058
|
void 0
|
|
108934
109059
|
));
|
|
@@ -108961,7 +109086,7 @@ function transformDeclarations(context) {
|
|
|
108961
109086
|
ensureModifiers(input),
|
|
108962
109087
|
input.name,
|
|
108963
109088
|
input.questionToken,
|
|
108964
|
-
ensureType(input
|
|
109089
|
+
ensureType(input),
|
|
108965
109090
|
ensureNoInitializer(input)
|
|
108966
109091
|
));
|
|
108967
109092
|
case 171 /* PropertySignature */:
|
|
@@ -108976,7 +109101,7 @@ function transformDeclarations(context) {
|
|
|
108976
109101
|
ensureModifiers(input),
|
|
108977
109102
|
input.name,
|
|
108978
109103
|
input.questionToken,
|
|
108979
|
-
ensureType(input
|
|
109104
|
+
ensureType(input)
|
|
108980
109105
|
));
|
|
108981
109106
|
case 173 /* MethodSignature */: {
|
|
108982
109107
|
if (isPrivateIdentifier(input.name)) {
|
|
@@ -108992,7 +109117,7 @@ function transformDeclarations(context) {
|
|
|
108992
109117
|
input.questionToken,
|
|
108993
109118
|
ensureTypeParams(input, input.typeParameters),
|
|
108994
109119
|
updateParamsList(input, input.parameters),
|
|
108995
|
-
ensureType(input
|
|
109120
|
+
ensureType(input)
|
|
108996
109121
|
));
|
|
108997
109122
|
}
|
|
108998
109123
|
case 179 /* CallSignature */: {
|
|
@@ -109001,7 +109126,7 @@ function transformDeclarations(context) {
|
|
|
109001
109126
|
input,
|
|
109002
109127
|
ensureTypeParams(input, input.typeParameters),
|
|
109003
109128
|
updateParamsList(input, input.parameters),
|
|
109004
|
-
ensureType(input
|
|
109129
|
+
ensureType(input)
|
|
109005
109130
|
)
|
|
109006
109131
|
);
|
|
109007
109132
|
}
|
|
@@ -109024,7 +109149,7 @@ function transformDeclarations(context) {
|
|
|
109024
109149
|
input.name,
|
|
109025
109150
|
/*exclamationToken*/
|
|
109026
109151
|
void 0,
|
|
109027
|
-
ensureType(input
|
|
109152
|
+
ensureType(input),
|
|
109028
109153
|
ensureNoInitializer(input)
|
|
109029
109154
|
));
|
|
109030
109155
|
}
|
|
@@ -109152,11 +109277,12 @@ function transformDeclarations(context) {
|
|
|
109152
109277
|
errorNode: input
|
|
109153
109278
|
});
|
|
109154
109279
|
errorFallbackNode = input;
|
|
109280
|
+
const type = ensureType(input);
|
|
109155
109281
|
const varDecl = factory2.createVariableDeclaration(
|
|
109156
109282
|
newId,
|
|
109157
109283
|
/*exclamationToken*/
|
|
109158
109284
|
void 0,
|
|
109159
|
-
|
|
109285
|
+
type,
|
|
109160
109286
|
/*initializer*/
|
|
109161
109287
|
void 0
|
|
109162
109288
|
);
|
|
@@ -109264,7 +109390,7 @@ function transformDeclarations(context) {
|
|
|
109264
109390
|
input.name,
|
|
109265
109391
|
ensureTypeParams(input, input.typeParameters),
|
|
109266
109392
|
updateParamsList(input, input.parameters),
|
|
109267
|
-
ensureType(input
|
|
109393
|
+
ensureType(input),
|
|
109268
109394
|
/*body*/
|
|
109269
109395
|
void 0
|
|
109270
109396
|
));
|
|
@@ -109430,7 +109556,7 @@ function transformDeclarations(context) {
|
|
|
109430
109556
|
ensureModifiers(param),
|
|
109431
109557
|
param.name,
|
|
109432
109558
|
param.questionToken,
|
|
109433
|
-
ensureType(param
|
|
109559
|
+
ensureType(param),
|
|
109434
109560
|
ensureNoInitializer(param)
|
|
109435
109561
|
),
|
|
109436
109562
|
param
|
|
@@ -109452,11 +109578,7 @@ function transformDeclarations(context) {
|
|
|
109452
109578
|
elem.name,
|
|
109453
109579
|
/*questionOrExclamationToken*/
|
|
109454
109580
|
void 0,
|
|
109455
|
-
ensureType(
|
|
109456
|
-
elem,
|
|
109457
|
-
/*type*/
|
|
109458
|
-
void 0
|
|
109459
|
-
),
|
|
109581
|
+
ensureType(elem),
|
|
109460
109582
|
/*initializer*/
|
|
109461
109583
|
void 0
|
|
109462
109584
|
));
|
|
@@ -109605,11 +109727,7 @@ function transformDeclarations(context) {
|
|
|
109605
109727
|
e.name,
|
|
109606
109728
|
/*exclamationToken*/
|
|
109607
109729
|
void 0,
|
|
109608
|
-
ensureType(
|
|
109609
|
-
e,
|
|
109610
|
-
/*type*/
|
|
109611
|
-
void 0
|
|
109612
|
-
),
|
|
109730
|
+
ensureType(e),
|
|
109613
109731
|
/*initializer*/
|
|
109614
109732
|
void 0
|
|
109615
109733
|
);
|