properly register for head variable declaration paths when performing scope tracking - fixes #1524
This commit is contained in:
parent
024e4454a1
commit
ad44190c6b
@ -463,6 +463,14 @@ export default class Scope {
|
|||||||
registerBinding(kind: string, path: TraversalPath) {
|
registerBinding(kind: string, path: TraversalPath) {
|
||||||
if (!kind) throw new ReferenceError("no `kind`");
|
if (!kind) throw new ReferenceError("no `kind`");
|
||||||
|
|
||||||
|
if (path.isVariableDeclaration()) {
|
||||||
|
var declarators = path.get("declarations");
|
||||||
|
for (var declar of (declarators: Array)) {
|
||||||
|
this.registerBinding(kind, declar);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var ids = path.getBindingIdentifiers();
|
var ids = path.getBindingIdentifiers();
|
||||||
|
|
||||||
for (var name in ids) {
|
for (var name in ids) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user