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 89dac23969
commit fed2675f76
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

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