Skip to content

Commit 3a9d047

Browse files
committed
JS: Ignore delete expressions in js/missing-await
1 parent ccce020 commit 3a9d047

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

javascript/ql/src/Expressions/MissingAwait.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ predicate isBadPromiseContext(Expr expr) {
4545
or
4646
exists(UnaryExpr e |
4747
expr = e.getOperand() and
48-
not e instanceof VoidExpr
48+
not e instanceof VoidExpr and
49+
not e instanceof DeleteExpr
4950
)
5051
or
5152
expr = any(UpdateExpr e).getOperand()

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
| tsTest.ts:4:12:4:19 | cache[x] | Missing await. This value is always a promise. |
21
| tst.js:8:9:8:13 | thing | Missing await. The value 'thing' is always a promise. |
32
| tst.js:10:9:10:13 | thing | Missing await. The value 'thing' is always a promise. |
43
| tst.js:12:15:12:19 | thing | Missing await. The value 'thing' is always a promise. |

0 commit comments

Comments
 (0)