Skip to content

Commit 5ff5bca

Browse files
committed
tweak
1 parent 9391993 commit 5ff5bca

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -515,19 +515,17 @@ function setup_select_synchronization(value_binding, context) {
515515
*/
516516
export function build_class_directives_object(class_directives, context) {
517517
let properties = [];
518-
519518
let has_call_or_state = false;
520519

521520
for (const d of class_directives) {
522-
let expression = /** @type Expression */ (context.visit(d.expression));
521+
const expression = /** @type Expression */ (context.visit(d.expression));
523522
properties.push(b.init(d.name, expression));
524523
has_call_or_state ||= d.metadata.expression.has_call || d.metadata.expression.has_state;
525524
}
526-
let directives = b.object(properties);
527-
if (has_call_or_state) {
528-
return get_expression_id(context.state, directives);
529-
}
530-
return directives;
525+
526+
const directives = b.object(properties);
527+
528+
return has_call_or_state ? get_expression_id(context.state, directives) : directives;
531529
}
532530

533531
/**

0 commit comments

Comments
 (0)