resetNativeAccumulators static method

void resetNativeAccumulators()

Clears the cross-build native-side accumulator (OPEN B.12 / §U28).

Replaces the _nativeToInterpreted Expando with a fresh instance — the only way to bulk-drop its entries, since Expando exposes neither a clear() nor an iterator — and zeroes nativeRegistrationCount. Any native object previously mapped reads back as null afterwards.

Wired into the runtime reset API (D4rtRunner.resetScriptDeclarations / D4rt.resetScriptDeclarations) so an embedder's /clear actually frees the native→interpreted entries pinned by the previous build's framework objects, instead of leaking them until process recycle.

NOTE: this state is process-global (static on D4), shared by every live interpreter. It does not touch the registration caches (_interfaceProxies, _genericConstructors, _typeCoercions, …) — those are populated once at bridge finalization and must persist across builds.

Implementation

static void resetNativeAccumulators() {
  _nativeToInterpreted = Expando<Object>('d4rt:nativeToInterpreted');
  _nativeRegistrationCount = 0;
}