From 81f9bdd376979baa8b85095e9421897d7046f303 Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Fri, 25 Oct 2024 21:30:15 +0200 Subject: [PATCH] fix: remove metadata from legacy AST (#13927) Besides being private API that shouldn't be exposed, they caused our AST explorer on the Svelte site to traverse endlessly fixes https://github.com/sveltejs/svelte.dev/issues/480 --- .changeset/strong-dogs-obey.md | 5 +++++ packages/svelte/src/compiler/legacy.js | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/strong-dogs-obey.md diff --git a/.changeset/strong-dogs-obey.md b/.changeset/strong-dogs-obey.md new file mode 100644 index 0000000000..abab6fdf75 --- /dev/null +++ b/.changeset/strong-dogs-obey.md @@ -0,0 +1,5 @@ +--- +'svelte': patch +--- + +fix: remove metadata from legacy AST diff --git a/packages/svelte/src/compiler/legacy.js b/packages/svelte/src/compiler/legacy.js index 2a543a5370..e603da312b 100644 --- a/packages/svelte/src/compiler/legacy.js +++ b/packages/svelte/src/compiler/legacy.js @@ -204,7 +204,9 @@ export function convert(source, ast) { ignores: extract_svelte_ignore(node.start, node.data, false) }; }, - ComplexSelector(node) { + ComplexSelector(node, { next }) { + next(); // delete inner metadata/parent properties + const children = []; for (const child of node.children) {