Skip to content

Commit

Permalink
fixed files form Closure #24
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent 26c4d2d commit 62feb63
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,24 +275,25 @@ private void findAliases(NodeTraversal t) {
Node n = v.getNode();
int type = n.getType();
Node parent = n.getParent();
if (parent.isVar()) {
if (n.hasChildren() && n.getFirstChild().isQualifiedName()) {
if (parent.isVar() &&
n.hasChildren() && n.getFirstChild().isQualifiedName()) {
String name = n.getString();
Var aliasVar = scope.getVar(name);
aliases.put(name, aliasVar);

String qualifiedName =
aliasVar.getInitialValue().getQualifiedName();
transformation.addAlias(name, qualifiedName);
} else if (v.isBleedingFunction()) {
// Bleeding functions already get a BAD_PARAMETERS error, so just
// do nothing.
} else if (parent.getType() == Token.LP) {
// Parameters of the scope function also get a BAD_PARAMETERS
// error.
} else {
// TODO(robbyw): Support using locals for private variables.
report(t, n, GOOG_SCOPE_NON_ALIAS_LOCAL, n.getString());
}
}
}
}

Expand Down

0 comments on commit 62feb63

Please sign in to comment.