File tree 3 files changed +11
-3
lines changed
lib/semmle/javascript/dataflow
test/library-tests/GetALocalSource
3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -1610,6 +1610,11 @@ module DataFlow {
1610
1610
pred = TElementPatternNode ( _, element ) and
1611
1611
succ = lvalueNodeInternal ( element )
1612
1612
)
1613
+ or
1614
+ exists ( Expr rest |
1615
+ pred = TRestPatternNode ( _, rest ) and
1616
+ succ = lvalueNodeInternal ( rest )
1617
+ )
1613
1618
}
1614
1619
1615
1620
/**
Original file line number Diff line number Diff line change 1
1
function t1 ( ) {
2
2
const { ...rest } = source ( 't1.1' ) ;
3
- rest ; // $ MISSING: getALocalSource=rest
3
+ rest ; // $ getALocalSource=rest
4
4
}
5
5
6
6
function t2 ( ) {
7
7
const [ ...rest ] = source ( 't2.1' ) ;
8
- rest ; // $ MISSING: getALocalSource=rest
8
+ rest ; // $ getALocalSource=rest
9
9
}
10
10
11
11
function t3 ( ) {
12
12
const { p1, ...rest } = source ( 't3.1' ) ;
13
13
p1 ; // $ getALocalSource=p1
14
- rest ; // $ MISSING: getALocalSource=rest
14
+ rest ; // $ getALocalSource=rest
15
15
}
Original file line number Diff line number Diff line change
1
+ | rest-pattern.js:3:5:3:8 | rest | rest |
2
+ | rest-pattern.js:8:5:8:8 | rest | rest |
1
3
| rest-pattern.js:13:5:13:6 | p1 | p1 |
4
+ | rest-pattern.js:14:5:14:8 | rest | rest |
You can’t perform that action at this time.
0 commit comments