mirror of
https://github.com/github/codeql.git
synced 2026-05-01 03:35:13 +02:00
stylistic changes per PR change req. in description
https://github.com/Semmle/ql/pull/1078#pullrequestreview-214401005
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user