mirror of
https://github.com/github/codeql.git
synced 2025-12-21 11:16:30 +01:00
JS: Add two test cases for missing flow
This commit is contained in:
@@ -28,3 +28,26 @@ function t2() {
|
||||
}
|
||||
sink(obj.field); // $ hasValueFlow=t2.1
|
||||
}
|
||||
|
||||
function t3() {
|
||||
function inner(obj) {
|
||||
sink(obj.foo); // $ hasValueFlow=t3.2 MISSING: hasValueFlow=t3.1
|
||||
}
|
||||
|
||||
inner({foo: source('t3.1')});
|
||||
|
||||
let obj = {};
|
||||
obj.foo = source('t3.2');
|
||||
inner(obj);
|
||||
}
|
||||
|
||||
function t4() {
|
||||
class C {
|
||||
constructor(x) {
|
||||
this.foo = x;
|
||||
sink(this.foo); // $ MISSING: hasValueFlow=t4.1
|
||||
}
|
||||
}
|
||||
const c = new C(source('t4.1'));
|
||||
sink(c.foo); // $ hasValueFlow=t4.1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user