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 {
130
130
or
131
131
SummaryTypeTracker:: basicLoadStep ( object .( AST:: ValueNode ) .flow ( ) ,
132
132
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
+ )
133
140
}
134
141
135
142
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 30
30
| globals.ts:1:13:1:14 | el | HTMLElement |
31
31
| globals.ts:6:13:6:14 | el | HTMLInputElement |
32
32
| globals.ts:9:13:9:15 | req | Express.Request |
33
+ | indexExpr.ts:7:5:7:10 | obj[x] | 'express'.Request |
33
34
| jsdoc.js:7:13:7:15 | req | 'express'.Request |
34
35
| jsdoc.js:13:13:13:15 | res | 'express'.Response |
35
36
| namedImport.ts:3:13:3:15 | req | 'express'.Request |
You can’t perform that action at this time.
0 commit comments