(
newContext: Context,
fn: F,
thisArg?: ThisParameterType<F>,
...args: A
)
| 33 | } |
| 34 | |
| 35 | with<A extends unknown[], F extends (...args: A) => ReturnType<F>>( |
| 36 | newContext: Context, |
| 37 | fn: F, |
| 38 | thisArg?: ThisParameterType<F>, |
| 39 | ...args: A |
| 40 | ): ReturnType<F> { |
| 41 | const previousContext = this.currentContext |
| 42 | this.currentContext = newContext |
| 43 | try { |
| 44 | return fn.apply(thisArg, args) |
| 45 | } finally { |
| 46 | this.currentContext = previousContext |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | bind<T>(bindContext: Context, target: T): T { |
| 51 | if (typeof target !== 'function') { |
no test coverage detected