* Invoke the given callback in the context of this scene. * * @remarks * This method makes sure that the context of this scene is globally available * during the execution of the callback. * * @param callback - The callback to invoke.
(callback: () => T)
| 356 | * @param callback - The callback to invoke. |
| 357 | */ |
| 358 | protected execute<T>(callback: () => T): T { |
| 359 | let result: T; |
| 360 | startScene(this); |
| 361 | startPlayback(this.playback); |
| 362 | try { |
| 363 | result = callback(); |
| 364 | } finally { |
| 365 | endPlayback(this.playback); |
| 366 | endScene(this); |
| 367 | } |
| 368 | |
| 369 | return result; |
| 370 | } |
| 371 | } |
nothing calls this directly
no test coverage detected