From 5565d06bc1ad3c454e613010e93552464f11c867 Mon Sep 17 00:00:00 2001 From: ComputerGuy <63362464+Ocean-OS@users.noreply.github.com> Date: Thu, 23 Oct 2025 22:03:39 -0700 Subject: [PATCH] fix --- .../src/compiler/phases/2-analyze/visitors/ClassBody.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/svelte/src/compiler/phases/2-analyze/visitors/ClassBody.js b/packages/svelte/src/compiler/phases/2-analyze/visitors/ClassBody.js index 5cd24fef88..65c81c4eb2 100644 --- a/packages/svelte/src/compiler/phases/2-analyze/visitors/ClassBody.js +++ b/packages/svelte/src/compiler/phases/2-analyze/visitors/ClassBody.js @@ -86,7 +86,7 @@ export function ClassBody(node, context) { for (const child of node.body) { if (child.type === 'PropertyDefinition' && !child.static) { - handle(child, child.key, child.value, child.computed); + handle(child, child.key, child.value, child.computed && child.key.type !== 'Literal'); const key = /** @type {string} */ (get_name(child.key)); const field = fields.get(key); if (!field) { @@ -142,7 +142,12 @@ export function ClassBody(node, context) { if (left.type !== 'MemberExpression') continue; if (left.object.type !== 'ThisExpression') continue; - handle(statement.expression, left.property, right, left.computed); + handle( + statement.expression, + left.property, + right, + left.computed && left.property.type !== 'Literal' + ); } }