Browse Source

fix global detection

contingency-plan
Rich-Harris 9 years ago
parent
commit
fc5b89dacd
  1. 2
      src/Module.js
  2. 2
      src/Statement.js

2
src/Module.js

@ -208,7 +208,7 @@ export default class Module {
// if names are referenced that are neither defined nor imported
// in this module, we assume that they're globals
this.statements.forEach( statement => {
if ( statement.isExportDeclaration ) return;
if ( statement.isReexportDeclaration ) return;
keys( statement.dependsOn ).forEach( name => {
if ( !this.definitions[ name ] && !this.imports[ name ] ) {

2
src/Statement.js

@ -164,7 +164,7 @@ export default class Statement {
const definingScope = scope.findDefiningScope( node.name );
if ( ( !definingScope || definingScope.depth === 0 ) && !this.defines[ node.name ] ) {
if ( !definingScope || definingScope.depth === 0 ) {
this.dependsOn[ node.name ] = true;
if ( strong ) this.stronglyDependsOn[ node.name ] = true;
}

Loading…
Cancel
Save