зеркало из https://github.com/github/codeql.git
JS: Resolve simple calls based on qualified name
This commit is contained in:
Родитель
ca71d3117e
Коммит
221d94961a
|
@ -244,18 +244,4 @@ module Closure {
|
|||
DataFlow::SourceNode moduleImport(string moduleName) {
|
||||
getClosureNamespaceFromSourceNode(result) = moduleName
|
||||
}
|
||||
|
||||
private class ClosureNamespaceCall extends DataFlow::InvokeNode {
|
||||
override Function getACallee(int imprecision) {
|
||||
result = super.getACallee(imprecision)
|
||||
or
|
||||
imprecision = 0 and
|
||||
exists(string name |
|
||||
GlobalAccessPath::isAssignedInUniqueFile(name) and
|
||||
GlobalAccessPath::fromRhs(result.flow()) = name and
|
||||
GlobalAccessPath::fromReference(getCalleeNode()) = name and
|
||||
not result.getTopLevel().isExterns()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -127,6 +127,14 @@ private module CachedSteps {
|
|||
invk = cls.getAClassReference().getAMethodCall(name) and
|
||||
f = cls.getStaticMethod(name).getFunction()
|
||||
)
|
||||
or
|
||||
// Call from `foo.bar.baz()` to `foo.bar.baz = function()`
|
||||
not f.getTopLevel().isExterns() and
|
||||
exists(string name |
|
||||
GlobalAccessPath::isAssignedInUniqueFile(name) and
|
||||
GlobalAccessPath::fromRhs(f.flow()) = name and
|
||||
GlobalAccessPath::fromReference(invk.getCalleeNode()) = name
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче