Skip to content

Commit 5c45494

Browse files
committed
JS: Add test for private fields
1 parent 2a91bb8 commit 5c45494

File tree

3 files changed

+53
-0
lines changed

3 files changed

+53
-0
lines changed

javascript/ql/test/library-tests/EndpointNaming/EndpointNaming.expected

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
testFailures
2+
| pack11/index.ts:2:12:2:65 | // $ me ... .name.m | Missing result:method=(pack11).C1.publicField.really.long.name.m |
3+
| pack11/index.ts:33:1:33:16 | | Unexpected result: method=(pack11).C3.privateField |
4+
| pack11/index.ts:33:18:33:69 | // $ me ... ng.name | Missing result:method=(pack11).C3.publicField.really.long.name |
5+
| pack11/index.ts:41:23:41:24 | | Unexpected result: alias=(pack11).C3.publicField.really.long.name==(pack11).C3.privateField |
26
ambiguousPreferredPredecessor
37
| pack2/lib.js:8:22:8:34 | def moduleImport("pack2").getMember("exports").getMember("lib").getMember("LibClass").getMember("foo") |
48
ambiguousSinkName
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
const f1 = {
2+
m() {} // $ method=(pack11).C1.publicField.really.long.name.m
3+
};
4+
5+
export class C1 {
6+
private static privateField = f1;
7+
8+
public static publicField = {
9+
really: {
10+
long: {
11+
name: f1
12+
}
13+
}
14+
}
15+
} // $ class=(pack11).C1 instance=(pack11).C1.prototype
16+
17+
const f2 = {
18+
m() {} // $ method=(pack11).C2.publicField.really.long.name.m
19+
}
20+
21+
export class C2 {
22+
static #privateField = f2;
23+
24+
static publicField = {
25+
really: {
26+
long: {
27+
name: f2
28+
}
29+
}
30+
}
31+
} // $ class=(pack11).C2 instance=(pack11).C2.prototype
32+
33+
function f3() {} // $ method=(pack11).C3.publicField.really.long.name
34+
35+
export class C3 {
36+
private static privateField = f3;
37+
38+
public static publicField = {
39+
really: {
40+
long: {
41+
name: f3
42+
}
43+
}
44+
}
45+
} // $ class=(pack11).C3 instance=(pack11).C3.prototype
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "pack11",
3+
"main": "./index.js"
4+
}

0 commit comments

Comments
 (0)