mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
JS: Make implicit this receivers explicit
This commit is contained in:
@@ -26,7 +26,7 @@ predicate isCommonPredefinedTypeName(string name) {
|
||||
*/
|
||||
class DefiniteTypeDecl extends TypeDecl {
|
||||
DefiniteTypeDecl() {
|
||||
this = any(ImportSpecifier im).getLocal() implies exists(getLocalTypeName().getAnAccess())
|
||||
this = any(ImportSpecifier im).getLocal() implies exists(this.getLocalTypeName().getAnAccess())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ predicate isImportedAtRuntime(Module source, Module destination) {
|
||||
*/
|
||||
class CandidateVarAccess extends VarAccess {
|
||||
CandidateVarAccess() {
|
||||
isImmediatelyExecutedContainer(getContainer()) and
|
||||
isImmediatelyExecutedContainer(this.getContainer()) and
|
||||
not exists(ExportSpecifier spec | spec.getLocal() = this)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ class ImportVarDeclProvider extends Stmt {
|
||||
* Gets an unacceptable unused variable declared by this import.
|
||||
*/
|
||||
UnusedLocal getAnUnacceptableUnusedLocal() {
|
||||
result = getAVarDecl().getVariable() and
|
||||
result = this.getAVarDecl().getVariable() and
|
||||
not whitelisted(result)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user