Fix missing semi when default exporting CallExpression (#287)

master
Brian Ng 2017-01-18 11:03:31 -06:00 committed by Christopher Chedeau
parent b94b86331f
commit 083876e66d
5 changed files with 12 additions and 3 deletions

View File

@ -1843,7 +1843,8 @@ function printExportDeclaration(path, options, print) {
if (
decl.type === "ExportDefaultDeclaration" &&
decl.declaration.type == "Identifier"
(decl.declaration.type == "Identifier" ||
decl.declaration.type === "CallExpression")
) {
parts.push(";");
}

View File

@ -39,7 +39,7 @@ new (() => {});
typeof (() => {
});
export default (() => {
})()
})();
(() => {
})()\`\`;
(() => {

View File

@ -1347,6 +1347,13 @@ import {
"
`;
exports[`test export_default_call_expression.js 1`] = `
"export default connect(mapStateToProps)(MyComponent);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export default connect(mapStateToProps)(MyComponent);
"
`;
exports[`test test_imports_are_frozen.js 1`] = `
"/* @flow */

View File

@ -0,0 +1 @@
export default connect(mapStateToProps)(MyComponent);

View File

@ -376,7 +376,7 @@ new (function() {});
typeof (function() {
});
export default (function() {
})()
})();
(function() {
})()\`\`;
(function() {