You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When giving a prop a default value of an object that uses a keyword as both key, and value (i.e {true : true}) the svelte compiler outputs invalid JavaScript, {true}.
Thanks for the report! I guess Rich-Harris/code-red#9 didn't cover all of what we needed here. Presumably we also need to check whether the value is an identifier.
Describe the bug
When giving a prop a default value of an object that uses a keyword as both key, and value (i.e
{true : true}
) the svelte compiler outputs invalid JavaScript,{true}
.To Reproduce
https://svelte.dev/repl/2edabca108b64bcb909791bf1c5f58fa?version=3.14.1
Expected behavior
Svelte will not collapse object literal declarations into the short form for keywords.
Information about your Svelte project:
This issue affects version 3.13.0 and up.
Severity
It is slightly annoying as I had to move the default into a separate variable for now, but not blocking in anyway.
The text was updated successfully, but these errors were encountered: