mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
JS: Add test for private fields
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
testFailures
|
||||
| pack11/index.ts:2:12:2:65 | // $ me ... .name.m | Missing result:method=(pack11).C1.publicField.really.long.name.m |
|
||||
| pack11/index.ts:33:1:33:16 | | Unexpected result: method=(pack11).C3.privateField |
|
||||
| pack11/index.ts:33:18:33:69 | // $ me ... ng.name | Missing result:method=(pack11).C3.publicField.really.long.name |
|
||||
| pack11/index.ts:41:23:41:24 | | Unexpected result: alias=(pack11).C3.publicField.really.long.name==(pack11).C3.privateField |
|
||||
ambiguousPreferredPredecessor
|
||||
| pack2/lib.js:8:22:8:34 | def moduleImport("pack2").getMember("exports").getMember("lib").getMember("LibClass").getMember("foo") |
|
||||
ambiguousSinkName
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
const f1 = {
|
||||
m() {} // $ method=(pack11).C1.publicField.really.long.name.m
|
||||
};
|
||||
|
||||
export class C1 {
|
||||
private static privateField = f1;
|
||||
|
||||
public static publicField = {
|
||||
really: {
|
||||
long: {
|
||||
name: f1
|
||||
}
|
||||
}
|
||||
}
|
||||
} // $ class=(pack11).C1 instance=(pack11).C1.prototype
|
||||
|
||||
const f2 = {
|
||||
m() {} // $ method=(pack11).C2.publicField.really.long.name.m
|
||||
}
|
||||
|
||||
export class C2 {
|
||||
static #privateField = f2;
|
||||
|
||||
static publicField = {
|
||||
really: {
|
||||
long: {
|
||||
name: f2
|
||||
}
|
||||
}
|
||||
}
|
||||
} // $ class=(pack11).C2 instance=(pack11).C2.prototype
|
||||
|
||||
function f3() {} // $ method=(pack11).C3.publicField.really.long.name
|
||||
|
||||
export class C3 {
|
||||
private static privateField = f3;
|
||||
|
||||
public static publicField = {
|
||||
really: {
|
||||
long: {
|
||||
name: f3
|
||||
}
|
||||
}
|
||||
}
|
||||
} // $ class=(pack11).C3 instance=(pack11).C3.prototype
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"name": "pack11",
|
||||
"main": "./index.js"
|
||||
}
|
||||
Reference in New Issue
Block a user