File tree Expand file tree Collapse file tree 4 files changed +37
-1
lines changed
tests/migrate/samples/state-no-initial Expand file tree Collapse file tree 4 files changed +37
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' svelte ' : patch
3+ ---
4+
5+ fix: correct migration of uninitialised state
Original file line number Diff line number Diff line change @@ -564,7 +564,12 @@ const instance_script = {
564564 labeled_statement = /** @type {LabeledStatement } */ ( labeled ) ;
565565 }
566566
567- return ! update && ( declaration || ( labeled && assignment ) || ( ! labeled && ! assignment ) ) ;
567+ return (
568+ ! update &&
569+ ( ( declaration && binding . initial ) ||
570+ ( labeled && assignment ) ||
571+ ( ! labeled && ! assignment ) )
572+ ) ;
568573 } )
569574 ) ;
570575
Original file line number Diff line number Diff line change 1+ <script lang =" ts" >
2+ let bounds: DOMRect | undefined ;
3+ $ : position = calculatePosition (bounds );
4+
5+ const openDropdown = () => {
6+ bounds = getInputPosition ();
7+ };
8+
9+ const getInputPosition = () => {};
10+ const calculatePosition = (boundary ? : DOMRect ) => ({});
11+ </script >
12+
13+ <div style:top ={position .top }></div >
Original file line number Diff line number Diff line change 1+ <script lang =" ts" >
2+ let bounds: DOMRect | undefined = $state ();
3+
4+ const openDropdown = () => {
5+ bounds = getInputPosition ();
6+ };
7+
8+ const getInputPosition = () => {};
9+ const calculatePosition = (boundary ? : DOMRect ) => ({});
10+ let position = $derived (calculatePosition (bounds ));
11+ </script >
12+
13+ <div style:top ={position .top }></div >
You can’t perform that action at this time.
0 commit comments