From 332b2b249f76e4dc7b4a30d51b6daa937d9d6a42 Mon Sep 17 00:00:00 2001 From: Nguyen Tran Date: Mon, 13 Mar 2023 18:33:24 -0400 Subject: [PATCH] Fix repeating computed_property_# issue --- src/compiler/compile/nodes/shared/Context.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/compile/nodes/shared/Context.ts b/src/compiler/compile/nodes/shared/Context.ts index db92706122..79c29c3fb0 100644 --- a/src/compiler/compile/nodes/shared/Context.ts +++ b/src/compiler/compile/nodes/shared/Context.ts @@ -31,7 +31,7 @@ export function unpack_destructuring({ scope, component, context_rest_properties, - number_of_computed_props = 0 + number_of_computed_props = { n: 0 } }: { contexts: Context[]; node: Node; @@ -40,7 +40,7 @@ export function unpack_destructuring({ scope: TemplateScope; component: Component; context_rest_properties: Map; - number_of_computed_props?: number; + number_of_computed_props?: { n: number }; // we want to pass this by reference, as a sort of global variable }) { if (!node) return; @@ -133,8 +133,8 @@ export function unpack_destructuring({ if (property.computed) { // e.g { [computedProperty]: ... } - const property_name = `#computed_property_${number_of_computed_props}`; - number_of_computed_props += 1; + const property_name = `computed_property_${number_of_computed_props.n}`; + number_of_computed_props.n += 1; contexts.push({ type: 'ComputedProperty',