File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
packages/svelte/src/internal/client/reactivity Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ let last_scheduled_effect = null;
7070
7171let is_flushing = false ;
7272
73- export let flushing_sync = false ;
73+ let flushing_sync = false ;
7474
7575export class Batch {
7676 /**
@@ -407,12 +407,12 @@ export class Batch {
407407 return ( this . #deferred ??= deferred ( ) ) . promise ;
408408 }
409409
410- static ensure ( autoflush = true ) {
410+ static ensure ( ) {
411411 if ( current_batch === null ) {
412412 const batch = ( current_batch = new Batch ( ) ) ;
413413 batches . add ( current_batch ) ;
414414
415- if ( autoflush ) {
415+ if ( ! flushing_sync ) {
416416 Batch . enqueue ( ( ) => {
417417 if ( current_batch !== batch ) {
418418 // a flushSync happened in the meantime
@@ -455,7 +455,7 @@ export function flushSync(fn) {
455455 try {
456456 var result ;
457457
458- const batch = Batch . ensure ( false ) ;
458+ const batch = Batch . ensure ( ) ;
459459
460460 if ( fn ) {
461461 batch . flush_effects ( ) ;
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ import * as e from '../errors.js';
3333import { legacy_mode_flag , tracing_mode_flag } from '../../flags/index.js' ;
3434import { get_stack , tag_proxy } from '../dev/tracing.js' ;
3535import { component_context , is_runes } from '../context.js' ;
36- import { Batch , flushing_sync , schedule_effect } from './batch.js' ;
36+ import { Batch , schedule_effect } from './batch.js' ;
3737import { proxy } from '../proxy.js' ;
3838import { execute_derived } from './deriveds.js' ;
3939
@@ -179,7 +179,7 @@ export function internal_set(source, value) {
179179
180180 source . v = value ;
181181
182- const batch = Batch . ensure ( ! flushing_sync ) ;
182+ var batch = Batch . ensure ( ) ;
183183 batch . capture ( source , old_value ) ;
184184
185185 if ( DEV ) {
You can’t perform that action at this time.
0 commit comments