From 59aef482815f3ceaa671685db4070a67971978a2 Mon Sep 17 00:00:00 2001 From: Georgios Kalpakas Date: Thu, 18 Feb 2016 01:32:54 +0200 Subject: [PATCH] refactor(ngMock): make `ngMock` minification-safe It is not common, but some workflows result in `angular-mocks` being minified. Fixes #13542 Closes #14073 --- src/ngMock/angular-mocks.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ngMock/angular-mocks.js b/src/ngMock/angular-mocks.js index 8dc112e46c28..3b4f94a211ec 100644 --- a/src/ngMock/angular-mocks.js +++ b/src/ngMock/angular-mocks.js @@ -2659,11 +2659,11 @@ if (window.jasmine || window.mocha) { var fn, modules = currentSpec.$modules || (currentSpec.$modules = []); angular.forEach(moduleFns, function(module) { if (angular.isObject(module) && !angular.isArray(module)) { - fn = function($provide) { + fn = ['$provide', function($provide) { angular.forEach(module, function(value, key) { $provide.value(key, value); }); - }; + }]; } else { fn = module; } @@ -2784,9 +2784,9 @@ if (window.jasmine || window.mocha) { function workFn() { var modules = currentSpec.$modules || []; var strictDi = !!currentSpec.$injectorStrict; - modules.unshift(function($injector) { + modules.unshift(['$injector', function($injector) { currentSpec.$providerInjector = $injector; - }); + }]); modules.unshift('ngMock'); modules.unshift('ng'); var injector = currentSpec.$injector;