diff --git a/projects/Closure/24/com/google/javascript/jscomp/ScopedAliases.java b/projects/Closure/24/com/google/javascript/jscomp/ScopedAliases.java index 30d29d0..c248002 100644 --- a/projects/Closure/24/com/google/javascript/jscomp/ScopedAliases.java +++ b/projects/Closure/24/com/google/javascript/jscomp/ScopedAliases.java @@ -275,8 +275,8 @@ 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); @@ -284,15 +284,16 @@ private void findAliases(NodeTraversal t) { 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()); } - } } }