forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstructor-field.ts
More file actions
71 lines (59 loc) · 1.21 KB
/
constructor-field.ts
File metadata and controls
71 lines (59 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
class Factory1 {
/** name:Factory1.build */
build() {}
}
class Factory2 {
/** name:Factory2.build */
build() {}
}
class Factory3 {
/** name:Factory3.build */
build() {}
}
class Builder {
factory1 = new Factory1();
constructor(x) {
this.factory2 = new Factory2();
this.factory3 = x;
}
method() {
/** calls:Factory1.build */
this.factory1.build();
/** calls:Factory2.build */
this.factory2.build();
/** calls:Factory3.build */
this.factory3.build();
let f1 = this.getFactory1();
let f2 = this.getFactory2();
let f3 = this.getFactory3();
/** calls:Factory1.build */
f1.build();
/** calls:Factory2.build */
f2.build();
/** calls:Factory3.build */
f3.build();
/** calls:Builder.build */
this.build();
}
getFactory1() {
return this.factory1;
}
getFactory2() {
return this.factory2;
}
getFactory3() {
return this.factory3;
}
/** name:Builder.build */
build() {}
}
let b = new Builder(new Factory3());
let bf1 = b.getFactory1();
let bf2 = b.getFactory2();
let bf3 = b.getFactory3();
/** calls:Factory1.build */
bf1.build();
/** calls:Factory2.build */
bf2.build();
/** calls:Factory3.build */
bf3.build();