function hasAsyncDirective( cmd ) {
	var nodes;
	var ast;
	var n;
	var i;

	try {
		ast = parse( cmd, AOPTS );
	} catch ( err ) { // eslint-disable-line no-unused-vars
		return false;
	}
	nodes = ast.body;
	for ( i = 0; i < nodes.length; i++ ) {
		n = nodes[ i ];
		if (
			n.type === 'ExpressionStatement' &&
			n.expression.type === 'Literal' &&
			n.directive === 'async'
		) {
			return true;
		}
	}
	return false;
}
Tests whether a command contains a top-level `"async"` directive.

@private
@param {string} cmd - command string
@returns {boolean} boolean indicating whether a command contains a top-level "async" directive