function checkForDependencies(module, queuedFrom) {

        // check this module's dependencies
        if (module.dependencies.length === 0) {
            // no dependencies, this module can be initialized right away
            initModule(module);
        } else {
            // check if dependencies are loaded
            var canInit = true;
            for (var index = 0; index < module.dependencies.length; index++) {
                var dependency = modules[module.dependencies[index]];
                var loadedDependency = false;
                // is dependency ready?
                if (dependency) {
                    if (dependency.loaded) {
                        loadedDependency = true;
                    }
                }
                // if not, add this module to the queue
                if (!loadedDependency) {
                    Sylx.log("Sylx: Dependency not loaded yet, adding " + module.name + " to queue");
                    dependenciesQueue[module.dependencies[index]] = dependenciesQueue[module.dependencies[index]] || [];
                    dependenciesQueue[module.dependencies[index]].push(module.name);
                    canInit = false;
                }
            }
            // if all dependencies are ready, we can init this module
            if (canInit) {
                initModule(module);
                // Remove from queue
                if (queuedFrom) {
                    dependenciesQueue[queuedFrom].splice(dependenciesQueue[queuedFrom].indexOf(module.name), 1);
                }
            }
        }
    }
/**
     * Check each potential module for its required dependencies
     * @param {object}   module     - The module to check
     * @param {string}   queuedFrom - String indicating if this module load was queued from another module
     */
Check each potential module for its required dependencies
@param {object}   module     - The module to check
@param {string}   queuedFrom - String indicating if this module load was queued from another module
Check each potential module for its required dependencies @param { object } module - The module to check @param { string } queuedFrom - String indicating if this module load was queued from another module
function checkForDependencies(module, queuedFrom) {
        if (module.dependencies.length === 0) {
            initModule(module);
        } else {
            var canInit = true;
            for (var index = 0; index < module.dependencies.length; index++) {
                var dependency = modules[module.dependencies[index]];
                var loadedDependency = false;
                if (dependency) {
                    if (dependency.loaded) {
                        loadedDependency = true;
                    }
                }
                if (!loadedDependency) {
                    Sylx.log("Sylx: Dependency not loaded yet, adding " + module.name + " to queue");
                    dependenciesQueue[module.dependencies[index]] = dependenciesQueue[module.dependencies[index]] || [];
                    dependenciesQueue[module.dependencies[index]].push(module.name);
                    canInit = false;
                }
            }
            if (canInit) {
                initModule(module);
                if (queuedFrom) {
                    dependenciesQueue[queuedFrom].splice(dependenciesQueue[queuedFrom].indexOf(module.name), 1);
                }
            }
        }
    }
function checkForDependencies ( module , queuedFrom ) { if ( module . dependencies . length === 0 ) { initModule ( module ) ; } else { var canInit = true ; for ( var index = 0 ; index < module . dependencies . length ; index ++ ) { var dependency = modules [ module . dependencies [ index ] ] ; var loadedDependency = false ; if ( dependency ) { if ( dependency . loaded ) { loadedDependency = true ; } } if ( ! loadedDependency ) { Sylx . log ( "Sylx: Dependency not loaded yet, adding " + module . name + " to queue" ) ; dependenciesQueue [ module . dependencies [ index ] ] = dependenciesQueue [ module . dependencies [ index ] ] || [ ] ; dependenciesQueue [ module . dependencies [ index ] ] . push ( module . name ) ; canInit = false ; } } if ( canInit ) { initModule ( module ) ; if ( queuedFrom ) { dependenciesQueue [ queuedFrom ] . splice ( dependenciesQueue [ queuedFrom ] . indexOf ( module . name ) , 1 ) ; } } } }
Check each potential module for its required dependencies
 @param {object}   module     - The module to check
 @param {string}   queuedFrom - String indicating if this module load was queued from another module
Check each potential module for its required dependencies @param { object } module - The module to check @param { string } queuedFrom - String indicating if this module load was queued from another module
// check this module's dependencies // no dependencies, this module can be initialized right away // check if dependencies are loaded // is dependency ready? // if not, add this module to the queue // if all dependencies are ready, we can init this module // Remove from queue