File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
lib/semmle/javascript/internal
test/library-tests/UnderlyingTypes Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,13 @@ module TypeResolution {
167167 node2 = spec .getLocal ( )
168168 )
169169 or
170+ exists ( SelectiveReExportDeclaration exprt , ExportSpecifier spec |
171+ spec = exprt .getASpecifier ( ) and
172+ node1 = exprt .getImportedPath ( ) and
173+ name = spec .getLocalName ( ) and
174+ node2 = spec .getLocal ( )
175+ )
176+ or
170177 // Support JSDoc expressions of the form 'foo.bar' where 'foo' is an import
171178 // at the top-level.
172179 exists ( JSDocNamedTypeExpr expr , string prefix |
@@ -234,6 +241,16 @@ module TypeResolution {
234241 name = spec .getExportedName ( )
235242 )
236243 or
244+ exists ( SelectiveReExportDeclaration exprt , ExportSpecifier spec |
245+ // `export { A as B } from 'blah'`
246+ // This is not covered by `exportsAs` above because neither A or B is a LexicalName
247+ // (both are property names) so it doesn't fit the interface of `exportsAs`.
248+ spec = exprt .getASpecifier ( ) and
249+ mod = exprt .getContainer ( ) and
250+ name = spec .getExportedName ( ) and
251+ result = spec .getLocal ( )
252+ )
253+ or
237254 exists ( EnumDeclaration enum |
238255 mod = enum and
239256 result = enum .getMemberByName ( name ) .getIdentifier ( )
Original file line number Diff line number Diff line change 11import { Request , Response , R } from './expressSelectiveExport' ;
22
3- function t1 ( req : Request ) { // $ MISSING: hasUnderlyingType='express'.Request
3+ function t1 ( req : Request ) { // $ hasUnderlyingType='express'.Request
44}
55
66function t2 ( res : Response ) { // none, not exported
77}
88
9- function t3 ( res : R ) { // $ MISSING: hasUnderlyingType='express'.Response
9+ function t3 ( res : R ) { // $ hasUnderlyingType='express'.Response
1010}
You can’t perform that action at this time.
0 commit comments