fix remaining outer binding identifier issues
This commit is contained in:
parent
64a9a6027e
commit
8ec3e16794
@ -402,7 +402,7 @@ export default class Scope {
|
||||
if (path.isLabeledStatement()) {
|
||||
this.registerBinding("label", path);
|
||||
} else if (path.isFunctionDeclaration()) {
|
||||
this.registerBinding("hoisted", path.get("id"), true);
|
||||
this.registerBinding("hoisted", path.get("id"), path);
|
||||
} else if (path.isVariableDeclaration()) {
|
||||
let declarations = path.get("declarations");
|
||||
for (let declar of (declarations: Array)) {
|
||||
|
||||
@ -27,15 +27,28 @@ export function getBindingIdentifiers(
|
||||
} else {
|
||||
ids[id.name] = id;
|
||||
}
|
||||
} else if (t.isExportDeclaration(id)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (t.isExportDeclaration(id)) {
|
||||
if (t.isDeclaration(node.declaration)) {
|
||||
search.push(node.declaration);
|
||||
}
|
||||
} else if (outerOnly) {
|
||||
if (t.isFunction(id)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (outerOnly) {
|
||||
if (t.isFunctionDeclaration(id)) {
|
||||
search.push(id.id);
|
||||
continue;
|
||||
}
|
||||
} else if (keys) {
|
||||
|
||||
if (t.isFunctionExpression(id)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (keys) {
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
let key = keys[i];
|
||||
if (id[key]) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user