function internalStart( test ) {

	// If semaphore is non-numeric, throw error
	if ( isNaN( test.semaphore ) ) {
		test.semaphore = 0;

		QUnit.pushFailure(
			"Invalid value on test.semaphore",
			sourceFromStacktrace( 2 )
		);
		return;
	}

	// Don't start until equal number of stop-calls
	if ( test.semaphore > 0 ) {
		return;
	}

	// Throw an Error if start is called more often than stop
	if ( test.semaphore < 0 ) {
		test.semaphore = 0;

		QUnit.pushFailure(
			"Tried to restart test while already started (test's semaphore was 0 already)",
			sourceFromStacktrace( 2 )
		);
		return;
	}

	// Add a slight delay to allow more assertions etc.
	if ( defined.setTimeout ) {
		if ( config.timeout ) {
			clearTimeout( config.timeout );
		}
		config.timeout = setTimeout( function() {
			if ( test.semaphore > 0 ) {
				return;
			}

			if ( config.timeout ) {
				clearTimeout( config.timeout );
			}

			begin();
		}, 13 );
	} else {
		begin();
	}
}
// Release a processing hold, scheduling a resumption attempt if no holds remain.
Release a processing hold, scheduling a resumption attempt if no holds remain.
Release a processing hold scheduling a resumption attempt if no holds remain .
function internalStart( test ) {
	if ( isNaN( test.semaphore ) ) {
		test.semaphore = 0;
		QUnit.pushFailure(
			"Invalid value on test.semaphore",
			sourceFromStacktrace( 2 )
		);
		return;
	}
	if ( test.semaphore > 0 ) {
		return;
	}
	if ( test.semaphore < 0 ) {
		test.semaphore = 0;
		QUnit.pushFailure(
			"Tried to restart test while already started (test's semaphore was 0 already)",
			sourceFromStacktrace( 2 )
		);
		return;
	}
	if ( defined.setTimeout ) {
		if ( config.timeout ) {
			clearTimeout( config.timeout );
		}
		config.timeout = setTimeout( function() {
			if ( test.semaphore > 0 ) {
				return;
			}
			if ( config.timeout ) {
				clearTimeout( config.timeout );
			}
			begin();
		}, 13 );
	} else {
		begin();
	}
}
function internalStart ( test ) { if ( isNaN ( test . semaphore ) ) { test . semaphore = 0 ; QUnit . pushFailure ( "Invalid value on test.semaphore" , sourceFromStacktrace ( 2 ) ) ; return ; } if ( test . semaphore > 0 ) { return ; } if ( test . semaphore < 0 ) { test . semaphore = 0 ; QUnit . pushFailure ( "Tried to restart test while already started (test's semaphore was 0 already)" , sourceFromStacktrace ( 2 ) ) ; return ; } if ( defined . setTimeout ) { if ( config . timeout ) { clearTimeout ( config . timeout ) ; } config . timeout = setTimeout ( function ( ) { if ( test . semaphore > 0 ) { return ; } if ( config . timeout ) { clearTimeout ( config . timeout ) ; } begin ( ) ; } , 13 ) ; } else { begin ( ) ; } }
Release a processing hold, scheduling a resumption attempt if no holds remain.
Release a processing hold scheduling a resumption attempt if no holds remain .
// If semaphore is non-numeric, throw error // Don't start until equal number of stop-calls // Throw an Error if start is called more often than stop // Add a slight delay to allow more assertions etc.