stylistic changes per PR change req. in description

https://github.com/Semmle/ql/pull/1078#pullrequestreview-214401005
This commit is contained in:
Rebecca Valentine
2019-03-14 09:49:02 -07:00
parent f9012cb00e
commit f3683794d6
2 changed files with 11 additions and 12 deletions

View File

@@ -159,13 +159,12 @@ class Function extends @function, Parameterized, TypeParameterized, StmtContaine
}
/**
* Gets a return from a function which has undefined value (i.e. implicit returns
* and returns w/o expressions).
*/
/* Functions can have undefined returns in a few different ways:
* Gets a return from a function which has undefined value (that is, implicit
* returns and returns without expressions).
*
* Functions can have undefined returns in a few different ways:
*
* 1. An explicit return statement with no expression, i.e. the statement `return;`
* 1. An explicit return statement with no expression (the statement `return;`)
*
* 2. An implicit return resulting from an expression executing as the last thing
* in the function. For example, the test in a final `if` statement:

View File

@@ -4,7 +4,7 @@
//////////////////
// //
// GOOD CASES //
// DON'T FIND //
// //
//////////////////
@@ -18,11 +18,11 @@ function fn_w_final_return_w_expr() { return 1; }
/////////////////
// //
// BAD CASES //
// //
/////////////////
////////////
// //
// FIND //
// //
////////////
function fn_w_empty_body() { }
function fn_w_final_return_wo_expr() { return; }