(serviceName, caller)
| 5045 | function createInternalInjector(cache, factory) { |
| 5046 | |
| 5047 | function getService(serviceName, caller) { |
| 5048 | if (cache.hasOwnProperty(serviceName)) { |
| 5049 | if (cache[serviceName] === INSTANTIATING) { |
| 5050 | throw $injectorMinErr('cdep', 'Circular dependency found: {0}', |
| 5051 | serviceName + ' <- ' + path.join(' <- ')); |
| 5052 | } |
| 5053 | return cache[serviceName]; |
| 5054 | } else { |
| 5055 | try { |
| 5056 | path.unshift(serviceName); |
| 5057 | cache[serviceName] = INSTANTIATING; |
| 5058 | cache[serviceName] = factory(serviceName, caller); |
| 5059 | return cache[serviceName]; |
| 5060 | } catch (err) { |
| 5061 | if (cache[serviceName] === INSTANTIATING) { |
| 5062 | delete cache[serviceName]; |
| 5063 | } |
| 5064 | throw err; |
| 5065 | } finally { |
| 5066 | path.shift(); |
| 5067 | } |
| 5068 | } |
| 5069 | } |
| 5070 | |
| 5071 | |
| 5072 | function injectionArgs(fn, locals, serviceName) { |
no test coverage detected