typedef fn void(?&Erased userdata) DomEventHandlerStored type-erased (the table holds handlers with unrelated context types); the generic wrappers below are the only writers and always pair a handler with userdata of the matching type. A callback id is slot + DOM_MAX_CALLBACKS * generation, so an id whose slot was freed and reused (a timer that already fired, say) is recognized as stale.
erased, see std/erased.h