function lookupGetter(object, prop) {
    while (object !== null) {
      const desc = getOwnPropertyDescriptor(object, prop);
      if (desc) {
        if (desc.get) {
          return unapply(desc.get);
        }
        if (typeof desc.value === 'function') {
          return unapply(desc.value);
        }
      }
      object = getPrototypeOf(object);
    }
    function fallbackValue() {
      return null;
    }
    return fallbackValue;
  }
This method automatically checks if the prop is function or getter and behaves accordingly.

@param object - The object to look up the getter function in its prototype chain.
@param prop - The property name for which to find the getter function.
@returns The getter function found in the prototype chain or a fallback function.