defineBridge method

void defineBridge(
  1. BridgedClass bridgedClass
)

Registers a bridged class in this environment.

bridgedClass The bridged class definition to register.

This makes the native class available for use in interpreted code under the name specified by the bridged class definition. Registers a bridged class in this environment.

bridgedClass The bridged class definition to register.

This makes the native class available for use in interpreted code under the name specified by the bridged class definition.

Implementation

void defineBridge(BridgedClass bridgedClass) {
  // An already-built class registers as a trivial `() => obj` thunk; the
  // lazy substrate resolves it on first lookup and memoizes (behaviour
  // unchanged for eager callers). See [defineBridgeLazy].
  defineBridgeLazy(
      bridgedClass.name, bridgedClass.nativeType, () => bridgedClass);
}