Skip to content

Svelte 5: .length does not work on arrays being set with bind:this directive #9781

@Not-Jayden

Description

@Not-Jayden

Describe the bug

When using bind:this to set a reference to an element at an index of an array, while it does correctly create the proxied state, accessinglength directly on the array always returns 0 instead of the length of the proxied array value.

I believe this is actually consistent with how proxies ordinarily work, though it seems in other cases the proxy handler allows length to be read to directly.

Reproduction

REPL

Logs

N/A

System Info

REPL Chrome

Severity

annoyance

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions