dist/crocodoc.viewer.js
function findCircularDependencies(componentName, dependencies, path) {
        var i;
        path = path || componentName;
        for (i = 0; i < dependencies.length; ++i) {
            if (componentName === dependencies[i]) {
                throw new Error('Circular dependency detected: ' + path + '->' + dependencies[i]);
            } else if (components[dependencies[i]]) {
                findCircularDependencies(componentName, components[dependencies[i]].mixins, path + '->' + dependencies[i]);
            }
        }
    }
function findCircularDependencies(componentName, dependencies, path) {
        var i;
        path = path || componentName;
        for (i = 0; i < dependencies.length; ++i) {
            if (componentName === dependencies[i]) {
                throw new Error('Circular dependency detected: ' + path + '->' + dependencies[i]);
            } else if (components[dependencies[i]]) {
                findCircularDependencies(componentName, components[dependencies[i]].mixins, path + '->' + dependencies[i]);
            }
        }
    }
function findCircularDependencies ( componentName , dependencies , path ) { var i ; path = path || componentName ; for ( i = 0 ; i < dependencies . length ; ++ i ) { if ( componentName === dependencies [ i ] ) { throw new Error ( 'Circular dependency detected: ' + path + '->' + dependencies [ i ] ) ; } else if ( components [ dependencies [ i ] ] ) { findCircularDependencies ( componentName , components [ dependencies [ i ] ] . mixins , path + '->' + dependencies [ i ] ) ; } } }
Find circular dependencies in component mixins
@param   {string} componentName   The component name that is being added
@param   {Array} dependencies  Array of component mixin dependencies
@param   {void} path           String used to keep track of depencency graph
@returns {void}
Find circular dependencies in component mixins