Program: 27587
Project: 27587
Buggy source:
private void visitExport(NodeTraversal t,Node n,Node parent){
  if (n.getBooleanProp(Node.EXPORT_DEFAULT)) {
    Node var=IR.var(IR.name(DEFAULT_EXPORT_NAME),n.removeFirstChild());
    var.useSourceInfoIfMissingFromForTree(n);
    var.setJSDocInfo(n.getJSDocInfo());
    n.setJSDocInfo(null);
    n.getParent().replaceChild(n,var);
    exportMap.put("String_Node_Str",DEFAULT_EXPORT_NAME);
  }
 else   if (n.getBooleanProp(Node.EXPORT_ALL_FROM)) {
    compiler.report(JSError.make(n,Es6ToEs3Converter.CANNOT_CONVERT_YET,"String_Node_Str"));
  }
 else   if (n.getChildCount() == 2) {
    Node moduleIdentifier=n.getLastChild();
    Node importNode=new Node(Token.IMPORT,moduleIdentifier.cloneNode());
    importNode.copyInformationFrom(n);
    parent.addChildBefore(importNode,n);
    visit(t,importNode,parent);
    String loadAddress=loader.locate(moduleIdentifier.getString(),t.getInput());
    String moduleName=toModuleName(loadAddress);
    for (    Node exportSpec : n.getFirstChild().children()) {
      String nameFromOtherModule=exportSpec.getFirstChild().getString();
      String exportedName=exportSpec.getLastChild().getString();
      exportMap.put(exportedName,moduleName + "String_Node_Str" + nameFromOtherModule);
    }
    parent.removeChild(n);
  }
 else {
    if (n.getFirstChild().getType() == Token.EXPORT_SPECS) {
      for (      Node exportSpec : n.getFirstChild().children()) {
        Node origName=exportSpec.getFirstChild();
        exportMap.put(exportSpec.getChildCount() == 2 ? exportSpec.getLastChild().getString() : origName.getString(),origName.getString());
      }
      parent.removeChild(n);
    }
 else {
      Node declaration=n.getFirstChild();
      for (int i=0; i < declaration.getChildCount(); i++) {
        Node maybeName=declaration.getChildAtIndex(i);
        if (!maybeName.isName()) {
          break;
        }
        if (declaration.isClass() && i > 0) {
          break;
        }
        String name=maybeName.getString();
        Var v=t.getScope().getVar(name);
        if (v == null || v.isGlobal()) {
          exportMap.put(name,name);
        }
        if (declaration.isClass()) {
          types.add(name);
        }
      }
      declaration.setJSDocInfo(n.getJSDocInfo());
      n.setJSDocInfo(null);
      parent.replaceChild(n,declaration.detachFromParent());
    }
    compiler.reportCodeChange();
  }
}

Fixed version (ground truth):
private void visitExport(NodeTraversal t,Node export,Node parent){
  if (export.getBooleanProp(Node.EXPORT_DEFAULT)) {
    Node child=export.getFirstChild();
    String name=null;
    if (child.isFunction()) {
      name=NodeUtil.getFunctionName(child);
    }
 else     if (child.isClass()) {
      name=NodeUtil.getClassName(child);
    }
    if (name != null) {
      Node decl=child.cloneTree();
      decl.setJSDocInfo(export.getJSDocInfo());
      parent.replaceChild(export,decl);
      exportMap.put("String_Node_Str",name);
    }
 else {
      Node var=IR.var(IR.name(DEFAULT_EXPORT_NAME),export.removeFirstChild());
      var.useSourceInfoIfMissingFromForTree(export);
      parent.replaceChild(export,var);
      exportMap.put("String_Node_Str",DEFAULT_EXPORT_NAME);
    }
  }
 else   if (export.getBooleanProp(Node.EXPORT_ALL_FROM)) {
    compiler.report(JSError.make(export,Es6ToEs3Converter.CANNOT_CONVERT_YET,"String_Node_Str"));
  }
 else   if (export.getChildCount() == 2) {
    Node moduleIdentifier=export.getLastChild();
    Node importNode=new Node(Token.IMPORT,moduleIdentifier.cloneNode());
    importNode.copyInformationFrom(export);
    parent.addChildBefore(importNode,export);
    visit(t,importNode,parent);
    String loadAddress=loader.locate(moduleIdentifier.getString(),t.getInput());
    String moduleName=toModuleName(loadAddress);
    for (    Node exportSpec : export.getFirstChild().children()) {
      String nameFromOtherModule=exportSpec.getFirstChild().getString();
      String exportedName=exportSpec.getLastChild().getString();
      exportMap.put(exportedName,moduleName + "String_Node_Str" + nameFromOtherModule);
    }
    parent.removeChild(export);
  }
 else {
    if (export.getFirstChild().getType() == Token.EXPORT_SPECS) {
      for (      Node exportSpec : export.getFirstChild().children()) {
        Node origName=exportSpec.getFirstChild();
        exportMap.put(exportSpec.getChildCount() == 2 ? exportSpec.getLastChild().getString() : origName.getString(),origName.getString());
      }
      parent.removeChild(export);
    }
 else {
      Node declaration=export.getFirstChild();
      for (int i=0; i < declaration.getChildCount(); i++) {
        Node maybeName=declaration.getChildAtIndex(i);
        if (!maybeName.isName()) {
          break;
        }
        if (declaration.isClass() && i > 0) {
          break;
        }
        String name=maybeName.getString();
        Var v=t.getScope().getVar(name);
        if (v == null || v.isGlobal()) {
          exportMap.put(name,name);
        }
        if (declaration.isClass()) {
          types.add(name);
        }
      }
      declaration.setJSDocInfo(export.getJSDocInfo());
      export.setJSDocInfo(null);
      parent.replaceChild(export,declaration.detachFromParent());
    }
    compiler.reportCodeChange();
  }
}