Skip to content

Commit 67e8974

Browse files
committed
consistency
1 parent 1d918d5 commit 67e8974

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/svelte/src/html-tree-validation.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ const disallowed_children = {
146146
export function is_tag_valid_with_ancestor(child_tag, ancestors, child_loc, ancestor_loc) {
147147
if (child_tag.includes('-')) return null; // custom elements can be anything
148148

149-
const target = ancestors[ancestors.length - 1];
150-
const disallowed = disallowed_children[target];
149+
const ancestor_tag = ancestors[ancestors.length - 1];
150+
const disallowed = disallowed_children[ancestor_tag];
151151
if (!disallowed) return null;
152152

153153
if ('reset_by' in disallowed && disallowed.reset_by) {
@@ -164,7 +164,7 @@ export function is_tag_valid_with_ancestor(child_tag, ancestors, child_loc, ance
164164

165165
if ('descendant' in disallowed && disallowed.descendant.includes(child_tag)) {
166166
const child = child_loc ? `<${child_tag}> (${child_loc})` : `<${child_tag}>`;
167-
const ancestor = ancestor_loc ? `<${target}> (${ancestor_loc})` : `<${target}>`;
167+
const ancestor = ancestor_loc ? `<${ancestor_tag}> (${ancestor_loc})` : `<${ancestor_tag}>`;
168168

169169
return `\`${child}\` cannot be a descendant of \`${ancestor}\``;
170170
}

0 commit comments

Comments
 (0)