mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
JS: add test with self=this variable
This commit is contained in:
@@ -25,5 +25,16 @@ class C {
|
||||
addEventListener('hey', () => {
|
||||
sink(this.x); // NOT OK
|
||||
});
|
||||
|
||||
let self = this;
|
||||
if (isSafe(self.x)) {
|
||||
sink(self.x); // OK
|
||||
}
|
||||
|
||||
addEventListener('hey', function() {
|
||||
if (isSafe(self.x)) {
|
||||
sink(self.x); // OK
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user