diff --git a/src/Module.js b/src/Module.js index 71f9ff6..96d6869 100644 --- a/src/Module.js +++ b/src/Module.js @@ -274,8 +274,11 @@ export default class Module { bindAliases () { keys( this.declarations ).forEach( name => { + if ( name === '*' ) return; + const declaration = this.declarations[ name ]; const statement = declaration.statement; + if ( statement.node.type !== 'VariableDeclaration' ) return; statement.references.forEach( reference => { diff --git a/test/function/assign-namespace-to-var/_config.js b/test/function/assign-namespace-to-var/_config.js new file mode 100644 index 0000000..ce0a100 --- /dev/null +++ b/test/function/assign-namespace-to-var/_config.js @@ -0,0 +1,3 @@ +module.exports = { + description: 'allows a namespace to be assigned to a variable' +}; diff --git a/test/function/assign-namespace-to-var/b.js b/test/function/assign-namespace-to-var/b.js new file mode 100644 index 0000000..4bc6359 --- /dev/null +++ b/test/function/assign-namespace-to-var/b.js @@ -0,0 +1,5 @@ +export function foo () { + return 10; +} + +export var bar = 20; diff --git a/test/function/assign-namespace-to-var/main.js b/test/function/assign-namespace-to-var/main.js new file mode 100644 index 0000000..4bbbfd4 --- /dev/null +++ b/test/function/assign-namespace-to-var/main.js @@ -0,0 +1,4 @@ +import * as b from './b'; + +var val = b.foo(); +var val2 = b.bar;