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

90.9% Statements 20/22
83.33% Branches 5/6
100% Functions 1/1
90% Lines 18/20

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 212x 2x 2x 2x 2x 2x 2x 2x 2x 2x 7170x 2187x 2187x 4983x 7081x 4152x     4152x 7170x  
/** @import { ExpressionTag } from '#compiler' */
/** @import { Context } from '../types' */
import { is_tag_valid_with_parent } from '../../../../html-tree-validation.js';
import * as e from '../../../errors.js';
 
/**
 * @param {ExpressionTag} node
 * @param {Context} context
 */
export function ExpressionTag(node, context) {
	if (!node.parent) {
		return;
	}
 
	if (context.state.parent_element) {
		if (!is_tag_valid_with_parent('#text', context.state.parent_element)) {
			e.node_invalid_placement(node, '`{expression}`', context.state.parent_element);
		}
	}
}