// then the NAME must be the child of a VAR node, and we must
// be in a VAR assignment.
Node aliasParent = alias.node.getParent();
if (aliasParent.getType() == Token.NAME) {
// Ensure that the local variable is well defined and never reassigned.
Scope scope = alias.scope;
Var aliasVar = scope.getVar(aliasParent.getString());
ReferenceCollectingCallback collector =
new ReferenceCollectingCallback(compiler,
ReferenceCollectingCallback.DO_NOTHING_BEHAVIOR,
Predicates.<Var>equalTo(aliasVar));
(new NodeTraversal(compiler, collector)).traverseAtScope(scope);