Skip to content

Commit

Permalink
Merge pull request #70 from GordonSmith/GH-67-2
Browse files Browse the repository at this point in the history
GH-67-2 runtime require behaviour
  • Loading branch information
chuckdumont authored Oct 23, 2017
2 parents 8f7521c + 190f77a commit 90d3e94
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions lib/DojoAMDMainTemplate.runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,7 @@ module.exports = function() {
}
}
if (!result) {
var msg = 'Module not found: ' + mid;
if (noInstall) {
throw new Error(msg);
} else {
console.error(msg);
}
throw new Error('Module not found: ' + mid);
}
return result;
}
Expand All @@ -115,10 +110,18 @@ module.exports = function() {
}
if (type === '[object Array]') {
var modules = [], callback = a2;
a1.forEach(function(mid) {
modules.push(findModule(mid, referenceModule));
var foundAll = true;
a1.forEach(function (mid) {
try {
modules.push(findModule(mid, referenceModule));
} catch (e) {
console.error(e.message);
foundAll = false;
}
});
callback.apply(this, modules);
if (foundAll) {
callback.apply(this, modules);
}
return req;
} else {
throw new Error('Unsupported require call');
Expand Down

0 comments on commit 90d3e94

Please sign in to comment.