Skip to content

Commit 50420a2

Browse files
committed
JS: Expand support for JSDoc in ES2015 modules
1 parent 1d40fa7 commit 50420a2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

javascript/ql/lib/semmle/javascript/internal/TypeResolution.qll

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,14 @@ module TypeResolution {
155155
name = spec.getImportedName() and
156156
node2 = spec.getLocal()
157157
)
158+
or
159+
// Support JSDoc expressions of the form 'foo.bar' where 'foo' is an import
160+
// at the top-level.
161+
exists(JSDocNamedTypeExpr expr, string prefix |
162+
expr.hasNameParts(prefix, name) and
163+
node1 = expr.getTopLevel().getScope().getVariable(prefix) and
164+
node2 = expr
165+
)
158166
}
159167

160168
private signature module TypeResolutionInputSig {

0 commit comments

Comments
 (0)