Browse Source

Don't use `for-of`

gh-109
Oskar Segersvärd 10 years ago
parent
commit
9051520dee
  1. 11
      src/Module.js

11
src/Module.js

@ -69,8 +69,9 @@ export default class Module {
return reference.call( this.exports, name ); return reference.call( this.exports, name );
} }
// ... otherwise search exportAlls. // ... otherwise search exportAlls
for ( const module of this.exportAlls ) { for ( let i = 0; i < this.exportAlls.length; i += 1 ) {
const module = this.exportAlls[i];
if ( module.exports.inScope( name ) ) { if ( module.exports.inScope( name ) ) {
return module.exports.reference( name ); return module.exports.reference( name );
} }
@ -83,11 +84,7 @@ export default class Module {
this.exports.inScope = name => { this.exports.inScope = name => {
if ( inScope.call( this.exports, name ) ) return true; if ( inScope.call( this.exports, name ) ) return true;
for ( const module of this.exportAlls ) { return this.exportAlls.some( module => module.exports.inScope( name ) );
if ( module.exports.inScope( name ) ) return true;
}
return false;
}; };
// Create a unique virtual scope for references to the module. // Create a unique virtual scope for references to the module.

Loading…
Cancel
Save