remove FP in use-of-returnless-function FP related to calls to super()

This commit is contained in:
Erik Krogh Kristensen
2019-11-25 11:48:16 +01:00
parent 8f3998915b
commit 4efc71b7a2
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.
}
}