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