ownerOfSuperObject static method

InterpretedInstance? ownerOfSuperObject(
  1. Object? value
)

The interpreted instance whose bridged super object value is, or null.

SCF31. A script class extending a CONCRETE bridged class — class _RenderMeasureBox extends RenderProxyBox — gets no proxy: the base is constructed natively and that object is what native code holds, because only the real object lays out and paints. When it comes back (a framework-passed renderObject, a viewport's delegate getter) it is the bare base, and the script's own class was unreadable on it. The native object and its instance are one object to the script, exactly as a proxy and its instance are, so interpretedBehind answers for both — the carrier differs, the identity does not.

Recorded by InterpretedInstance.bridgedSuperObject's setter, so every constructed super object is covered, not only one that happened to cross through extractBridgedArg first.

Implementation

static InterpretedInstance? ownerOfSuperObject(Object? value) {
  if (value == null || !_canKey(value)) return null;
  final owner = _nativeToInterpreted[value];
  if (owner is! InterpretedInstance) return null;
  return identical(owner.bridgedSuperObject, value) ? owner : null;
}