Skip to content

Commit 984e102

Browse files
committed
reuse mechanism
1 parent 3ec1267 commit 984e102

File tree

1 file changed

+3
-4
lines changed
  • packages/svelte/src/compiler/phases/3-transform/client/visitors/shared

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { normalize_attribute } from '../../../../../../utils.js';
55
import { is_ignored } from '../../../../../state.js';
66
import { is_event_attribute } from '../../../../../utils/ast.js';
77
import * as b from '../../../../../utils/builders.js';
8-
import { build_getter, create_derived } from '../../utils.js';
8+
import { build_getter } from '../../utils.js';
99
import { build_template_chunk, get_expression_id } from './utils.js';
1010

1111
/**
@@ -61,10 +61,9 @@ export function build_set_attributes(
6161
let value = /** @type {Expression} */ (context.visit(attribute));
6262

6363
if (attribute.metadata.expression.has_call) {
64-
const id = b.id(state.scope.generate('spread_with_call'));
65-
state.init.push(b.const(id, create_derived(state, b.thunk(value))));
66-
value = b.call('$.get', id);
64+
value = get_expression_id(context.state, value);
6765
}
66+
6867
values.push(b.spread(value));
6968
}
7069
}

0 commit comments

Comments
 (0)