fix: async `class:` + spread attributes were compiled into sync server-side code

pull/16834/head
7nik 24 hours ago
parent 1ef297f25d
commit f3dec9605b

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: async `class:` + spread attributes were compiled into sync server-side code

@ -372,7 +372,10 @@ function build_element_spread_attributes(
directive.name,
directive.expression.type === 'Identifier' && directive.expression.name === directive.name
? b.id(directive.name)
: /** @type {Expression} */ (context.visit(directive.expression))
: transform(
/** @type {Expression} */ (context.visit(directive.expression)),
directive.metadata.expression
)
);
});

@ -0,0 +1 @@
<!--[--><div class="test"></div><div style="color: green;"></div><!--]-->

@ -0,0 +1,2 @@
<div class:test={await true} {...{}}></div>
<div style:color={await "green"} {...{}}></div>
Loading…
Cancel
Save