-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 compiler removes semicolon after while
, changing logic
#6884
Comments
That's how Javascript works. The This is not a Svelte bug; it's compiling the Javascript exactly as it should. Try running that Javasript in Node and you'll see the same result. |
Those aren't examples; the first is before Svelte compiles, and the second is Svelte's output. I've updated the title to make it more explicit. |
while
, changing logicwhile
, changing logic
Interestingly, if you replace I don't know why the REPL builds it differently. If someone more familiar than I am with the REPL can figure out what's different about the REPL setup vs. how the skeleton Svelte-Kit app is set up, that might lead to a clue about the cause of this bug. |
I would guess it is because of the In any case, the bug is likely in https://github.com/Rich-Harris/code-red and would need to be fixed there. |
I don't think the bug is in As an aside, the fact that I could just write |
It looks like the issue is in There are other handlers that are suffering from this same thing, it looks like. |
This should be fixed now in 3.44.1. |
Thanks @tanhauhau @Conduitry! |
Compiles to:
causing
fn()
to give 2 instead of 100.The text was updated successfully, but these errors were encountered: