From 9981d2d20949eaa55303653dae44f1133bc0f43c Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 30 Sep 2015 15:15:15 -0400 Subject: [PATCH] allow namespace to be passed to a function (#149) --- src/Bundle.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Bundle.js b/src/Bundle.js index 5a6199d..889e68e 100644 --- a/src/Bundle.js +++ b/src/Bundle.js @@ -262,14 +262,19 @@ export default class Bundle { const importDeclaration = module.imports[ name ]; if ( !importDeclaration || importDeclaration.module.isExternal ) return; - const otherExportDeclaration = importDeclaration.module.exports[ importDeclaration.name ]; - // TODO things like `export default a + b` don't apply here... right? - const otherDefiningStatement = module.findDefiningStatement( otherExportDeclaration.localName ); + if ( importDeclaration.name === '*' ) { + importDeclaration.module.markAllExportStatements(); + } else { + const otherExportDeclaration = importDeclaration.module.exports[ importDeclaration.name ]; + // TODO things like `export default a + b` don't apply here... right? + const otherDefiningStatement = module.findDefiningStatement( otherExportDeclaration.localName ); - if ( !otherDefiningStatement ) return; + if ( !otherDefiningStatement ) return; + + statement.mark(); + } settled = false; - statement.mark(); }); }); });