(serviceName, caller)
| 5073 | function createInternalInjector(cache, factory) { |
| 5074 | |
| 5075 | function getService(serviceName, caller) { |
| 5076 | if (cache.hasOwnProperty(serviceName)) { |
| 5077 | if (cache[serviceName] === INSTANTIATING) { |
| 5078 | throw $injectorMinErr('cdep', 'Circular dependency found: {0}', |
| 5079 | serviceName + ' <- ' + path.join(' <- ')); |
| 5080 | } |
| 5081 | return cache[serviceName]; |
| 5082 | } else { |
| 5083 | try { |
| 5084 | path.unshift(serviceName); |
| 5085 | cache[serviceName] = INSTANTIATING; |
| 5086 | cache[serviceName] = factory(serviceName, caller); |
| 5087 | return cache[serviceName]; |
| 5088 | } catch (err) { |
| 5089 | if (cache[serviceName] === INSTANTIATING) { |
| 5090 | delete cache[serviceName]; |
| 5091 | } |
| 5092 | throw err; |
| 5093 | } finally { |
| 5094 | path.shift(); |
| 5095 | } |
| 5096 | } |
| 5097 | } |
| 5098 | |
| 5099 | |
| 5100 | function injectionArgs(fn, locals, serviceName) { |
no test coverage detected