lib/queue.js
function(){
		var copy = [];

		// Handle recursive loops
		if ( queue.running ) {
			queue.waiting = true;
			return;
		}

		// Mark queue as running, then search for 
		queue.running = true;
		munit.each( queue.modules, function( assert, index ) {
			if ( ! queue.objects.length ) {
				return false;
			}
			else if ( ! munit.render.checkDepency( assert ) ) {
				return;
			}

			// Looking for specific key in queue object
			if ( munit.isString( assert.options.queue ) ) {
				munit.each( queue.objects, function( object, i ) {
					if ( object[ assert.options.queue ] ) {
						queue.modules[ index ] = null;
						queue.objects.splice( i, 1 );
						assert.queue = object;
						assert.trigger();
						return false;
					}
				});
			}
			// Any queue will do
			else {
				queue.modules[ index ] = null;
				assert.queue = queue.objects.shift();
				assert.trigger();
			}
		});

		// Clean out modules that completed (splicing causes iteration fails)
		queue.modules.forEach(function( assert ) {
			if ( assert !== null ) {
				copy.push( assert );
			}
		});
		queue.modules = copy;

		// Run again if check method was called during loop
		queue.running = false;
		if ( queue.waiting ) {
			queue.waiting = false;
			queue.check();
		}
	}
function(){
		var copy = [];

		// Handle recursive loops
		if ( queue.running ) {
			queue.waiting = true;
			return;
		}

		// Mark queue as running, then search for 
		queue.running = true;
		munit.each( queue.modules, function( assert, index ) {
			if ( ! queue.objects.length ) {
				return false;
			}
			else if ( ! munit.render.checkDepency( assert ) ) {
				return;
			}

			// Looking for specific key in queue object
			if ( munit.isString( assert.options.queue ) ) {
				munit.each( queue.objects, function( object, i ) {
					if ( object[ assert.options.queue ] ) {
						queue.modules[ index ] = null;
						queue.objects.splice( i, 1 );
						assert.queue = object;
						assert.trigger();
						return false;
					}
				});
			}
			// Any queue will do
			else {
				queue.modules[ index ] = null;
				assert.queue = queue.objects.shift();
				assert.trigger();
			}
		});

		// Clean out modules that completed (splicing causes iteration fails)
		queue.modules.forEach(function( assert ) {
			if ( assert !== null ) {
				copy.push( assert );
			}
		});
		queue.modules = copy;

		// Run again if check method was called during loop
		queue.running = false;
		if ( queue.waiting ) {
			queue.waiting = false;
			queue.check();
		}
	}
function ( ) { var copy = [ ] ; // Handle recursive loops if ( queue . running ) { queue . waiting = true ; return ; } // Mark queue as running, then search for  queue . running = true ; munit . each ( queue . modules , function ( assert , index ) { if ( ! queue . objects . length ) { return false ; } else if ( ! munit . render . checkDepency ( assert ) ) { return ; } // Looking for specific key in queue object if ( munit . isString ( assert . options . queue ) ) { munit . each ( queue . objects , function ( object , i ) { if ( object [ assert . options . queue ] ) { queue . modules [ index ] = null ; queue . objects . splice ( i , 1 ) ; assert . queue = object ; assert . trigger ( ) ; return false ; } } ) ; } // Any queue will do else { queue . modules [ index ] = null ; assert . queue = queue . objects . shift ( ) ; assert . trigger ( ) ; } } ) ; // Clean out modules that completed (splicing causes iteration fails) queue . modules . forEach ( function ( assert ) { if ( assert !== null ) { copy . push ( assert ) ; } } ) ; queue . modules = copy ; // Run again if check method was called during loop queue . running = false ; if ( queue . waiting ) { queue . waiting = false ; queue . check ( ) ; } }
Runs through queued modules and finds objects to run them with
Runs through queued modules and finds objects to run them with