Skip to content

Commit c5ddd40

Browse files
committed
JS: MapAndSetValues
1 parent 9abaad6 commit c5ddd40

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

javascript/ql/src/semmle/javascript/Collections.qll

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -233,16 +233,17 @@ private module CollectionDataFlow {
233233
/**
234234
* A step for a call to `values` on a Map or a Set.
235235
*/
236-
private class MapAndSetValues extends CollectionFlowStep, DataFlow::MethodCallNode {
237-
MapAndSetValues() { this.getMethodName() = "values" }
238-
239-
override predicate loadStore(
240-
DataFlow::Node pred, DataFlow::Node succ, PseudoProperty fromProp, PseudoProperty toProp
236+
private class MapAndSetValues extends PreCallGraphStep {
237+
override predicate loadStoreStep(
238+
DataFlow::Node pred, DataFlow::SourceNode succ, string fromProp, string toProp
241239
) {
242-
pred = this.getReceiver() and
243-
succ = this and
244-
fromProp = [mapValueAll(), setElement()] and
245-
toProp = iteratorElement()
240+
exists(DataFlow::MethodCallNode call |
241+
call.getMethodName() = "values" and
242+
pred = call.getReceiver() and
243+
succ = call and
244+
fromProp = [mapValueAll(), setElement()] and
245+
toProp = iteratorElement()
246+
)
246247
}
247248
}
248249

0 commit comments

Comments
 (0)