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
.length is called after new items are added to the array
... but if .length wasn't called previously, it doesn't contain any related source entry at that point in time, and thus a new one is created, but using the initial value of the underlying object, which is 0 because the new array entries were not written through
Describe the bug
5.0.0-next.227: Reading $state in script tags does not return the current value if the variable is not referenced outside of script tags
Downgrading to 5.0.0-next.226 and it works again.
Reproduction
Reproduction: https://www.sveltelab.dev/q619bx8mtraspmd
The number printed to the console is always 0
... unless the variable is referenced outside of script tag (https://www.sveltelab.dev/7r3mc9ydsw6heco)
Downgrading to 5.0.0-next.225 and it works again, no need to reference the variable outside of script tag (https://www.sveltelab.dev/8nijtfv76v7wjz8)
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: