* @template T * @param {() => T} fn
(fn)
| 300 | * @param {() => T} fn |
| 301 | */ |
| 302 | #run(fn) { |
| 303 | var previous_effect = active_effect; |
| 304 | var previous_reaction = active_reaction; |
| 305 | var previous_ctx = component_context; |
| 306 | |
| 307 | set_active_effect(this.#effect); |
| 308 | set_active_reaction(this.#effect); |
| 309 | set_component_context(this.#effect.ctx); |
| 310 | |
| 311 | try { |
| 312 | Batch.ensure(); |
| 313 | return fn(); |
| 314 | } catch (e) { |
| 315 | handle_error(e); |
| 316 | return null; |
| 317 | } finally { |
| 318 | set_active_effect(previous_effect); |
| 319 | set_active_reaction(previous_reaction); |
| 320 | set_component_context(previous_ctx); |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | /** |
| 325 | * Updates the pending count associated with the currently visible pending snippet, |
no test coverage detected