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);
ReferenceCollection aliasRefs = collector.getReferences(aliasVar);
if (aliasRefs.isWellDefined()
&& aliasRefs.firstReferenceIsAssigningDeclaration()
&& aliasRefs.isAssignedOnceInLifetime()) {
// The alias is well-formed, so do the inlining now.
int size = aliasRefs.references.size();