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

SSR destructure assignment as arrow function's body #7087

Closed
hyrious opened this issue Jan 1, 2022 · 1 comment · Fixed by #7110
Closed

SSR destructure assignment as arrow function's body #7087

hyrious opened this issue Jan 1, 2022 · 1 comment · Fixed by #7110
Labels
bug compiler Changes relating to the compiler

Comments

@hyrious
Copy link

hyrious commented Jan 1, 2022

Describe the bug

If script contains destructure assignment in arrow function's body (without {}), it will become invalid after compiling with generate: 'ssr':

input:

let a = () => ({ x } = { x: 42 })

output:

let a = () => { x } = { x: 42 }

Reproduction

https://svelte.dev/repl/86fe986b972d4c0ea0f61c9bc37bab71?version=3.44.3
Remember to turn on generate: 'ssr' to see the buggy code.

Logs

No response

System Info

  System:
    OS: Windows 10 10.0.19044
    CPU: (4) x64 Intel(R) Core(TM) i5-4200H CPU @ 2.80GHz
    Memory: 6.67 GB / 11.89 GB
  Binaries:
    Node: 16.13.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.3.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (96.0.1054.62)
    Internet Explorer: 11.0.19041.1202
  npmPackages:
    svelte: ^3.44.3 => 3.44.3

Severity

annoyance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug compiler Changes relating to the compiler
Projects
None yet
3 participants