Skip to content

Commit ff49aaa

Browse files
committed
JS: Do not capture own variables
1 parent 8befb03 commit ff49aaa

File tree

1 file changed

+2
-1
lines changed
  • javascript/ql/src/semmle/javascript/dataflow/internal

1 file changed

+2
-1
lines changed

javascript/ql/src/semmle/javascript/dataflow/internal/FlowSteps.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ private module CachedSteps {
115115
cached
116116
predicate captures(Function f, LocalVariable variable, SsaVariableCapture cap) {
117117
variable = cap.getSourceVariable() and
118-
f = cap.getContainer()
118+
f = cap.getContainer() and
119+
not f = variable.getDeclaringContainer()
119120
}
120121

121122
/**

0 commit comments

Comments
 (0)