infer class name for classes that have static properties (#3589)

This commit is contained in:
Keyan Zhang
2016-07-22 06:50:03 -07:00
committed by Henry Zhu
parent a289dfbbab
commit 879f69f0fb
5 changed files with 18 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
/* eslint max-len: 0 */
// todo: define instead of assign
import nameFunction from "babel-helper-function-name";
export default function ({ types: t }) {
let findBareSupers = {
@@ -43,6 +44,7 @@ export default function ({ types: t }) {
let ref;
if (path.isClassExpression() || !path.node.id) {
nameFunction(path);
ref = path.scope.generateUidIdentifier("class");
} else { // path.isClassDeclaration() && path.node.id
ref = path.node.id;