Fix error in window module instanciation

This commit is contained in:
Nathan Gray 2013-04-01 19:06:47 +00:00
parent 792152497c
commit 8e66bc33bf

View File

@ -617,18 +617,20 @@
// Check whether the module container for that window // Check whether the module container for that window
// has been found // has been found
if (mods != null) if (mods != null && typeof mods[_module] != 'undefined')
{ {
// If the given module has not been instanciated for
// this window,
if (typeof mods[_module] === 'undefined')
{
var mod = modules[_module];
mods[_module] = mod.code.call(this, null, _for);
}
return mods[_module]; return mods[_module];
} }
// If the given module has not been instanciated for
// this window, instanciate it
if (mods == null) mods = {};
if (typeof mods[_module] === 'undefined')
{
var mod = modules[_module];
mods[_module] = mod.code.call(this, null, _for);
}
return mods[_module];
} }
} }