Open milahu opened 3 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Describe the bug impure expression in each block causes infinite loop in runtime
Severity low priority
To Reproduce repl - uncomment
//state[key] = val;
to crash the browser tabExpected behavior probably this impurity should be detected by the svelte compiler as fatal error at least i cannot think of a use case where this should work
Possible Solutions
1. compile time
parse the expression and look for assignments to non-local variables (sample code)
this would at least detect the simple case shown above. its harder to detect impure functions, that write to the global state
2. runtime
in the dev mode runtime, detect the infinite loop, stop it, and help to analyze (start devtools debugger?)
Related
Env Svelte version 3.32.3