copy parent class binding to class in the collection visitor
This commit is contained in:
parent
4ecda93147
commit
45b0d63d72
@ -83,6 +83,11 @@ var collectorVisitor = {
|
||||
scope.getBlockParent().registerDeclaration(this);
|
||||
},
|
||||
|
||||
ClassDeclaration(node, parent, scope) {
|
||||
var name = node.id.name;
|
||||
scope.bindings[name] = scope.getBinding(name);
|
||||
},
|
||||
|
||||
Block(node, parent, scope) {
|
||||
var paths = this.get("body");
|
||||
for (var path of (paths: Array)) {
|
||||
@ -632,11 +637,6 @@ export default class Scope {
|
||||
|
||||
// Class
|
||||
|
||||
if (path.isClassDeclaration()) {
|
||||
var name = path.node.id.name;
|
||||
this.bindings[name] = this.parent.bindings[name];
|
||||
}
|
||||
|
||||
if (path.isClassExpression() && path.has("id")) {
|
||||
this.registerBinding("var", path);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user