Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d626e79

Browse files
committed
JS: Add two test cases for missing flow
1 parent 992c144 commit d626e79

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

  • javascript/ql/test/library-tests/TripleDot

javascript/ql/test/library-tests/TripleDot/useuse.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,26 @@ function t2() {
2828
}
2929
sink(obj.field); // $ hasValueFlow=t2.1
3030
}
31+
32+
function t3() {
33+
function inner(obj) {
34+
sink(obj.foo); // $ hasValueFlow=t3.2 MISSING: hasValueFlow=t3.1
35+
}
36+
37+
inner({foo: source('t3.1')});
38+
39+
let obj = {};
40+
obj.foo = source('t3.2');
41+
inner(obj);
42+
}
43+
44+
function t4() {
45+
class C {
46+
constructor(x) {
47+
this.foo = x;
48+
sink(this.foo); // $ MISSING: hasValueFlow=t4.1
49+
}
50+
}
51+
const c = new C(source('t4.1'));
52+
sink(c.foo); // $ hasValueFlow=t4.1
53+
}

0 commit comments

Comments
 (0)