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

Error where rest property of array is another array or object #8552

Closed
ngtr6788 opened this issue May 3, 2023 · 1 comment · Fixed by #8553
Closed

Error where rest property of array is another array or object #8552

ngtr6788 opened this issue May 3, 2023 · 1 comment · Fixed by #8553

Comments

@ngtr6788
Copy link
Contributor

ngtr6788 commented May 3, 2023

Describe the bug

According to MDN docs, "[t]he rest property of array destructuring assignment can be another array or object binding pattern", for example:

const [a, b, ...[c, d]] = [1, 2, 3, 4];
const [e, f, ...{ length }] = [5, 6, 7, 8];

However, when I try to do it in Svelte, there is an error. In the REPL, the error simply says variable is undefined. If I do it locally, I get this error TypeError: Cannot read properties of undefined (reading 'subscribable')

Reproduction

https://svelte.dev/repl/0d6e456956e44fbd9c0593d24cc0259e?version=3.58.0

Logs

No response

System Info

Error is in REPL itself

Severity

annoyance

@Conduitry
Copy link
Member

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 a pull request may close this issue.

2 participants