File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed
packages/svelte/src/internal/client/reactivity Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -450,8 +450,6 @@ export function flushSync(fn) {
450450 try {
451451 var result ;
452452
453- var batch = Batch . ensure ( ) ;
454-
455453 if ( fn ) {
456454 flush_effects ( ) ;
457455 result = fn ( ) ;
@@ -461,10 +459,7 @@ export function flushSync(fn) {
461459 flush_tasks ( ) ;
462460
463461 if ( queued_root_effects . length === 0 ) {
464- // TODO this might need adjustment
465- if ( batch === current_batch ) {
466- batch . flush ( ) ;
467- }
462+ current_batch ?. flush ( ) ;
468463
469464 // TODO this feels wrong
470465 if ( queued_root_effects . length === 0 ) {
@@ -492,7 +487,7 @@ function flush_effects() {
492487 set_is_updating_effect ( true ) ;
493488
494489 while ( queued_root_effects . length > 0 ) {
495- var batch = /** @type { Batch } */ ( current_batch ) ;
490+ var batch = Batch . ensure ( ) ;
496491
497492 if ( flush_count ++ > 1000 ) {
498493 if ( DEV ) {
You can’t perform that action at this time.
0 commit comments