mirror of
https://github.com/github/codeql.git
synced 2026-05-02 04:05:14 +02:00
Merge pull request #3192 from asger-semmle/js/missing-await-not-delete
Approved by esbena
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
declare let cache: { [x: string]: Promise<any> };
|
||||
|
||||
function deleteCache(x: string) {
|
||||
delete cache[x]; // OK
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"include": ["."]
|
||||
}
|
||||
Reference in New Issue
Block a user