All files / src/compiler/phases/2-analyze/visitors TitleElement.js

100% Statements 22/22
100% Branches 7/7
100% Functions 1/1
100% Lines 21/21

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 222x 2x 2x 2x 2x 2x 2x 2x 2x 33x 1x 1x 32x 33x 37x 1x 1x 37x 31x 31x 31x  
/** @import { Ast } from '#compiler' */
/** @import { Context } from '../types' */
import * as e from '../../../errors.js';
 
/**
 * @param {Ast.TitleElement} node
 * @param {Context} context
 */
export function TitleElement(node, context) {
	for (const attribute of node.attributes) {
		e.title_illegal_attribute(attribute);
	}
 
	for (const child of node.fragment.nodes) {
		if (child.type !== 'Text' && child.type !== 'ExpressionTag') {
			e.title_invalid_content(child);
		}
	}
 
	context.next();
}