(event, obj, fn)
| 82 | } |
| 83 | |
| 84 | function _register(event, obj, fn) { |
| 85 | install(event); |
| 86 | |
| 87 | const ref = new SafeWeakRef(obj); |
| 88 | ref.fn = fn; |
| 89 | |
| 90 | registry ||= new SafeFinalizationRegistry(clear); |
| 91 | registry.register(obj, ref); |
| 92 | |
| 93 | ArrayPrototypePush(refs[event], ref); |
| 94 | } |
| 95 | |
| 96 | /** |
| 97 | * Execute the given function when the process exits, |
no test coverage detected
searching dependent graphs…