Browse Source

fix

declarations-and-references
Rich-Harris 9 years ago
parent
commit
5e1c7e9bd4
  1. 6
      src/Module.js

6
src/Module.js

@ -539,14 +539,16 @@ export default class Module {
const { start, end } = reference;
const name = declaration.render( es6 );
if ( reference.name !== name ) {
// the second part of this check is necessary because of
// namespace optimisation – name of `foo.bar` could be `bar`
if ( reference.name === name && name.length === reference.end - reference.start ) return;
if ( reference.isShorthandProperty ) {
magicString.insert( end, `: ${name}` );
} else {
magicString.overwrite( start, end, name, true );
}
}
}
});
// modify exports as necessary

Loading…
Cancel
Save