don't create a new binding for local class ids, just copy the parents - fixes #1547

This commit is contained in:
Sebastian McKenzie 2015-05-15 19:11:24 +01:00
parent 01d399ee3c
commit 62b94f297a

View File

@ -599,8 +599,13 @@ export default class Scope {
// Class
if (path.isClass() && path.has("id")) {
this.registerBinding("var", path.get("id"));
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);
}
// Function - params, rest