Skip to content

Commit 5a91e26

Browse files
Add a lightweight walk to bind object type literals in JSDoc.
1 parent 0f92a13 commit 5a91e26

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/compiler/binder.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2456,13 +2456,23 @@ namespace ts {
24562456
}
24572457
else {
24582458
for (const j of node.jsDoc!) {
2459-
setParent(j, node);
2460-
setParentRecursive(j, /*incremental*/ false);
2459+
setParentsAndBindAnonymousJSDocTypes(j);
24612460
}
24622461
}
24632462
}
24642463
}
24652464

2465+
function setParentsAndBindAnonymousJSDocTypes(node: Node) {
2466+
setParent(node, parent);
2467+
const saveParent = parent;
2468+
parent = node;
2469+
if (node.kind === SyntaxKind.TypeLiteral) {
2470+
bindWorker(node);
2471+
}
2472+
forEachChild(node, setParentsAndBindAnonymousJSDocTypes);
2473+
parent = saveParent;
2474+
}
2475+
24662476
function updateStrictModeStatementList(statements: NodeArray<Statement>) {
24672477
if (!inStrictMode) {
24682478
for (const statement of statements) {

0 commit comments

Comments
 (0)