From 766e91d95f9e31bc989bdfe166fedbbacc38bae2 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Fri, 6 Jan 2017 18:01:51 -0500 Subject: [PATCH] include new expressions where callee is a class (#1233) --- src/ast/nodes/shared/callHasEffects.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ast/nodes/shared/callHasEffects.js b/src/ast/nodes/shared/callHasEffects.js index ce48fc0..2c37442 100644 --- a/src/ast/nodes/shared/callHasEffects.js +++ b/src/ast/nodes/shared/callHasEffects.js @@ -70,6 +70,11 @@ export default function callHasEffects ( scope, callee, isNew ) { if ( fnHasEffects( node, isNew && isES5Function( node ) ) ) return true; } + else if ( /Class/.test( node.type ) ) { + // TODO find constructor (may belong to a superclass) + return true; + } + else if ( isReference( node ) ) { const flattened = flatten( node ); const declaration = scope.findDeclaration( flattened.name );