Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
fix(Issue #326): remove super call from side effects.
Browse files Browse the repository at this point in the history
  • Loading branch information
JSMonk committed Feb 7, 2021
1 parent b626ca7 commit 9012ff0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/utils/function-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ export function isSideEffectCall(node: Node, invocationResult: Type) {
return (
node.type === NODE.EXPRESSION_STATEMENT && // i.e we don't assign a return value of it to any variable
node.expression != null && //
(node.expression.type === NODE.CALL_EXPRESSION || // if we call a function like a side effect.
((node.expression.type === NODE.CALL_EXPRESSION &&
node.expression.callee.type !== NODE.SUPER) || // if we call a function like a side effect.
node.expression.type === NODE.TAGGED_TEMPLATE_EXPRESSION) && // if we call a function as tag like a side effect.
!invocationResult.equalsTo(Type.Undefined) && // but call of this function actually return something.
!invocationResult.equalsTo(Type.Undefined.promisify()) // but call of this function actually return something.
Expand Down

0 comments on commit 9012ff0

Please sign in to comment.