File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
javascript/ql/test/library-tests/TripleDot Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ function f1 ( ) {
2+ function inner ( x ) {
3+ return ( function ( p ) {
4+ return p ; // argument to return
5+ } ) ( x ) ;
6+ }
7+ sink ( inner ( source ( "f1.1" ) ) ) ; // $ hasValueFlow=f1.1 SPURIOUS: hasValueFlow=f1.2
8+ sink ( inner ( source ( "f1.2" ) ) ) ; // $ hasValueFlow=f1.2 SPURIOUS: hasValueFlow=f1.1
9+ }
10+
11+ function f2 ( ) {
12+ function inner ( x ) {
13+ let y ;
14+ ( function ( p ) {
15+ y = p ; // parameter to captured variable
16+ } ) ( x ) ;
17+ return y ;
18+ }
19+ sink ( inner ( source ( "f2.1" ) ) ) ; // $ hasValueFlow=f2.1 SPURIOUS: hasValueFlow=f2.2
20+ sink ( inner ( source ( "f2.2" ) ) ) ; // $ hasValueFlow=f2.2 SPURIOUS: hasValueFlow=f2.1
21+ }
22+
23+ function f3 ( ) {
24+ function inner ( x ) {
25+ return ( function ( ) {
26+ return x ; // captured variable to return
27+ } ) ( ) ;
28+ }
29+ sink ( inner ( source ( "f3.1" ) ) ) ; // $ hasValueFlow=f3.1 SPURIOUS: hasValueFlow=f3.2
30+ sink ( inner ( source ( "f3.2" ) ) ) ; // $ hasValueFlow=f3.2 SPURIOUS: hasValueFlow=f3.1
31+ }
32+
33+ function f4 ( ) {
34+ function inner ( x ) {
35+ let y ;
36+ ( function ( ) {
37+ y = x ; // captured variable to captured variable
38+ } ) ( ) ;
39+ return y ;
40+ }
41+ sink ( inner ( source ( "f4.1" ) ) ) ; // $ hasValueFlow=f4.1
42+ sink ( inner ( source ( "f4.2" ) ) ) ; // $ hasValueFlow=f4.2
43+ }
You can’t perform that action at this time.
0 commit comments