Skip to content

Commit 93d0b41

Browse files
committed
JS: Add test for flow from constructor to method
1 parent 7f24699 commit 93d0b41

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import 'dummy';
2+
3+
function h1() {
4+
class C {
5+
constructor(arg) {
6+
this.x = source("h1.1")
7+
}
8+
method() {
9+
sink(this.x); // $ MISSING: hasValueFlow=h1.1
10+
}
11+
}
12+
}
13+
14+
function h2() {
15+
class C {
16+
method1() {
17+
this.x = source("h2.1")
18+
}
19+
method2() {
20+
sink(this.x); // $ MISSING: hasValueFlow=h2.1
21+
}
22+
}
23+
}
24+
25+
function h3() {
26+
class C {
27+
constructor(arg) {
28+
this.x = arg;
29+
}
30+
method1() {
31+
sink(this.x); // $ hasValueFlow=h3.2
32+
}
33+
method2() {
34+
sink(this.x); // $ hasValueFlow=h3.3
35+
}
36+
}
37+
new C(source("h3.1"));
38+
new C(source("h3.2")).method1();
39+
new C(source("h3.3")).method2();
40+
}

0 commit comments

Comments
 (0)