registerBridgeType method

void registerBridgeType(
  1. BridgedClass bridgedClass
)

Pre-registers a bridge's native-type mapping for runtime type resolution.

Unlike defineBridge, this does NOT add bridgedClass.name to the lexical scope (_bridgedClasses). It only populates _bridgedClassesLookupByType so that toBridgedInstance can wrap native objects returned by bridge methods regardless of whether the script's imports have been processed yet.

The runner's warm parent registers bridges through this (lazy) route only (SCF9): the type lookup without the name binding, so a script's bare names come from its imports. Mirrors tom_d4rt:Environment.registerBridgeType.

Implementation

void registerBridgeType(BridgedClass bridgedClass) {
  registerBridgeTypeLazy(bridgedClass.nativeType, () => bridgedClass);
}