Set function names from assignment expressions

Based on http://www.2ality.com/2015/09/function-names-es6.html.
This commit is contained in:
Ben Alpert
2015-12-27 11:13:11 -08:00
parent fd998cb9af
commit 248f00fe82
4 changed files with 46 additions and 12 deletions

View File

@@ -144,6 +144,9 @@ export default function ({ node, parent, scope, id }) {
return;
}
}
} else if (t.isAssignmentExpression(parent)) {
// foo = function () {};
id = parent.left;
} else if (!id) {
return;
}