(serviceName, caller)
| 5025 | function createInternalInjector(cache, factory) { |
| 5026 | |
| 5027 | function getService(serviceName, caller) { |
| 5028 | if (cache.hasOwnProperty(serviceName)) { |
| 5029 | if (cache[serviceName] === INSTANTIATING) { |
| 5030 | throw $injectorMinErr('cdep', 'Circular dependency found: {0}', |
| 5031 | serviceName + ' <- ' + path.join(' <- ')); |
| 5032 | } |
| 5033 | return cache[serviceName]; |
| 5034 | } else { |
| 5035 | try { |
| 5036 | path.unshift(serviceName); |
| 5037 | cache[serviceName] = INSTANTIATING; |
| 5038 | cache[serviceName] = factory(serviceName, caller); |
| 5039 | return cache[serviceName]; |
| 5040 | } catch (err) { |
| 5041 | if (cache[serviceName] === INSTANTIATING) { |
| 5042 | delete cache[serviceName]; |
| 5043 | } |
| 5044 | throw err; |
| 5045 | } finally { |
| 5046 | path.shift(); |
| 5047 | } |
| 5048 | } |
| 5049 | } |
| 5050 | |
| 5051 | |
| 5052 | function injectionArgs(fn, locals, serviceName) { |
no test coverage detected