Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 92623a3

Browse files
committed
cleanup and refactor of promise case based on code-review
1 parent 0b48999 commit 92623a3

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

javascript/ql/src/Statements/UseOfReturnlessFunction.ql

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,8 @@ predicate callBlacklist(DataFlow::CallNode call) {
8888
// anonymous one-shot closure. Those are used in weird ways and we ignore them.
8989
call.asExpr() = any(ImmediatelyInvokedFunctionExpr f).getInvocation() or
9090

91-
// Calls on "this" tend to overloaded. So future overloads might start returning something.
92-
call.asExpr().(MethodCallExpr).getReceiver() instanceof ThisExpr or
93-
// similarly, methods received through parameters might later receive new dataflow. We have just only seen one callee.
94-
call.getCalleeNode().getALocalSource() instanceof DataFlow::ParameterNode or
95-
9691
// arguments to Promise.resolve (and promise library variants) are benign.
97-
exists(MethodCallExpr e | e.getCalleeName() = "resolve" and call.asExpr() = e.getArgument(0))
92+
call = any(ResolvedPromiseDefinition promise).getValue()
9893
}
9994

10095
from DataFlow::CallNode call

0 commit comments

Comments
 (0)