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