vendor/qunit-1.20.0.js
function( count ) {
		var test = this.test,
			popped = false,
			acceptCallCount = count;

		if ( typeof acceptCallCount === "undefined" ) {
			acceptCallCount = 1;
		}

		test.semaphore += 1;
		test.usedAsync = true;
		pauseProcessing();

		return function done() {

			if ( popped ) {
				test.pushFailure( "Too many calls to the `assert.async` callback",
					sourceFromStacktrace( 2 ) );
				return;
			}
			acceptCallCount -= 1;
			if ( acceptCallCount > 0 ) {
				return;
			}

			test.semaphore -= 1;
			popped = true;
			resumeProcessing();
		};
	}
function( count ) {
		var test = this.test,
			popped = false,
			acceptCallCount = count;

		if ( typeof acceptCallCount === "undefined" ) {
			acceptCallCount = 1;
		}

		test.semaphore += 1;
		test.usedAsync = true;
		pauseProcessing();

		return function done() {

			if ( popped ) {
				test.pushFailure( "Too many calls to the `assert.async` callback",
					sourceFromStacktrace( 2 ) );
				return;
			}
			acceptCallCount -= 1;
			if ( acceptCallCount > 0 ) {
				return;
			}

			test.semaphore -= 1;
			popped = true;
			resumeProcessing();
		};
	}
function ( count ) { var test = this . test , popped = false , acceptCallCount = count ; if ( typeof acceptCallCount === "undefined" ) { acceptCallCount = 1 ; } test . semaphore += 1 ; test . usedAsync = true ; pauseProcessing ( ) ; return function done ( ) { if ( popped ) { test . pushFailure ( "Too many calls to the `assert.async` callback" , sourceFromStacktrace ( 2 ) ) ; return ; } acceptCallCount -= 1 ; if ( acceptCallCount > 0 ) { return ; } test . semaphore -= 1 ; popped = true ; resumeProcessing ( ) ; } ; }
Increment this Test's semaphore counter, then return a function that decrements that counter a maximum of once.
Increment this Test s semaphore counter then return a function that decrements that counter a maximum of once .