Skip to content

Commit bf48b59

Browse files
committed
JS: Removed exclusion of FunctionExpr from compound statements.
1 parent 1f256ab commit bf48b59

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

javascript/ql/lib/Expressions/ExprHasNoEffect.qll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ predicate isCompoundExpression(Expr e) {
139139
or
140140
e instanceof SeqExpr
141141
or
142-
e instanceof ParExpr and
143-
not e.stripParens() instanceof FunctionExpr
142+
e instanceof ParExpr
144143
}
145144

146145
/**

javascript/ql/test/query-tests/Expressions/ExprHasNoEffect/ExprHasNoEffect.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@
1212
| tst.js:50:3:50:36 | new Err ... age(e)) | This expression has no effect. |
1313
| tst.js:61:2:61:20 | o.trivialNonGetter1 | This expression has no effect. |
1414
| tst.js:77:24:77:24 | o | This expression has no effect. |
15-
| uselessfn.js:1:1:1:26 | (functi ... .");\\n}) | This expression has no effect. |
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
(function f() { // $ Alert
1+
(function f() { // $MISSING: Alert
22
console.log("I'm never called.");
3-
})
3+
})

0 commit comments

Comments
 (0)