Skip to content

Commit

Permalink
Nit: avoid unnecessary call
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Nov 4, 2019
1 parent 65c0f1f commit 14a6afa
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -265,10 +265,10 @@ const rewriteReferencesVisitor = {
}
} else {
const ids = left.getOuterBindingIdentifiers();
const programScopeIds = Object.keys(ids).filter(
localName =>
scope.getBinding(localName) === path.scope.getBinding(localName),
);
const programScopeIds = Object.keys(ids).filter(localName => {
const binding = scope.getBinding(localName);
return binding && binding === path.scope.getBinding(localName);
});
const id = programScopeIds.find(localName => imported.has(localName));

if (id) {
Expand Down

0 comments on commit 14a6afa

Please sign in to comment.