Skip to content

Commit

Permalink
Review as per @briancavalier comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Younes Ouadi committed Jun 10, 2014
1 parent 2d98b37 commit 79ade76
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions lib/scope.js
Expand Up @@ -12,7 +12,7 @@ define(function(require) {

var when, defer, sequence, array, object, loader, Map,
ComponentFactory, Lifecycle, Resolver, WireProxy, PluginRegistry,
undef, specUtils, DirectedGraph, importsGraph, cyclesTracker;
undef, specUtils, DirectedGraph, cyclesTracker;

when = require('when');
sequence = require('when/sequence');
Expand Down Expand Up @@ -270,9 +270,9 @@ define(function(require) {
var self = this;

// instantiate the imports graph
importsGraph = new DirectedGraph();
var importsGraph = new DirectedGraph();

return processImports(self, spec).then(function(importedSpecs){
return processImports(self, spec, importsGraph).then(function(importedSpecs){
// modules of importing spec overrides modules of imported spec.
return processSpec(self, object.mixin(importedSpecs, spec));
});
Expand Down Expand Up @@ -483,7 +483,7 @@ define(function(require) {

function noop() {}

function processImports(scope, spec, importingModuleId) {
function processImports(scope, spec, importsGraph, importingModuleId) {
if ( ! spec || ! spec.$imports ) {
return when({});
}
Expand All @@ -500,14 +500,14 @@ define(function(require) {

// go ahead with the import
return when(scope.getModule(importedModuleId), function(importedSpec){
return processImports(scope, importedSpec, importedModuleId).then(function(importedSpecs){
return processImports(scope, importedSpec, importsGraph, importedModuleId).then(function(importedSpecs){
// modules of importing spec overrides modules of imported specs.
importedSpecs = object.mixin(importedSpecs, importedSpec);

// modules in the right overrides modules in the left
currentImports = object.mixin(currentImports, importedSpecs);

return when(currentImports);
return currentImports;
});
});
}, {});
Expand Down
2 changes: 1 addition & 1 deletion test/node/context-test.js
Expand Up @@ -167,7 +167,7 @@ buster.testCase('context', {
);
},
' / should not import circular import of three assemblies': function() {
return createContext('./fixtures/imports-test/circular-imports-assembly2-1').then(
return createContext('./fixtures/imports-test/circular-imports-assembly3-1').then(
fail,
function(context) {
assert(true);
Expand Down

0 comments on commit 79ade76

Please sign in to comment.