mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
the js/use-of-returnless-function query now support multiple callees
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
| tst.js:20:17:20:33 | onlySideEffects() | the function $@ does not return anything, yet the return value is used. | tst.js:11:5:13:5 | functio ... )\\n } | onlySideEffects |
|
||||
| tst.js:24:13:24:29 | onlySideEffects() | the function $@ does not return anything, yet the return value is used. | tst.js:11:5:13:5 | functio ... )\\n } | onlySideEffects |
|
||||
| tst.js:30:20:30:36 | onlySideEffects() | the function $@ does not return anything, yet the return value is used. | tst.js:11:5:13:5 | functio ... )\\n } | onlySideEffects |
|
||||
| tst.js:53:10:53:34 | bothOnl ... fects() | the function $@ does not return anything, yet the return value is used. | tst.js:11:5:13:5 | functio ... )\\n } | bothOnlyHaveSideEffects |
|
||||
| tst.js:53:10:53:34 | bothOnl ... fects() | the function $@ does not return anything, yet the return value is used. | tst.js:48:2:50:5 | functio ... )\\n } | bothOnlyHaveSideEffects |
|
||||
|
||||
@@ -44,4 +44,16 @@
|
||||
|
||||
var e = myObj.onlySideEffects.apply(this, arguments); // NOT OK!
|
||||
console.log(e);
|
||||
|
||||
function onlySideEffects2() {
|
||||
console.log("Boo!")
|
||||
}
|
||||
|
||||
var bothOnlyHaveSideEffects = Math.random() > 0.5 ? onlySideEffects : onlySideEffects2;
|
||||
var f = bothOnlyHaveSideEffects(); // NOT OK!
|
||||
console.log(f);
|
||||
|
||||
var oneOfEach = Math.random() > 0.5 ? onlySideEffects : returnsValue;
|
||||
var g = oneOfEach(); // OK
|
||||
console.log(g);
|
||||
})();
|
||||
Reference in New Issue
Block a user