Merge pull request #5008 from babel/fix-5004
Don't try to visit ArrowFunctionExpression, they cannot be named
This commit is contained in:
@@ -3,7 +3,7 @@ import nameFunction from "babel-helper-function-name";
|
||||
export default function () {
|
||||
return {
|
||||
visitor: {
|
||||
"ArrowFunctionExpression|FunctionExpression": {
|
||||
FunctionExpression: {
|
||||
exit(path) {
|
||||
if (path.key !== "value" && !path.parentPath.isObjectProperty()) {
|
||||
const replacement = nameFunction(path);
|
||||
|
||||
Reference in New Issue
Block a user