pull/15961/head
Rich Harris 4 months ago
parent 6bb5c27944
commit df7fb8d580

@ -203,15 +203,7 @@ export function RegularElement(node, context) {
if (has_spread) {
const attributes_id = b.id(context.state.scope.generate('attributes'));
build_set_attributes(
attributes,
class_directives,
style_directives,
context,
node,
node_id,
attributes_id
);
build_set_attributes(attributes, class_directives, style_directives, context, node, node_id);
// If value binding exists, that one takes care of calling $.init_select
if (node.name === 'select' && !bindings.has('value')) {

@ -80,8 +80,6 @@ export function SvelteElement(node, context) {
) {
build_set_class(node, element_id, attributes[0], class_directives, inner_context, false);
} else if (attributes.length) {
const attributes_id = b.id(context.state.scope.generate('attributes'));
// Always use spread because we don't know whether the element is a custom element or not,
// therefore we need to do the "how to set an attribute" logic at runtime.
build_set_attributes(
@ -90,8 +88,7 @@ export function SvelteElement(node, context) {
style_directives,
inner_context,
node,
element_id,
attributes_id
element_id
);
}

@ -16,7 +16,6 @@ import { build_template_chunk, get_expression_id } from './utils.js';
* @param {ComponentContext} context
* @param {AST.RegularElement | AST.SvelteElement} element
* @param {Identifier} element_id
* @param {Identifier} attributes_id
*/
export function build_set_attributes(
attributes,
@ -24,8 +23,7 @@ export function build_set_attributes(
style_directives,
context,
element,
element_id,
attributes_id
element_id
) {
/** @type {ObjectExpression['properties']} */
const values = [];

Loading…
Cancel
Save