Skip to content

Commit 1719d4c

Browse files
committed
fix
1 parent 957c21e commit 1719d4c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/svelte/src/compiler/phases/2-analyze/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,11 @@ export function analyze_component(root, options) {
357357
uses_component_bindings: false,
358358
custom_element: options.customElement,
359359
inject_styles: options.css === 'injected' || !!options.customElement,
360-
accessors: options.customElement ? true : !!options.accessors,
360+
accessors: options.customElement
361+
? true
362+
: !!options.accessors ||
363+
// because $set method needs accessors
364+
!!options.legacy?.componentApi,
361365
reactive_statements: new Map(),
362366
binding_groups: new Map(),
363367
slot_names: new Set(),

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,7 @@ export function client_component(source, analysis, options) {
245245
return b.get(alias ?? name, [b.return(expression)]);
246246
});
247247

248-
if (
249-
analysis.accessors ||
250-
// because $set method needs accessors
251-
options.legacy.componentApi
252-
) {
248+
if (analysis.accessors) {
253249
for (const [name, binding] of analysis.instance.scope.declarations) {
254250
if (binding.kind !== 'prop' || name.startsWith('$$')) continue;
255251

0 commit comments

Comments
 (0)