We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
getChildExpr(0)
1 parent 15123da commit 3aae1d1Copy full SHA for 3aae1d1
javascript/ql/src/semmle/javascript/DefensiveProgramming.qll
@@ -239,10 +239,11 @@ module Internal {
239
op.getRightOperand() = result
240
)
241
or
242
- exists(IfStmt c |
243
- c.getCondition() = guard |
244
- result = c.getAControlledStmt().getChildExpr(0) or
245
- result = c.getAControlledStmt().(BlockStmt).getStmt(0).getChildExpr(0)
+ exists(IfStmt c, ExprStmt guardedStmt |
+ c.getCondition() = guard and
+ result = guardedStmt.getExpr() |
+ guardedStmt = c.getAControlledStmt() or
246
+ guardedStmt = c.getAControlledStmt().(BlockStmt).getStmt(0)
247
248
249
exists (ConditionalExpr c |
0 commit comments