Browse Source

prevent module importing itself

contingency-plan
Rich-Harris 10 years ago
parent
commit
32659d12e0
  1. 4
      src/Bundle.js

4
src/Bundle.js

@ -194,6 +194,10 @@ export default class Bundle {
return this.modulePromises[ importee ];
}
if ( id === importer ) {
throw new Error( `A module cannot import itself (${id})` );
}
if ( !this.modulePromises[ id ] ) {
this.modulePromises[ id ] = Promise.resolve( this.load( id, this.loadOptions ) )
.then( source => {

Loading…
Cancel
Save