Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix(injector): check that modulesToLoad isArray. #12285

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/auto/injector.js
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ function createInjector(modulesToLoad, strictDi) {
// Module Loading
////////////////////////////////////
function loadModules(modulesToLoad) {
assertArg(isUndefined(modulesToLoad) || isArray(modulesToLoad), 'modulesToLoad', 'not an array');
var runBlocks = [], moduleFn;
forEach(modulesToLoad, function(module) {
if (loadedModules.get(module)) return;
Expand Down
6 changes: 6 additions & 0 deletions test/auto/injectorSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ describe('injector', function() {
});


it('should check its modulesToLoad argument', function() {
expect(function() { angular.injector('test'); })
.toThrowMinErr('ng', 'areq');
});


it('should resolve dependency graph and instantiate all services just once', function() {
var log = [];

Expand Down