only check if a function is a declaration in common module hoisting

This commit is contained in:
Sebastian McKenzie 2015-01-06 10:39:18 +11:00
parent b38a00d70e
commit 3ec97fc86d

View File

@ -71,7 +71,7 @@ CommonJSFormatter.prototype.exportDeclaration = function (node, nodes) {
// exports = module.exports = VALUE;
if (this.hasNonDefaultExports) templateName = "exports-default-module-override";
if (t.isFunction(declar) || !this.hasNonDefaultExports) {
if (t.isFunctionDeclaration(declar) || !this.hasNonDefaultExports) {
assign = util.template(templateName, {
VALUE: this._pushStatement(declar, nodes)
}, true);