Skip to content

Commit

Permalink
include new expressions where callee is a class (#1233)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Jan 6, 2017
1 parent e4682a3 commit 766e91d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ast/nodes/shared/callHasEffects.js
Expand Up @@ -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 );
Expand Down

0 comments on commit 766e91d

Please sign in to comment.