File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
lib/semmle/javascript/dataflow/internal
test/library-tests/TripleDot Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ module VariableCaptureConfig implements InputSig<js::DbLocation> {
88 private js:: Function getLambdaFromVariable ( js:: LocalVariable variable ) {
99 result .getVariable ( ) = variable
1010 or
11- result = variable .getAnAssignedExpr ( )
11+ result = variable .getAnAssignedExpr ( ) . getUnderlyingValue ( )
1212 or
1313 exists ( js:: ClassDeclStmt cls |
1414 result = cls .getConstructor ( ) .getBody ( ) and
@@ -148,9 +148,11 @@ module VariableCaptureConfig implements InputSig<js::DbLocation> {
148148 predicate hasAliasedAccess ( Expr e ) {
149149 e = this
150150 or
151+ e .( js:: Expr ) .getUnderlyingValue ( ) = this
152+ or
151153 exists ( js:: LocalVariable variable |
152154 this = getLambdaFromVariable ( variable ) and
153- e = variable .getAnAccess ( )
155+ e . ( js :: Expr ) . getUnderlyingValue ( ) = variable .getAnAccess ( )
154156 )
155157 }
156158 }
Original file line number Diff line number Diff line change @@ -16,8 +16,8 @@ function f2() {
1616 } ) ( x ) ;
1717 return y ;
1818 }
19- sink ( inner ( source ( "f2.1" ) ) ) ; // $ MISSING: hasValueFlow=f2.1
20- sink ( inner ( source ( "f2.2" ) ) ) ; // $ MISSING: hasValueFlow=f2.2
19+ sink ( inner ( source ( "f2.1" ) ) ) ; // $ hasValueFlow=f2.1
20+ sink ( inner ( source ( "f2.2" ) ) ) ; // $ hasValueFlow=f2.2
2121}
2222
2323function f3 ( ) {
@@ -64,8 +64,8 @@ function f6() {
6464 ( nested ) ( x ) ; // same as f5, except the callee is parenthesised here
6565 return y ;
6666 }
67- sink ( inner ( source ( "f6.1" ) ) ) ; // $ MISSING: hasValueFlow=f6.1
68- sink ( inner ( source ( "f6.2" ) ) ) ; // $ MISSING: hasValueFlow=f6.2
67+ sink ( inner ( source ( "f6.1" ) ) ) ; // $ hasValueFlow=f6.1
68+ sink ( inner ( source ( "f6.2" ) ) ) ; // $ hasValueFlow=f6.2
6969}
7070
7171function f7 ( ) {
@@ -77,6 +77,6 @@ function f7() {
7777 nested ( x ) ; // same as f5, except the function definition is parenthesised
7878 return y ;
7979 }
80- sink ( inner ( source ( "f7.1" ) ) ) ; // $ MISSING: hasValueFlow=f7.1
81- sink ( inner ( source ( "f7.2" ) ) ) ; // $ MISSING: hasValueFlow=f7.2
80+ sink ( inner ( source ( "f7.1" ) ) ) ; // $ hasValueFlow=f7.1
81+ sink ( inner ( source ( "f7.2" ) ) ) ; // $ hasValueFlow=f7.2
8282}
You can’t perform that action at this time.
0 commit comments