From 8b2ad778f18e66ac973054d82ab595be82291cf2 Mon Sep 17 00:00:00 2001 From: Nguyen Tran Date: Mon, 13 Mar 2023 19:12:06 -0400 Subject: [PATCH] Explain why number_of_computed_props takes an object instead of number --- src/compiler/compile/nodes/shared/Context.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/compiler/compile/nodes/shared/Context.ts b/src/compiler/compile/nodes/shared/Context.ts index 79c29c3fb0..2338f76678 100644 --- a/src/compiler/compile/nodes/shared/Context.ts +++ b/src/compiler/compile/nodes/shared/Context.ts @@ -40,7 +40,10 @@ export function unpack_destructuring({ scope: TemplateScope; component: Component; context_rest_properties: Map; - number_of_computed_props?: { n: number }; // we want to pass this by reference, as a sort of global variable + // we want to pass this by reference, as a sort of global variable, because + // if we pass this by value, we could get computed_property_# variable collisions + // when we deal with nested object destructuring + number_of_computed_props?: { n: number }; }) { if (!node) return;