code: public static String getNearestFunctionName(Node n) {
      if (!n.isFunction()) {
        return null;
      }
  
      String name = getName(n);
      if (name != null) {
        return name;
      }
  
      // Check for the form { 'x' : function() { }} and {x() {}}
      Node parent = n.getParent();
      switch (parent.getToken()) {
        case MEMBER_FUNCTION_DEF:
        case SETTER_DEF:
        case GETTER_DEF:
        case STRING_KEY:
          // Return the name of the literal's key.
          return parent.getString();
        case NUMBER:
          return getStringValue(parent);
        default:
          break;
      }
  
      return null;
    }
docs: Gets the function's name. This method recognizes the forms:
  <ul>
  <li>{@code &#123;'name': function() ...&#125;}</li>
  <li>{@code &#123;name: function() ...&#125;}</li>
  <li>{@code function name() ...}</li>
  <li>{@code var name = function() ...}</li>
  <li>{@code var obj = {name() {} ...}}</li>
  <li>{@code qualified.name = function() ...}</li>
  <li>{@code var name2 = function name1() ...}</li>
  <li>{@code qualified.name2 = function name1() ...}</li>
  </ul>
  
  @param n a node whose type is {@link Token#FUNCTION}
  @return the function's name, or {@code null} if it has no name