Skip to content

Commit f07030b

Browse files
committed
JS: Update AdditionalFlowStep -> SharedFlowStep
1 parent a956672 commit f07030b

File tree

1 file changed

+9
-19
lines changed
  • javascript/ql/src/semmle/javascript/frameworks

1 file changed

+9
-19
lines changed

javascript/ql/src/semmle/javascript/frameworks/Redux.qll

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -848,19 +848,13 @@ module Redux {
848848
)
849849
}
850850

851-
private class ActionToReducerStep extends DataFlow::AdditionalFlowStep {
852-
ActionToReducerStep() {
853-
actionToReducerStep(_, this)
854-
or
855-
actionToReducerPromiseStep(_, this)
856-
}
857-
851+
private class ActionToReducerStep extends DataFlow::SharedFlowStep {
858852
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
859-
actionToReducerStep(pred, succ) and succ = this
853+
actionToReducerStep(pred, succ)
860854
}
861855

862856
override predicate loadStep(DataFlow::Node pred, DataFlow::Node succ, string prop) {
863-
actionToReducerPromiseStep(pred, succ) and succ = this and prop = Promises::valueProp()
857+
actionToReducerPromiseStep(pred, succ) and prop = Promises::valueProp()
864858
}
865859
}
866860

@@ -919,11 +913,9 @@ module Redux {
919913
)
920914
}
921915

922-
private class ReducerToStateStep extends DataFlow::AdditionalFlowStep {
923-
ReducerToStateStep() { reducerToStateStep(_, this) }
924-
916+
private class ReducerToStateStep extends DataFlow::SharedFlowStep {
925917
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
926-
reducerToStateStep(pred, succ) and succ = this
918+
reducerToStateStep(pred, succ)
927919
}
928920
}
929921

@@ -981,8 +973,8 @@ module Redux {
981973
/**
982974
* Defines a flow step to be used for propagating tracking access to `state`.
983975
*
984-
* An `AdditionalFlowStep` is generated for these steps as well.
985-
* It is distinct from `AdditionalFlowStep` to avoid recursion between that and the propagation of `state`.
976+
* A `SharedFlowStep` is generated for these steps as well.
977+
* It is distinct from `SharedFlowStep` to avoid recursion between that and the propagation of `state`.
986978
*/
987979
private class StateStep extends Unit {
988980
abstract predicate step(DataFlow::Node pred, DataFlow::Node succ);
@@ -992,11 +984,9 @@ module Redux {
992984
any(StateStep s).step(pred, succ)
993985
}
994986

995-
private class StateStepAsFlowStep extends DataFlow::AdditionalFlowStep {
996-
StateStepAsFlowStep() { stateStep(_, this) }
997-
987+
private class StateStepAsFlowStep extends DataFlow::SharedFlowStep {
998988
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
999-
stateStep(pred, succ) and succ = this
989+
stateStep(pred, succ)
1000990
}
1001991
}
1002992

0 commit comments

Comments
 (0)