From e7639a54db053f6b5ca2358e403459f784850d1f Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Fri, 20 Sep 2024 12:37:28 -0400 Subject: [PATCH] tidy up --- .../phases/3-transform/client/visitors/RegularElement.js | 7 +++---- .../phases/3-transform/client/visitors/SvelteElement.js | 2 -- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js b/packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js index fd8aeb6e4c..ce43d64d2d 100644 --- a/packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js +++ b/packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js @@ -95,7 +95,7 @@ export function RegularElement(node, context) { /** @type {Map} */ const bindings = new Map(); - let has_spread = false; + let has_spread = node.metadata.has_spread; let has_use = false; for (const attribute of node.attributes) { @@ -129,7 +129,6 @@ export function RegularElement(node, context) { case 'SpreadAttribute': attributes.push(attribute); - has_spread = true; break; case 'StyleDirective': @@ -195,7 +194,7 @@ export function RegularElement(node, context) { // Then do attributes let is_attributes_reactive = false; - if (node.metadata.has_spread) { + if (has_spread) { build_element_spread_attributes( attributes, context, @@ -258,7 +257,7 @@ export function RegularElement(node, context) { node_id, context, is_attributes_reactive, - lookup.has('style') || node.metadata.has_spread + lookup.has('style') || has_spread ); // Apply the src and loading attributes for elements after the element is appended to the document diff --git a/packages/svelte/src/compiler/phases/3-transform/client/visitors/SvelteElement.js b/packages/svelte/src/compiler/phases/3-transform/client/visitors/SvelteElement.js index 01bd970035..d0b09a962b 100644 --- a/packages/svelte/src/compiler/phases/3-transform/client/visitors/SvelteElement.js +++ b/packages/svelte/src/compiler/phases/3-transform/client/visitors/SvelteElement.js @@ -153,8 +153,6 @@ function build_dynamic_element_attributes(element, attributes, context, element_ return false; } - // TODO why are we always treating this as a spread? needs docs, if that's not an error - let needs_isolation = false; let is_reactive = false;