Merge pull request #2428 from erik-krogh/useOfReturnlessFunctionSuperCalls

Approved by max-schaefer
This commit is contained in:
semmle-qlci
2019-11-26 09:14:08 +00:00
committed by GitHub
2 changed files with 15 additions and 2 deletions

View File

@@ -222,6 +222,7 @@ where
not lastStatementHasNoEffect(func) and
// anonymous one-shot closure. Those are used in weird ways and we ignore them.
not oneshotClosure(call) and
not hasNonVoidReturnType(func)
not hasNonVoidReturnType(func) and
not call.getEnclosingExpr() instanceof SuperCall
select
call, msg, func, name

View File

@@ -92,4 +92,16 @@
+function() {
console.log("FOO");
}.call(this);
}.call(this);
class Foo {
constructor() {
console.log("FOO");
}
}
class Bar extends Foo {
constructor() {
console.log(super()); // OK.
}
}