Merge pull request #2406 from erik-krogh/returnlessFp

Approved by asgerf
This commit is contained in:
semmle-qlci
2019-11-22 13:06:03 +00:00
committed by GitHub
6 changed files with 27 additions and 7 deletions

View File

@@ -6,3 +6,4 @@
| tst.js:53:10:53:34 | bothOnl ... fects() | the $@ does not return anything, yet the return value is used. | tst.js:48:2:50:5 | functio ... )\\n } | function onlySideEffects2 |
| tst.js:76:12:76:46 | [1,2,3] ... n, 3)}) | the $@ does not return anything, yet the return value from the call to filter is used. | tst.js:76:27:76:45 | n => {equals(n, 3)} | callback function |
| tst.js:80:12:80:50 | filter( ... 3) } ) | the $@ does not return anything, yet the return value from the call to filter is used. | tst.js:80:28:80:48 | x => { ... x, 3) } | callback function |
| tst.ts:6:13:6:25 | returnsVoid() | the $@ does not return anything, yet the return value is used. | tst.ts:1:1:1:38 | declare ... : void; | function returnsVoid |

View File

@@ -12,7 +12,7 @@
}
</script>
</head>
<body>
<body onload="return addHandlers();">
<object id="container" data="editor/svg-editor.html" onload="addHandlers()"></object>
<a href="javascript:addHandlers()">Foo</a>
<div onclick="addHandlers()">Click me</div>

View File

@@ -88,4 +88,8 @@
}
new Deferred().resolve(onlySideEffects()); // OK
})();
})();
+function() {
console.log("FOO");
}.call(this);

View File

@@ -0,0 +1,6 @@
declare function returnsVoid() : void;
declare function returnsSomething(): number;
console.log(returnsSomething());
console.log(returnsVoid()); // NOT OK!