receiverProxyFor static method
Object?
receiverProxyFor(
- String bridgedTypeName,
- InterpretedInstance instance,
- InterpreterVisitor visitor
The receiver proxy for bridgedTypeName on instance: the instance's
nativeProxy once one is kept, otherwise a new one from the registered
factory, kept as the instance's nativeProxy. Null when
bridgedTypeName is not marked with markProxyIsReceiver or has no
factory.
Implementation
static Object? receiverProxyFor(
String bridgedTypeName,
InterpretedInstance instance,
InterpreterVisitor visitor,
) {
if (!_receiverProxies.contains(bridgedTypeName)) return null;
final kept = instance.nativeProxy;
if (kept != null) return kept;
final proxy = tryCreateInterfaceProxyByName(
bridgedTypeName,
instance,
visitor,
);
if (proxy != null) instance.nativeProxy ??= proxy;
return instance.nativeProxy ?? proxy;
}