Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow duplicate snippet declaration names #9759

Merged
merged 2 commits into from
Dec 4, 2023

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Dec 4, 2023

Fixes #9756.

Copy link

changeset-bot bot commented Dec 4, 2023

🦋 Changeset detected

Latest commit: b6f778f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Dec 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
svelte-5-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 4, 2023 6:35pm

fix: fix duplicate snippet declaration names
@dummdidumm
Copy link
Member

This made me realize that both var and function "bleed" over their current block into the upper scope. While this fixes the specific issue, there's a more general problem with this, namely siblings with snippets of the same name inside them behaving wrong: playground link
Do we need to make these const declarations instead so that they stay in their current block scope?

@trueadm
Copy link
Contributor Author

trueadm commented Dec 4, 2023

@dummdidumm Yep, realised that offline too. Made the change.

@dummdidumm dummdidumm merged commit f0c47c3 into main Dec 4, 2023
9 checks passed
@dummdidumm dummdidumm deleted the fix-snippet-duplicate-names branch December 4, 2023 19:31
@github-actions github-actions bot mentioned this pull request Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Svelte 5: Snippets incorrectly sharing scope inside component slots
2 participants