| 2039 | return isSpecRunning() ? workFn() : workFn; |
| 2040 | ///////////////////// |
| 2041 | function workFn() { |
| 2042 | if (currentSpec.$injector) { |
| 2043 | throw new Error('Injector already created, can not register a module!'); |
| 2044 | } else { |
| 2045 | var modules = currentSpec.$modules || (currentSpec.$modules = []); |
| 2046 | angular.forEach(moduleFns, function(module) { |
| 2047 | if (angular.isObject(module) && !angular.isArray(module)) { |
| 2048 | modules.push(function($provide) { |
| 2049 | angular.forEach(module, function(value, key) { |
| 2050 | $provide.value(key, value); |
| 2051 | }); |
| 2052 | }); |
| 2053 | } else { |
| 2054 | modules.push(module); |
| 2055 | } |
| 2056 | }); |
| 2057 | } |
| 2058 | } |
| 2059 | }; |
| 2060 | |
| 2061 | /** |