fix default exported classes without a name (#4518)
* fix default exported classes without a name This correctly requeues class without name so the es3 transform can transform the default keyword. * Replace phabricator issue number with github
This commit is contained in:
committed by
Henry Zhu
parent
590ad4d24f
commit
cbbc1c7333
@@ -267,13 +267,18 @@ export default function () {
|
||||
]);
|
||||
} else {
|
||||
path.replaceWith(buildExportsAssignment(defNode, t.toExpression(declaration.node)));
|
||||
|
||||
// Manualy re-queue `export default class {}` expressions so that the ES3 transform
|
||||
// has an opportunity to convert them. Ideally this would happen automatically from the
|
||||
// replaceWith above. See #4140 for more info.
|
||||
path.parentPath.requeue(path.get("expression.left"));
|
||||
}
|
||||
} else {
|
||||
path.replaceWith(buildExportsAssignment(t.identifier("default"), declaration.node));
|
||||
|
||||
// Manualy re-queue `export default foo;` expressions so that the ES3 transform
|
||||
// has an opportunity to convert them. Ideally this would happen automatically from the
|
||||
// replaceWith above. See T7166 for more info.
|
||||
// replaceWith above. See #4140 for more info.
|
||||
path.parentPath.requeue(path.get("expression.left"));
|
||||
}
|
||||
exportDefaultFound = true;
|
||||
|
||||
Reference in New Issue
Block a user