mirror of
https://github.com/github/codeql.git
synced 2025-12-21 19:26:31 +01:00
JS: Remove Import->SourceNode dependency from AMD
This commit is contained in:
@@ -56,10 +56,16 @@ class AmdModuleDefinition extends CallExpr {
|
|||||||
*/
|
*/
|
||||||
pragma[nomagic]
|
pragma[nomagic]
|
||||||
DataFlow::SourceNode getFactoryNode() {
|
DataFlow::SourceNode getFactoryNode() {
|
||||||
result.flowsToExpr(getLastArgument()) and
|
result = getFactoryNodeInternal() and
|
||||||
result instanceof DataFlow::ValueNode
|
result instanceof DataFlow::ValueNode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private
|
||||||
|
DataFlow::Node getFactoryNodeInternal() {
|
||||||
|
result = DataFlow::valueNode(getLastArgument()) or
|
||||||
|
result = getFactoryNodeInternal().getAPredecessor()
|
||||||
|
}
|
||||||
|
|
||||||
/** Gets the expression defining this module. */
|
/** Gets the expression defining this module. */
|
||||||
Expr getModuleExpr() {
|
Expr getModuleExpr() {
|
||||||
exists(DataFlow::Node f | f = getFactoryNode() |
|
exists(DataFlow::Node f | f = getFactoryNode() |
|
||||||
@@ -108,7 +114,7 @@ class AmdModuleDefinition extends CallExpr {
|
|||||||
* Gets the `i`th parameter of the factory function of this module.
|
* Gets the `i`th parameter of the factory function of this module.
|
||||||
*/
|
*/
|
||||||
private SimpleParameter getFactoryParameter(int i) {
|
private SimpleParameter getFactoryParameter(int i) {
|
||||||
getFactoryNode().(DataFlow::FunctionNode).getParameter(i) = DataFlow::parameterNode(result)
|
getFactoryNodeInternal().asExpr().(Function).getParameter(i) = result
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user