зеркало из https://github.com/github/codeql.git
JS: add test with closures
This commit is contained in:
Родитель
0bb6692c19
Коммит
78bd76048a
|
@ -14,6 +14,8 @@
|
|||
| promise.js:5:25:5:32 | source() | promise.js:5:8:5:33 | bluebir ... urce()) |
|
||||
| sanitizer-guards.js:2:11:2:18 | source() | sanitizer-guards.js:4:8:4:8 | x |
|
||||
| sanitizer-guards.js:13:14:13:21 | source() | sanitizer-guards.js:15:10:15:15 | this.x |
|
||||
| sanitizer-guards.js:13:14:13:21 | source() | sanitizer-guards.js:21:14:21:19 | this.x |
|
||||
| sanitizer-guards.js:13:14:13:21 | source() | sanitizer-guards.js:26:9:26:14 | this.x |
|
||||
| thisAssignments.js:4:17:4:24 | source() | thisAssignments.js:5:10:5:18 | obj.field |
|
||||
| thisAssignments.js:7:19:7:26 | source() | thisAssignments.js:8:10:8:20 | this.field2 |
|
||||
| tst.js:2:13:2:20 | source() | tst.js:4:10:4:10 | x |
|
||||
|
|
|
@ -16,6 +16,14 @@ class C {
|
|||
|
||||
if (isSafe(this.x)) {
|
||||
sink(this.x); // OK
|
||||
|
||||
addEventListener('hey', () => {
|
||||
sink(this.x); // OK - but still flagged
|
||||
});
|
||||
}
|
||||
|
||||
addEventListener('hey', () => {
|
||||
sink(this.x); // NOT OK
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче