Browse Source

stop false missing export errors

contingency-plan
Rich-Harris 9 years ago
parent
commit
19c71ff051
  1. 9
      src/Module.js

9
src/Module.js

@ -444,13 +444,14 @@ export default class Module {
markExport ( name, suggestedName, importer ) {
const reexport = this.reexports[ name ];
const exportDeclaration = this.exports[ name ];
if ( reexport ) {
reexport.isUsed = true;
reexport.module.markExport( reexport.localName, suggestedName, this );
}
const exportDeclaration = this.exports[ name ];
if ( exportDeclaration ) {
else if ( exportDeclaration ) {
exportDeclaration.isUsed = true;
if ( name === 'default' ) {
this.needsDefault = true;
@ -458,9 +459,10 @@ export default class Module {
return exportDeclaration.statement.mark();
}
return this.mark( exportDeclaration.localName );
this.mark( exportDeclaration.localName );
}
else {
// See if there exists an export delegate that defines `name`.
let i;
for ( i = 0; i < this.exportAlls.length; i += 1 ) {
@ -481,6 +483,7 @@ export default class Module {
throw new Error( `Module ${this.id} does not export ${name} (imported by ${importer.id})` );
}
}
parse ( ast ) {
// The ast can be supplied programmatically (but usually won't be)

Loading…
Cancel
Save