Skip to content

Commit 2759d53

Browse files
committed
JS: SetKeys
1 parent c5ddd40 commit 2759d53

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
@@ -250,16 +250,17 @@ private module CollectionDataFlow {
250250
/**
251251
* A step for a call to `keys` on a Set.
252252
*/
253-
private class SetKeys extends CollectionFlowStep, DataFlow::MethodCallNode {
254-
SetKeys() { this.getMethodName() = "keys" }
255-
256-
override predicate loadStore(
257-
DataFlow::Node pred, DataFlow::Node succ, PseudoProperty fromProp, PseudoProperty toProp
253+
private class SetKeys extends PreCallGraphStep {
254+
override predicate loadStoreStep(
255+
DataFlow::Node pred, DataFlow::SourceNode succ, string fromProp, string toProp
258256
) {
259-
pred = this.getReceiver() and
260-
succ = this and
261-
fromProp = setElement() and
262-
toProp = iteratorElement()
257+
exists(DataFlow::MethodCallNode call |
258+
call.getMethodName() = "keys" and
259+
pred = call.getReceiver() and
260+
succ = call and
261+
fromProp = setElement() and
262+
toProp = iteratorElement()
263+
)
263264
}
264265
}
265266
}

0 commit comments

Comments
 (0)