JS: Address comments

This commit is contained in:
Asger F
2019-08-05 10:44:39 +01:00
parent 5397da7579
commit 8bec2fe7bf
2 changed files with 5 additions and 2 deletions

View File

@@ -823,7 +823,9 @@ abstract class EnhancedForLoop extends LoopStmt {
* expression in this `for`-`in` or `for`-`of` loop.
*/
Expr getLValue() {
result = getIteratorExpr() or
result = getIterator() and
(result instanceof BindingPattern or result instanceof PropAccess)
or
result = getIterator().(DeclStmt).getADecl().getBindingPattern()
}

View File

@@ -1118,7 +1118,8 @@ module DataFlow {
}
/**
* Gets the data flow node corresponding the given l-value expression.
* Gets the data flow node corresponding the given l-value expression, if
* such a node exists.
*
* This differs from `DataFlow::valueNode()`, which represents the value
* _before_ the l-value is assigned to, whereas `DataFlow::lvalueNode()`