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: tweak invalid dollar prefix rules around function args #9792

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Dec 5, 2023

Fixes #9786.

Copy link

changeset-bot bot commented Dec 5, 2023

🦋 Changeset detected

Latest commit: 4ce0a56

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 5, 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 5, 2023 9:13pm

@Rich-Harris Rich-Harris merged commit e6b5ccd into main Dec 5, 2023
9 checks passed
@Rich-Harris Rich-Harris deleted the limit-error-on-params branch December 5, 2023 21:16
@github-actions github-actions bot mentioned this pull request Dec 5, 2023
@brunnerh
Copy link
Member

brunnerh commented Dec 5, 2023

Isn't that the wrong fix? The component is not in runes mode and as has been noted by the author of the issue:

If I remove the context=module, the code works.

I suspect that checks are being applied to the context script that should not have been applied in the first place.

@trueadm
Copy link
Contributor Author

trueadm commented Dec 5, 2023

@brunnerh In context module, the function_depth is 0, in components it is 1. So if you're inside a function in a component, it will be 2. That's why it worked with the code change.

However, changing the depth isn't the right fix here, the right fix is knowing if it's a function argument and if so skipping the error in those cases. Which is far more resilient than checking depths.

@brunnerh
Copy link
Member

brunnerh commented Dec 5, 2023

Oh, then that makes sense, thank you.

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: $ prefix is reserved for script with context=module
3 participants