File tree Expand file tree Collapse file tree
javascript/ql/src/semmle/javascript Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -181,13 +181,14 @@ private module CollectionDataFlow {
181181 /**
182182 * A step for a call to `forEach` on a Set or Map.
183183 */
184- private class SetMapForEach extends CollectionFlowStep , DataFlow:: MethodCallNode {
185- SetMapForEach ( ) { this .getMethodName ( ) = "forEach" }
186-
187- override predicate load ( DataFlow:: Node obj , DataFlow:: Node element , PseudoProperty prop ) {
188- obj = this .getReceiver ( ) and
189- element = this .getCallback ( 0 ) .getParameter ( 0 ) and
190- prop = [ setElement ( ) , mapValueAll ( ) ]
184+ private class SetMapForEach extends PreCallGraphStep {
185+ override predicate loadStep ( DataFlow:: Node obj , DataFlow:: Node element , string prop ) {
186+ exists ( DataFlow:: MethodCallNode call |
187+ call .getMethodName ( ) = "forEach" and
188+ obj = call .getReceiver ( ) and
189+ element = call .getCallback ( 0 ) .getParameter ( 0 ) and
190+ prop = [ setElement ( ) , mapValueAll ( ) ]
191+ )
191192 }
192193 }
193194
You can’t perform that action at this time.
0 commit comments