Closed Conduitry closed 4 years ago
Another interesting thing is that $store
has referenced: true
in the first case but not the second. Looking at the debugger, the first case only calls add_reference
on the $store
variable name.
There's code in that method here to check for an auto-subscribe so we should probably just also tag it with referenced = true
.
PR on the way... just running CI tests now.
Bah... marking the store as referenced creates a codegen test failure....
Actually, I think the change to the expected output is OK since it used to be there before @Rich-Harris made his changes (though in a different order).
@Conduitry why do you have to use this syntax?
What syntax? I'm not sure what you're asking.
let store;
$store;
Describe the bug Since #3945, autosubscribing to a store within the template no longer causes the store to be marked as
referenced: true
in thevars
response from the compiler.Logs n/a
To Reproduce
Compile this, and look at the
vars
value in the response.store
hasreferenced: false
.Expected behavior
store
should havereferenced: true
.Stacktraces n/a
Information about your Svelte project: Svelte 3.16.0, 3.16.1
Severity Moderate. Causing new incorrect warnings in the ESLint plugin - https://github.com/sveltejs/eslint-plugin-svelte3/issues/49
Additional context Unlike the above, this seems to be working correctly: