Browse Source

Merge pull request #416 from rollup/remove-outdated-resolves

Remove 3 unused Promise.resolve calls
gh-438-b
Rich Harris 9 years ago
parent
commit
1a8d347a32
  1. 6
      src/Bundle.js

6
src/Bundle.js

@ -70,7 +70,7 @@ export default class Bundle {
// Phase 1 – discovery. We load the entry module and find which // Phase 1 – discovery. We load the entry module and find which
// modules it imports, and import those, until we have all // modules it imports, and import those, until we have all
// of the entry module's dependencies // of the entry module's dependencies
return Promise.resolve( this.resolveId( this.entry, undefined ) ) return this.resolveId( this.entry, undefined )
.then( id => this.fetchModule( id, undefined ) ) .then( id => this.fetchModule( id, undefined ) )
.then( entryModule => { .then( entryModule => {
this.entryModule = entryModule; this.entryModule = entryModule;
@ -147,7 +147,7 @@ export default class Bundle {
if ( id in this.moduleById ) return null; if ( id in this.moduleById ) return null;
this.moduleById[ id ] = null; this.moduleById[ id ] = null;
return Promise.resolve( this.load( id ) ) return this.load( id )
.catch( err => { .catch( err => {
let msg = `Could not load ${id}`; let msg = `Could not load ${id}`;
if ( importer ) msg += ` (imported by ${importer})`; if ( importer ) msg += ` (imported by ${importer})`;
@ -170,7 +170,7 @@ export default class Bundle {
fetchAllDependencies ( module ) { fetchAllDependencies ( module ) {
const promises = module.dependencies.map( source => { const promises = module.dependencies.map( source => {
return Promise.resolve( this.resolveId( source, module.id ) ) return this.resolveId( source, module.id )
.then( resolvedId => { .then( resolvedId => {
if ( !resolvedId ) { if ( !resolvedId ) {
if ( isRelative( source ) ) throw new Error( `Could not resolve ${source} from ${module.id}` ); if ( isRelative( source ) ) throw new Error( `Could not resolve ${source} from ${module.id}` );

Loading…
Cancel
Save