diff --git a/packages/babel-helper-define-map/src/index.js b/packages/babel-helper-define-map/src/index.js index 59c93d8f54..4e1b7eccf5 100644 --- a/packages/babel-helper-define-map/src/index.js +++ b/packages/babel-helper-define-map/src/index.js @@ -65,8 +65,12 @@ export function push(mutatorMap: Object, node: Object, kind: string, file, scope value = nameFunction({ id: key, node: value, scope }); // Class methods don't have their name bound in the funciton body. - if (t.isClassMethod(node) && value.id) { - value.id[t.NOT_LOCAL_BINDING] = true; + if (t.isClassMethod(node)) { + if (value.id) { + value.id[t.NOT_LOCAL_BINDING] = true; + } else if (t.isCallExpression(value) && t.isFunctionExpression(value.callee) && value.callee.id) { + value.callee.id[t.NOT_LOCAL_BINDING] = true; + } } }