Fix bug in helper processing.

This commit is contained in:
Logan Smyth 2017-09-20 08:51:00 -07:00
parent d159c468b2
commit a1c268667a
2 changed files with 7 additions and 3 deletions

View File

@ -17,5 +17,5 @@
return Constructor;
}
babelHelpers.createClass = _createClass
babelHelpers.createClass = _createClass;
})(typeof global === "undefined" ? self : global);

View File

@ -157,10 +157,14 @@ function permuteHelperAST(file, metadata, id, localBindings) {
exp.replaceWith(decl);
path.pushContainer(
"body",
t.assignmentExpression("=", id, t.identifier(exportName)),
t.expressionStatement(
t.assignmentExpression("=", id, t.identifier(exportName)),
),
);
} else {
exp.replaceWith(t.assignmentExpression("=", id, decl.node));
exp.replaceWith(
t.expressionStatement(t.assignmentExpression("=", id, decl.node)),
);
}
} else {
throw new Error("Unexpected helper format.");