function build_attr_class(class_directives, expression, context, hash) {
	/** @type {ObjectExpression | undefined} */
	let directives;

	if (class_directives.length) {
		directives = b.object(
			class_directives.map((directive) =>
				b.prop(
					'init',
					b.literal(directive.name),
					/** @type {Expression} */ (context.visit(directive.expression, context.state))
				)
			)
		);
	}

	let css_hash;

	if (hash) {
		if (expression.type === 'Literal' && typeof expression.value === 'string') {
			expression.value = (expression.value + ' ' + hash).trim();
		} else {
			css_hash = b.literal(hash);
		}
	}

	return b.call('$.attr_class', expression, css_hash, directives);
}
@param {AST.ClassDirective[]} class_directives
@param {Expression} expression
@param {ComponentContext} context
@param {string | null} hash