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

pull/16824/head
7nik 1 day ago committed by GitHub
parent c75e862677
commit 24944e61f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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