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

Svelte 5: Actions from object properties are not properly escaped #9445

Closed
brunnerh opened this issue Nov 14, 2023 · 0 comments · Fixed by #9462
Closed

Svelte 5: Actions from object properties are not properly escaped #9445

brunnerh opened this issue Nov 14, 2023 · 0 comments · Fixed by #9462
Milestone

Comments

@brunnerh
Copy link
Member

brunnerh commented Nov 14, 2023

Describe the bug

Actions can be defined on objects and just used via use:object.property, if the property is not a valid JS symbol, it has to be escaped which right now does not happen.

Reproduction

<script>
	const a = { 'set-color': (node, c) => node.style.color = c };
</script>
<span use:a.set-color={'red'}>Text</span>

v4 ✔️
v5

Compiled bit of code:

$.action(span, ($$node, $$props) => a.set-color($$node, $$props), () => 'red');

Logs

No response

System Info

REPL

Severity

annoyance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants