All files / src/compiler/phases/2-analyze/visitors/shared special-element.js

100% Statements 17/17
100% Branches 2/2
100% Functions 1/1
100% Lines 16/16

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 172x 2x 2x 2x 2x 2x 2x 116x 116x 116x 2x 2x 2x 2x 2x 116x  
/** @import { AST } from '#compiler' */
import * as e from '../../../../errors.js';
 
/**
 * @param {AST.SvelteBody | AST.SvelteDocument | AST.SvelteOptionsRaw | AST.SvelteWindow} node
 */
export function disallow_children(node) {
	const { nodes } = node.fragment;
 
	if (nodes.length > 0) {
		const first = nodes[0];
		const last = nodes[nodes.length - 1];
 
		e.svelte_meta_invalid_content({ start: first.start, end: last.end }, node.name);
	}
}