Skip to content

Commit 64f731c

Browse files
committed
adds clarification in docs
1 parent 688e7a9 commit 64f731c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ class Function extends @function, Parameterized, TypeParameterized, StmtContaine
185185
* exclude yields entirely. Likewise, we exclude generator functions from
186186
* consideration, as well as asynchronous functions, since calls to both produce
187187
* something distinct from what's explicitly returned by the function.
188+
*
189+
* Despite the fact that yield expressions are invalid outside of generators, we
190+
* include them anyway just to ensure that we're not relying on a perfect analysis
191+
* of a function to be a generator, and instead are looking also explicitly at the
192+
* return sites.
188193
*/
189194

190195
ConcreteControlFlowNode getAnUndefinedReturn() {

0 commit comments

Comments
 (0)