docs: function _functionBelongsToObject(self, caller, target, protectedMode = false) {
      if (!caller) return false;
  
      // We are caching the results for better performance.
      let cacheOfResultsForSelf = resultCache.get(self);
  
      if (cacheOfResultsForSelf && cacheOfResultsForSelf.has(caller)) {
          return cacheOfResultsForSelf.get(caller);
      }
  
      let proto = Object.getPrototypeOf(self);
  
      // proto !== target - means that extend was made.
      let check;
      if ((caller.name === 'get' || caller.name === 'set')) {
          check = !getterOrSetterBelongsToObject(caller, target);
      } else {
          check = !(target[caller.name] || target.constructor === caller);
      }
      if (target && proto !== target && check) {
          if (protectedMode) {
              if (!checkIfTargetIsRelated(proto, target)) {
                  return false;
              }
          } else {
              return false;
          }
      }
  
      let result = false;
  
      while (proto !== Object && result === false && proto.constructor !== Object) {
          result = functionBelongsToObjectInternal(proto, caller);
          proto = Object.getPrototypeOf(proto);
      }
  
      if (!cacheOfResultsForSelf) {
          cacheOfResultsForSelf = new WeakMap();
      }
  
      cacheOfResultsForSelf.set(caller, result);
      resultCache.set(self, cacheOfResultsForSelf);
      return result;
  }