check for nested id

This commit is contained in:
Henry Zhu
2016-01-22 14:42:07 -05:00
parent ad81f5b149
commit da106e2bf4

View File

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