Merge pull request #5008 from babel/fix-5004

Don't try to visit ArrowFunctionExpression, they cannot be named
This commit is contained in:
Logan Smyth
2017-01-15 11:47:52 -08:00
committed by GitHub
10 changed files with 47 additions and 1 deletions

View File

@@ -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);