(serviceName, caller)
| 4703 | function createInternalInjector(cache, factory) { |
| 4704 | |
| 4705 | function getService(serviceName, caller) { |
| 4706 | if (cache.hasOwnProperty(serviceName)) { |
| 4707 | if (cache[serviceName] === INSTANTIATING) { |
| 4708 | throw $injectorMinErr('cdep', 'Circular dependency found: {0}', |
| 4709 | serviceName + ' <- ' + path.join(' <- ')); |
| 4710 | } |
| 4711 | return cache[serviceName]; |
| 4712 | } else { |
| 4713 | try { |
| 4714 | path.unshift(serviceName); |
| 4715 | cache[serviceName] = INSTANTIATING; |
| 4716 | cache[serviceName] = factory(serviceName, caller); |
| 4717 | return cache[serviceName]; |
| 4718 | } catch (err) { |
| 4719 | if (cache[serviceName] === INSTANTIATING) { |
| 4720 | delete cache[serviceName]; |
| 4721 | } |
| 4722 | throw err; |
| 4723 | } finally { |
| 4724 | path.shift(); |
| 4725 | } |
| 4726 | } |
| 4727 | } |
| 4728 | |
| 4729 | |
| 4730 | function injectionArgs(fn, locals, serviceName) { |
no test coverage detected