Browse Source

Check isUsed to prevent potentially infinite recursion

better-aggressive
Oskar Segersvärd 9 years ago
parent
commit
262334d70d
  1. 4
      src/Module.js
  2. 4
      src/ast/Scope.js

4
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();

4
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();

Loading…
Cancel
Save