| 305 | |
| 306 | // 3p-only-start |
| 307 | override runInContext<ReturnT>(fn: () => ReturnT): ReturnT { |
| 308 | assertNotDestroyed(this); |
| 309 | |
| 310 | const previousInjector = setCurrentInjector(this); |
| 311 | const previousInjectImplementation = setInjectImplementation(undefined); |
| 312 | |
| 313 | let prevInjectContext: InjectorProfilerContext | undefined; |
| 314 | if (ngDevMode) { |
| 315 | prevInjectContext = setInjectorProfilerContext({injector: this, token: null}); |
| 316 | } |
| 317 | |
| 318 | try { |
| 319 | return fn(); |
| 320 | } finally { |
| 321 | setCurrentInjector(previousInjector); |
| 322 | setInjectImplementation(previousInjectImplementation); |
| 323 | ngDevMode && setInjectorProfilerContext(prevInjectContext!); |
| 324 | } |
| 325 | } |
| 326 | // 3p-only-end |
| 327 | |
| 328 | override get<T>( |