From cedc6d41e302a6c6090d236bd05262e57f77c7a2 Mon Sep 17 00:00:00 2001 From: paoloricciuti Date: Thu, 25 Jul 2024 19:05:47 +0200 Subject: [PATCH] chore: add comments before `to_ignore` --- .../compiler/phases/3-transform/client/visitors/template.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js b/packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js index a6b4b0f72e..7a1a7c791c 100644 --- a/packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js +++ b/packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js @@ -781,6 +781,9 @@ function serialize_inline_component(node, component_name, context, anchor = cont } else if (attribute.type === 'BindDirective') { const expression = /** @type {Expression} */ (context.visit(attribute.expression)); + // serialize_validate_binding will add a function that specifically throw + // `binding_property_non_reactive` error. If there's a svelte ignore + // before we avoid adding this validation to avoid throwing the runtime warning const to_ignore = ignore_map .get(node) ?.some((code) => code.has('binding_property_non_reactive')); @@ -2877,6 +2880,9 @@ export const template_visitors = { const expression = node.expression; const property = binding_properties[node.name]; + // serialize_validate_binding will add a function that specifically throw + // `binding_property_non_reactive` error. If there's a svelte ignore + // before we avoid adding this validation to avoid throwing the runtime warning const to_ignore = ignore_map .get(node) ?.some((code) => code.has('binding_property_non_reactive'));