Browse Source

include new expressions where callee is a class (#1233)

gh-1187
Rich Harris 8 years ago
parent
commit
766e91d95f
  1. 5
      src/ast/nodes/shared/callHasEffects.js

5
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 );

Loading…
Cancel
Save