@typescript-deploys/pr-build 5.5.0-pr-57267-6 → 5.5.0-pr-57484-5
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 +36 -26
- package/lib/tsserver.js +250 -306
- package/lib/typescript.js +251 -304
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -83006,6 +83006,15 @@ function createTypeChecker(host) {
|
|
|
83006
83006
|
}
|
|
83007
83007
|
return false;
|
|
83008
83008
|
}
|
|
83009
|
+
function declaredParameterTypeContainsUndefined(parameter) {
|
|
83010
|
+
if (!parameter.type)
|
|
83011
|
+
return false;
|
|
83012
|
+
const type = getTypeFromTypeNode(parameter.type);
|
|
83013
|
+
return containsUndefinedType(type);
|
|
83014
|
+
}
|
|
83015
|
+
function requiresAddingImplicitUndefined(parameter) {
|
|
83016
|
+
return (isRequiredInitializedParameter(parameter) || isOptionalUninitializedParameterProperty(parameter)) && !declaredParameterTypeContainsUndefined(parameter);
|
|
83017
|
+
}
|
|
83009
83018
|
function isRequiredInitializedParameter(parameter) {
|
|
83010
83019
|
return !!strictNullChecks && !isOptionalParameter(parameter) && !isJSDocParameterTag(parameter) && !!parameter.initializer && !hasSyntacticModifier(parameter, 31 /* ParameterPropertyModifier */);
|
|
83011
83020
|
}
|
|
@@ -83365,8 +83374,7 @@ function createTypeChecker(host) {
|
|
|
83365
83374
|
isTopLevelValueImportEqualsWithEntityName,
|
|
83366
83375
|
isDeclarationVisible,
|
|
83367
83376
|
isImplementationOfOverload,
|
|
83368
|
-
|
|
83369
|
-
isOptionalUninitializedParameterProperty,
|
|
83377
|
+
requiresAddingImplicitUndefined,
|
|
83370
83378
|
isExpandoFunctionDeclaration,
|
|
83371
83379
|
getPropertiesOfContainerFunction,
|
|
83372
83380
|
createTypeOfDeclaration,
|
|
@@ -109074,38 +109082,41 @@ function transformDeclarations(context) {
|
|
|
109074
109082
|
if (shouldPrintWithInitializer(node)) {
|
|
109075
109083
|
return;
|
|
109076
109084
|
}
|
|
109077
|
-
const
|
|
109078
|
-
if (type && !
|
|
109085
|
+
const shouldAddImplicitUndefined = node.kind === 169 /* Parameter */ && resolver.requiresAddingImplicitUndefined(node);
|
|
109086
|
+
if (type && !shouldAddImplicitUndefined) {
|
|
109079
109087
|
return visitNode(type, visitDeclarationSubtree, isTypeNode);
|
|
109080
109088
|
}
|
|
109081
|
-
if (!getParseTreeNode(node)) {
|
|
109082
|
-
return type ? visitNode(type, visitDeclarationSubtree, isTypeNode) : factory2.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
109083
|
-
}
|
|
109084
|
-
if (node.kind === 178 /* SetAccessor */) {
|
|
109085
|
-
return factory2.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
109086
|
-
}
|
|
109087
109089
|
errorNameNode = node.name;
|
|
109088
109090
|
let oldDiag;
|
|
109089
109091
|
if (!suppressNewDiagnosticContexts) {
|
|
109090
109092
|
oldDiag = getSymbolAccessibilityDiagnostic;
|
|
109091
109093
|
getSymbolAccessibilityDiagnostic = createGetSymbolAccessibilityDiagnosticForNode(node);
|
|
109092
109094
|
}
|
|
109093
|
-
|
|
109094
|
-
|
|
109095
|
-
|
|
109096
|
-
|
|
109097
|
-
|
|
109098
|
-
|
|
109099
|
-
|
|
109095
|
+
let typeNode;
|
|
109096
|
+
switch (node.kind) {
|
|
109097
|
+
case 169 /* Parameter */:
|
|
109098
|
+
case 171 /* PropertySignature */:
|
|
109099
|
+
case 172 /* PropertyDeclaration */:
|
|
109100
|
+
case 208 /* BindingElement */:
|
|
109101
|
+
case 260 /* VariableDeclaration */:
|
|
109102
|
+
typeNode = resolver.createTypeOfDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker, shouldAddImplicitUndefined);
|
|
109103
|
+
break;
|
|
109104
|
+
case 262 /* FunctionDeclaration */:
|
|
109105
|
+
case 180 /* ConstructSignature */:
|
|
109106
|
+
case 173 /* MethodSignature */:
|
|
109107
|
+
case 174 /* MethodDeclaration */:
|
|
109108
|
+
case 177 /* GetAccessor */:
|
|
109109
|
+
case 179 /* CallSignature */:
|
|
109110
|
+
typeNode = resolver.createReturnTypeOfSignatureDeclaration(node, enclosingDeclaration, declarationEmitNodeBuilderFlags, symbolTracker);
|
|
109111
|
+
break;
|
|
109112
|
+
default:
|
|
109113
|
+
Debug.assertNever(node);
|
|
109100
109114
|
}
|
|
109101
|
-
|
|
109102
|
-
|
|
109103
|
-
|
|
109104
|
-
if (!suppressNewDiagnosticContexts) {
|
|
109105
|
-
getSymbolAccessibilityDiagnostic = oldDiag;
|
|
109106
|
-
}
|
|
109107
|
-
return returnValue || factory2.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
109115
|
+
errorNameNode = void 0;
|
|
109116
|
+
if (!suppressNewDiagnosticContexts) {
|
|
109117
|
+
getSymbolAccessibilityDiagnostic = oldDiag;
|
|
109108
109118
|
}
|
|
109119
|
+
return typeNode ?? factory2.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
109109
109120
|
}
|
|
109110
109121
|
function isDeclarationAndNotVisible(node) {
|
|
109111
109122
|
node = getParseTreeNode(node);
|
|
@@ -111328,8 +111339,7 @@ var notImplementedResolver = {
|
|
|
111328
111339
|
isLateBound: (_node) => false,
|
|
111329
111340
|
collectLinkedAliases: notImplemented,
|
|
111330
111341
|
isImplementationOfOverload: notImplemented,
|
|
111331
|
-
|
|
111332
|
-
isOptionalUninitializedParameterProperty: notImplemented,
|
|
111342
|
+
requiresAddingImplicitUndefined: notImplemented,
|
|
111333
111343
|
isExpandoFunctionDeclaration: notImplemented,
|
|
111334
111344
|
getPropertiesOfContainerFunction: notImplemented,
|
|
111335
111345
|
createTypeOfDeclaration: notImplemented,
|