Fix a regression introduced in #7040 (#7116)

This commit is contained in:
Nicolò Ribaudo
2017-12-28 22:15:53 +01:00
committed by GitHub
parent d761d765bd
commit 2297e2d764
5 changed files with 22 additions and 9 deletions

View File

@@ -17,7 +17,8 @@ export function insertBefore(nodes) {
if (
this.parentPath.isExpressionStatement() ||
this.parentPath.isLabeledStatement() ||
this.parentPath.isExportDeclaration()
this.parentPath.isExportNamedDeclaration() ||
(this.parentPath.isExportDefaultDeclaration() && this.isDeclaration())
) {
return this.parentPath.insertBefore(nodes);
} else if (
@@ -98,7 +99,8 @@ export function insertAfter(nodes) {
if (
this.parentPath.isExpressionStatement() ||
this.parentPath.isLabeledStatement() ||
this.parentPath.isExportDeclaration()
this.parentPath.isExportNamedDeclaration() ||
(this.parentPath.isExportDefaultDeclaration() && this.isDeclaration())
) {
return this.parentPath.insertAfter(nodes);
} else if (