Skip to content

Commit

Permalink
require.js update for disabled modules opting out of cycle breaking.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrburke committed Apr 26, 2012
1 parent 72e09f0 commit 14e30da
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions require.js
Expand Up @@ -160,7 +160,7 @@ var requirejs, require, define;
//load. Important for consistent cycle resolution
//behavior.
waitAry = [],
inCheckLoaded, inCycle, Module, context, handlers,
inCheckLoaded, Module, context, handlers,
checkLoadedTimeoutId;

/**
Expand Down Expand Up @@ -458,7 +458,7 @@ var requirejs, require, define;
return;
}

if (!depMod.inited) {
if (!depMod.inited || !depMod.enabled) {
//Dependency is not inited, so this cannot
//be used to determine a cycle.
foundModule = null;
Expand Down Expand Up @@ -496,7 +496,7 @@ var requirejs, require, define;
}

if (depMod) {
if (!depMod.inited) {
if (!depMod.inited || !depMod.enabled) {
//Dependency is not inited,
//so this module cannot be
//given a forced value yet.
Expand Down Expand Up @@ -535,7 +535,7 @@ var requirejs, require, define;
map, modId, err;

//Do not bother if this call was a result of a cycle break.
if (inCycle || inCheckLoaded) {
if (inCheckLoaded) {
return;
}

Expand Down Expand Up @@ -857,7 +857,6 @@ var requirejs, require, define;
this.emit('defined', this.exports);
this.defineEmitComplete = true;
}
checkLoaded();
}
}
},
Expand Down Expand Up @@ -1125,6 +1124,8 @@ var requirejs, require, define;
enabled: true
});

checkLoaded();

return context.require;
},

Expand Down Expand Up @@ -1212,6 +1213,8 @@ var requirejs, require, define;
//the call for it.
callGetModule([moduleName, [], null]);
}

checkLoaded();
},

/**
Expand Down

0 comments on commit 14e30da

Please sign in to comment.