Skip to content

Commit 7ef33de

Browse files
committed
add tests to ignore generators and async functions per PR change request in description
#1078 (comment)
1 parent 64e64c1 commit 7ef33de

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

javascript/ql/src/semmle/javascript/Functions.qll

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,13 @@ class Function extends @function, Parameterized, TypeParameterized, StmtContaine
190190

191191
ConcreteControlFlowNode getAnUndefinedReturn() {
192192
not this.getBody() instanceof Expr and
193-
result.getContainer() = this and
194-
result.isAFinalNode() and
195-
not (result instanceof ReturnStmt and exists(result.(ReturnStmt).getExpr())) and
193+
not this.isGenerator() and
194+
not this.isAsync() and
196195
not result instanceof ThrowStmt and
197-
not result instanceof YieldExpr
196+
not result instanceof YieldExpr and
197+
not (result instanceof ReturnStmt and exists(result.(ReturnStmt).getExpr())) and
198+
result.getContainer() = this and
199+
result.isAFinalNode()
198200
}
199201

200202
/**

0 commit comments

Comments
 (0)