File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed
lib/semmle/javascript/internal
test/library-tests/UnderlyingTypes Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,13 @@ module TypeResolution {
130130 or
131131 SummaryTypeTracker:: basicLoadStep ( object .( AST:: ValueNode ) .flow ( ) ,
132132 member .( AST:: ValueNode ) .flow ( ) , contents )
133+ or
134+ exists ( IndexExpr index |
135+ not exists ( index .getPropertyName ( ) ) and
136+ object = index .getBase ( ) and
137+ member = index and
138+ contents = DataFlow:: ContentSet:: arrayElement ( )
139+ )
133140 }
134141
135142 predicate callTarget ( InvokeExpr call , Function target ) {
Original file line number Diff line number Diff line change 1+ import * as express from 'express' ;
2+
3+ interface I {
4+ [ s : string ] : express . Request ;
5+ }
6+ function t1 ( obj : I , x : string ) {
7+ obj [ x ] ; // $ hasUnderlyingType='express'.Request
8+ }
Original file line number Diff line number Diff line change 3030| globals.ts:1:13:1:14 | el | HTMLElement |
3131| globals.ts:6:13:6:14 | el | HTMLInputElement |
3232| globals.ts:9:13:9:15 | req | Express.Request |
33+ | indexExpr.ts:7:5:7:10 | obj[x] | 'express'.Request |
3334| jsdoc.js:7:13:7:15 | req | 'express'.Request |
3435| jsdoc.js:13:13:13:15 | res | 'express'.Response |
3536| namedImport.ts:3:13:3:15 | req | 'express'.Request |
You can’t perform that action at this time.
0 commit comments