diff --git a/src/Module.js b/src/Module.js index 3bbf32e..be1397d 100644 --- a/src/Module.js +++ b/src/Module.js @@ -17,6 +17,8 @@ class SyntheticDefaultDeclaration { this.original = null; this.isExported = false; this.aliases = []; + + this.isUsed = false; } addAlias ( declaration ) { @@ -42,6 +44,8 @@ class SyntheticDefaultDeclaration { } use () { + if ( this.isUsed ) return; + this.isUsed = true; this.statement.mark(); diff --git a/src/ast/Scope.js b/src/ast/Scope.js index 7a210a4..cf61ba9 100644 --- a/src/ast/Scope.js +++ b/src/ast/Scope.js @@ -40,6 +40,8 @@ class Declaration { this.isReassigned = false; this.aliases = []; + + this.isUsed = false; } addAlias ( declaration ) { @@ -61,6 +63,8 @@ class Declaration { } use () { + if ( this.isUsed ) return; + this.isUsed = true; if ( this.statement ) this.statement.mark();