Program: 27794
Project: 27794
Buggy source:
/** 
 * Determines whether the given NAME node belongs to a declaration that can be moved across modules. If it is, registers it properly. There are four types of movable declarations: 1) var NAME = [movable object]; 2) function NAME() {} 3) NAME = [movable object]; NAME.prop = [movable object]; NAME.prop.prop2 = [movable object]; etc. 4) Class-defining function calls, like "inherits" and "mixin". NAME.inherits([some other name]); where "movable object" is a literal or a function.
 */
private boolean maybeProcessDeclaration(NodeTraversal t,Node name,Node parent,NamedInfo info){
  Node gramps=parent.getParent();
switch (parent.getType()) {
case Token.VAR:
    if (canMoveValue(name.getFirstChild())) {
      return info.addDeclaration(new Declaration(t.getModule(),name));
    }
  return false;
case Token.FUNCTION:
if (NodeUtil.isFunctionDeclaration(parent)) {
  return info.addDeclaration(new Declaration(t.getModule(),name));
}
return false;
case Token.ASSIGN:
case Token.GETPROP:
Node child=name;
for (Node current : name.getAncestors()) {
if (current.isGetProp()) {
}
 else if (current.isAssign() && current.getFirstChild() == child) {
Node currentParent=current.getParent();
if (currentParent.isExprResult() && canMoveValue(current.getLastChild())) {
return info.addDeclaration(new Declaration(t.getModule(),current));
}
}
 else {
return false;
}
child=current;
}
return false;
case Token.CALL:
if (NodeUtil.isExprCall(gramps)) {
SubclassRelationship relationship=compiler.getCodingConvention().getClassesDefinedByCall(parent);
if (relationship != null && name.getString().equals(relationship.subclassName)) {
return info.addDeclaration(new Declaration(t.getModule(),parent));
}
}
return false;
default :
return false;
}
}

Fixed version (ground truth):
/** 
 * Determines whether the given NAME node belongs to a declaration that can be moved across modules. If it is, registers it properly. There are four types of movable declarations: 1) var NAME = [movable object]; 2) function NAME() {} 3) NAME = [movable object]; NAME.prop = [movable object]; NAME.prop.prop2 = [movable object]; etc. 4) Class-defining function calls, like "inherits" and "mixin". NAME.inherits([some other name]); where "movable object" is a literal or a function.
 */
private boolean maybeProcessDeclaration(ReferenceCollectingCallback collector,Reference ref,NamedInfo info){
  Node name=ref.getNode();
  Node parent=name.getParent();
  Node gramps=parent.getParent();
switch (parent.getType()) {
case Token.VAR:
    if (canMoveValue(collector,ref.getScope(),name.getFirstChild())) {
      return info.addDeclaration(new Declaration(getModule(ref),name));
    }
  return false;
case Token.FUNCTION:
if (NodeUtil.isFunctionDeclaration(parent)) {
  return info.addDeclaration(new Declaration(getModule(ref),name));
}
return false;
case Token.ASSIGN:
case Token.GETPROP:
Node child=name;
for (Node current : name.getAncestors()) {
if (current.isGetProp()) {
}
 else if (current.isAssign() && current.getFirstChild() == child) {
Node currentParent=current.getParent();
if (currentParent.isExprResult() && canMoveValue(collector,ref.getScope(),current.getLastChild())) {
return info.addDeclaration(new Declaration(getModule(ref),current));
}
}
 else {
return false;
}
child=current;
}
return false;
case Token.CALL:
if (NodeUtil.isExprCall(gramps)) {
SubclassRelationship relationship=compiler.getCodingConvention().getClassesDefinedByCall(parent);
if (relationship != null && name.getString().equals(relationship.subclassName)) {
return info.addDeclaration(new Declaration(getModule(ref),parent));
}
}
return false;
default :
return false;
}
}