(serviceName, caller)
| 5138 | function createInternalInjector(cache, factory) { |
| 5139 | |
| 5140 | function getService(serviceName, caller) { |
| 5141 | if (cache.hasOwnProperty(serviceName)) { |
| 5142 | if (cache[serviceName] === INSTANTIATING) { |
| 5143 | throw $injectorMinErr('cdep', 'Circular dependency found: {0}', |
| 5144 | serviceName + ' <- ' + path.join(' <- ')); |
| 5145 | } |
| 5146 | return cache[serviceName]; |
| 5147 | } else { |
| 5148 | try { |
| 5149 | path.unshift(serviceName); |
| 5150 | cache[serviceName] = INSTANTIATING; |
| 5151 | cache[serviceName] = factory(serviceName, caller); |
| 5152 | return cache[serviceName]; |
| 5153 | } catch (err) { |
| 5154 | if (cache[serviceName] === INSTANTIATING) { |
| 5155 | delete cache[serviceName]; |
| 5156 | } |
| 5157 | throw err; |
| 5158 | } finally { |
| 5159 | path.shift(); |
| 5160 | } |
| 5161 | } |
| 5162 | } |
| 5163 | |
| 5164 | |
| 5165 | function injectionArgs(fn, locals, serviceName) { |
no test coverage detected