Skip to content

Commit c03e9d6

Browse files
committed
JS: Address review comments
1 parent 5bfdca8 commit c03e9d6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

javascript/ql/src/semmle/javascript/ApiGraphs.qll

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -984,11 +984,16 @@ private module Label {
984984
}
985985

986986
private class NodeModuleSourcesNodes extends DataFlow::SourceNode::Range {
987+
Variable v;
988+
987989
NodeModuleSourcesNodes() {
988990
exists(NodeModule m |
989-
this = DataFlow::ssaDefinitionNode(SSA::implicitInit([m.getModuleVariable(), m.getExportsVariable()]))
991+
this = DataFlow::ssaDefinitionNode(SSA::implicitInit(v)) and
992+
v = [m.getModuleVariable(), m.getExportsVariable()]
990993
)
991994
}
995+
996+
Variable getVariable() { result = v }
992997
}
993998

994999
/**
@@ -998,7 +1003,7 @@ private class ModuleVarNode extends DataFlow::Node {
9981003
Module m;
9991004

10001005
ModuleVarNode() {
1001-
this = DataFlow::ssaDefinitionNode(SSA::implicitInit(m.(NodeModule).getModuleVariable()))
1006+
this.(NodeModuleSourcesNodes).getVariable() = m.(NodeModule).getModuleVariable()
10021007
or
10031008
DataFlow::parameterNode(this, m.(AmdModule).getDefine().getModuleParameter())
10041009
}
@@ -1013,7 +1018,7 @@ private class ExportsVarNode extends DataFlow::Node {
10131018
Module m;
10141019

10151020
ExportsVarNode() {
1016-
this = DataFlow::ssaDefinitionNode(SSA::implicitInit(m.(NodeModule).getExportsVariable()))
1021+
this.(NodeModuleSourcesNodes).getVariable() = m.(NodeModule).getExportsVariable()
10171022
or
10181023
DataFlow::parameterNode(this, m.(AmdModule).getDefine().getExportsParameter())
10191024
}

0 commit comments

Comments
 (0)