Skip to content

Commit ebe2ede

Browse files
committed
simplify
1 parent 7219b9e commit ebe2ede

File tree

1 file changed

+12
-20
lines changed
  • packages/svelte/src/compiler/phases/3-transform/client/visitors

1 file changed

+12
-20
lines changed

packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -480,28 +480,20 @@ function serialize_element_attribute_update_assignment(element, node_id, attribu
480480
return b.stmt(b.call(is_svg ? '$.svg_class_name' : '$.class_name', node_id, singular));
481481
}
482482
return b.stmt(b.call(is_svg ? '$.svg_class_name' : '$.class_name', node_id, value));
483-
} else if (!DOMProperties.includes(name)) {
484-
if (singular) {
485-
return b.stmt(
486-
b.call(
487-
name.startsWith('xlink') ? '$.xlink_attr' : '$.attr',
488-
node_id,
489-
b.literal(name),
490-
grouped
491-
)
492-
);
493-
}
494-
return b.stmt(
495-
b.call(
496-
name.startsWith('xlink') ? '$.xlink_attr' : '$.attr',
497-
node_id,
498-
b.literal(name),
499-
grouped
500-
)
501-
);
502-
} else {
483+
}
484+
485+
if (DOMProperties.includes(name)) {
503486
return b.stmt(b.assignment('=', b.member(node_id, b.id(name)), grouped));
504487
}
488+
489+
return b.stmt(
490+
b.call(
491+
name.startsWith('xlink') ? '$.xlink_attr' : '$.attr',
492+
node_id,
493+
b.literal(name),
494+
grouped
495+
)
496+
);
505497
};
506498

507499
if (attribute.metadata.dynamic) {

0 commit comments

Comments
 (0)