| 2366 | return isSpecRunning() ? workFn() : workFn; |
| 2367 | ///////////////////// |
| 2368 | function workFn() { |
| 2369 | if (currentSpec.$injector) { |
| 2370 | throw new Error('Injector already created, can not register a module!'); |
| 2371 | } else { |
| 2372 | var modules = currentSpec.$modules || (currentSpec.$modules = []); |
| 2373 | angular.forEach(moduleFns, function(module) { |
| 2374 | if (angular.isObject(module) && !angular.isArray(module)) { |
| 2375 | modules.push(function($provide) { |
| 2376 | angular.forEach(module, function(value, key) { |
| 2377 | $provide.value(key, value); |
| 2378 | }); |
| 2379 | }); |
| 2380 | } else { |
| 2381 | modules.push(module); |
| 2382 | } |
| 2383 | }); |
| 2384 | } |
| 2385 | } |
| 2386 | }; |
| 2387 | |
| 2388 | /** |