Skip to content

Commit f13795a

Browse files
committed
chore: change conditions
1 parent f1d77c0 commit f13795a

File tree

1 file changed

+9
-6
lines changed
  • packages/svelte/src/compiler/phases/2-analyze/visitors

1 file changed

+9
-6
lines changed

packages/svelte/src/compiler/phases/2-analyze/visitors/Attribute.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@ export function Attribute(node, context) {
1818

1919
const parent = /** @type {SvelteNode} */ (context.path.at(-1));
2020

21-
if (
22-
// special case for <option value=""/>
23-
(node.name === 'value' && parent.type === 'RegularElement' && parent.name === 'option') ||
21+
if (parent.type === 'RegularElement') {
22+
// special case <option value="" />
23+
if (node.name === 'value' && parent.name === 'option') {
24+
mark_subtree_dynamic(context.path);
25+
}
26+
2427
// special case <img loading="lazy" />
25-
(node.name === 'loading' && parent.type === 'RegularElement' && parent.name === 'img')
26-
) {
27-
mark_subtree_dynamic(context.path);
28+
if (node.name === 'loading' && parent.name === 'img') {
29+
mark_subtree_dynamic(context.path);
30+
}
2831
}
2932

3033
if (node.name.startsWith('on')) {

0 commit comments

Comments
 (0)