File tree 4 files changed +20
-0
lines changed
src/compiler/compile/render_ssr
test/runtime/samples/reactive-block-break
4 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 4
4
5
5
* Fix ` {#each} ` context not shadowing outer scope when using ` bind: ` ([ #1565 ] ( https://github.com/sveltejs/svelte/issues/1565 ) )
6
6
* Fix edge cases in matching selectors against elements ([ #1710 ] ( https://github.com/sveltejs/svelte/issues/1710 ) )
7
+ * Allow exiting a reactive block early with ` break $ ` ([ #2828 ] ( https://github.com/sveltejs/svelte/issues/2828 ) )
7
8
* Check attributes have changed before setting them to avoid image flicker ([ #3579 ] ( https://github.com/sveltejs/svelte/pull/3579 ) )
8
9
* Fix generating malformed code for ` {@debug} ` tags with no dependencies ([ #3588 ] ( https://github.com/sveltejs/svelte/issue/3588 ) )
9
10
* Use safer ` HTMLElement ` check before extending class ([ #3608 ] ( https://github.com/sveltejs/svelte/issue/3608 ) )
Original file line number Diff line number Diff line change @@ -98,6 +98,8 @@ export default function ssr(
98
98
: b `
99
99
let ${ left } = ${ right } ` ;
100
100
}
101
+ } else { // TODO do not add label if it's not referenced
102
+ statement = b `$: { ${ statement } }` ;
101
103
}
102
104
103
105
return statement ;
Original file line number Diff line number Diff line change
1
+ export default {
2
+ html : `<h1>1 2</h1>`
3
+ } ;
Original file line number Diff line number Diff line change
1
+ <script >
2
+ let foo = 0 ;
3
+ let bar;
4
+ $: {
5
+ bar = foo + 1 ;
6
+ if (foo) {
7
+ break $;
8
+ }
9
+ bar = foo + 2 ;
10
+ }
11
+ foo = 1 ;
12
+ </script >
13
+
14
+ <h1 >{foo } {bar }</h1 >
You can’t perform that action at this time.
0 commit comments