only check if a function is a declaration in common module hoisting
This commit is contained in:
parent
b38a00d70e
commit
3ec97fc86d
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user