(profiler: Profiler | null)
| 32 | * @returns a cleanup function that, when invoked, removes a given profiler callback. |
| 33 | */ |
| 34 | export function setProfiler(profiler: Profiler | null): () => void { |
| 35 | if (profiler !== null) { |
| 36 | if (!profilerCallbacks.includes(profiler)) { |
| 37 | profilerCallbacks.push(profiler); |
| 38 | } |
| 39 | return () => removeProfiler(profiler); |
| 40 | } else { |
| 41 | profilerCallbacks.length = 0; |
| 42 | return NOOP_PROFILER_REMOVAL; |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Profiler function which wraps user code executed by the runtime. |
no test coverage detected
searching dependent graphs…