Skip to content

Commit 8bec2fe

Browse files
committed
JS: Address comments
1 parent 5397da7 commit 8bec2fe

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

javascript/ql/src/semmle/javascript/Stmt.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,9 @@ abstract class EnhancedForLoop extends LoopStmt {
823823
* expression in this `for`-`in` or `for`-`of` loop.
824824
*/
825825
Expr getLValue() {
826-
result = getIteratorExpr() or
826+
result = getIterator() and
827+
(result instanceof BindingPattern or result instanceof PropAccess)
828+
or
827829
result = getIterator().(DeclStmt).getADecl().getBindingPattern()
828830
}
829831

javascript/ql/src/semmle/javascript/dataflow/DataFlow.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,8 @@ module DataFlow {
11181118
}
11191119

11201120
/**
1121-
* Gets the data flow node corresponding the given l-value expression.
1121+
* Gets the data flow node corresponding the given l-value expression, if
1122+
* such a node exists.
11221123
*
11231124
* This differs from `DataFlow::valueNode()`, which represents the value
11241125
* _before_ the l-value is assigned to, whereas `DataFlow::lvalueNode()`

0 commit comments

Comments
 (0)