Export internal functions needed by dtsBundler.mjs (#52941)

This commit is contained in:
Jake Bailey
2024-01-11 11:15:58 -08:00
committed by GitHub
parent 1717826b6e
commit 67b644e543
11 changed files with 64 additions and 63 deletions
@@ -27,7 +27,6 @@ import {
last,
map,
Node,
nullTransformationContext,
ParameterDeclaration,
PropertyDeclaration,
PropertySignature,
@@ -144,7 +143,7 @@ function transformJSDocType(node: Node): Node {
case SyntaxKind.JSDocTypeLiteral:
return transformJSDocTypeLiteral(node as JSDocTypeLiteral);
default:
const visited = visitEachChild(node, transformJSDocType, nullTransformationContext);
const visited = visitEachChild(node, transformJSDocType, /*context*/ undefined);
setEmitFlags(visited, EmitFlags.SingleLine);
return visited;
}
+1 -2
View File
@@ -70,7 +70,6 @@ import {
NodeArray,
NodeBuilderFlags,
NodeFlags,
nullTransformationContext,
ObjectFlags,
ObjectLiteralExpression,
ObjectType,
@@ -913,7 +912,7 @@ export function tryGetAutoImportableReferenceFromTypeNode(importTypeNode: TypeNo
const typeArguments = visitNodes(node.typeArguments, visit, isTypeNode);
return factory.createTypeReferenceNode(qualifier, typeArguments);
}
return visitEachChild(node, visit, nullTransformationContext);
return visitEachChild(node, visit, /*context*/ undefined);
}
}
+2 -3
View File
@@ -120,7 +120,6 @@ import {
Node,
NodeBuilderFlags,
NodeFlags,
nullTransformationContext,
ObjectLiteralElementLike,
ParameterDeclaration,
positionIsSynthesized,
@@ -1648,7 +1647,7 @@ function transformFunctionBody(body: Node, exposedVariableDeclarations: readonly
const oldIgnoreReturns = ignoreReturns;
ignoreReturns = ignoreReturns || isFunctionLikeDeclaration(node) || isClassLike(node);
const substitution = substitutions.get(getNodeId(node).toString());
const result = substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(node, visitor, nullTransformationContext);
const result = substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(node, visitor, /*context*/ undefined);
ignoreReturns = oldIgnoreReturns;
return result;
}
@@ -1662,7 +1661,7 @@ function transformConstantInitializer(initializer: Expression, substitutions: Re
function visitor(node: Node): VisitResult<Node> {
const substitution = substitutions.get(getNodeId(node).toString());
return substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(node, visitor, nullTransformationContext);
return substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(node, visitor, /*context*/ undefined);
}
}
+1 -2
View File
@@ -294,7 +294,6 @@ import {
normalizePath,
NoSubstitutionTemplateLiteral,
notImplemented,
nullTransformationContext,
NumericLiteral,
or,
OrganizeImports,
@@ -3175,7 +3174,7 @@ function getSynthesizedDeepCloneWorker<T extends Node>(node: T, replaceNode?: (n
const nodesClone: <T extends Node>(ns: NodeArray<T> | undefined) => NodeArray<T> | undefined = replaceNode
? ns => ns && getSynthesizedDeepClonesWithReplacements(ns, /*includeTrivia*/ true, replaceNode)
: ns => ns && getSynthesizedDeepClones(ns);
const visited = visitEachChild(node, nodeClone, nullTransformationContext, nodesClone, nodeClone);
const visited = visitEachChild(node, nodeClone, /*context*/ undefined, nodesClone, nodeClone);
if (visited === node) {
// This only happens for leaf nodes - internal nodes always see their children change.