Merge pull request #3192 from asger-semmle/js/missing-await-not-delete

Approved by esbena
This commit is contained in:
semmle-qlci
2020-04-03 13:21:48 +01:00
committed by GitHub
3 changed files with 10 additions and 1 deletions

View File

@@ -45,7 +45,8 @@ predicate isBadPromiseContext(Expr expr) {
or
exists(UnaryExpr e |
expr = e.getOperand() and
not e instanceof VoidExpr
not e instanceof VoidExpr and
not e instanceof DeleteExpr
)
or
expr = any(UpdateExpr e).getOperand()

View File

@@ -0,0 +1,5 @@
declare let cache: { [x: string]: Promise<any> };
function deleteCache(x: string) {
delete cache[x]; // OK
}

View File

@@ -0,0 +1,3 @@
{
"include": ["."]
}