File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed
packages/svelte/src/internal/client/reactivity Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -341,13 +341,13 @@ export class Batch {
341
341
342
342
flush ( ) {
343
343
if ( queued_root_effects . length > 0 ) {
344
- this . flush_effects ( ) ;
344
+ flush_effects ( ) ;
345
345
} else {
346
346
this . #commit( ) ;
347
347
}
348
348
349
349
if ( current_batch !== this ) {
350
- // this can happen if a `flushSync` occurred during `this. flush_effects()`,
350
+ // this can happen if a `flushSync` occurred during `flush_effects()`,
351
351
// which is permitted in legacy mode despite being a terrible idea
352
352
return ;
353
353
}
@@ -359,10 +359,6 @@ export class Batch {
359
359
this . deactivate ( ) ;
360
360
}
361
361
362
- flush_effects ( ) {
363
- flush_effects ( ) ;
364
- }
365
-
366
362
/**
367
363
* Append and remove branches to/from the DOM
368
364
*/
@@ -454,11 +450,10 @@ export function flushSync(fn) {
454
450
try {
455
451
var result ;
456
452
457
- const batch = Batch . ensure ( ) ;
453
+ var batch = Batch . ensure ( ) ;
458
454
459
455
if ( fn ) {
460
- batch . flush_effects ( ) ;
461
-
456
+ flush_effects ( ) ;
462
457
result = fn ( ) ;
463
458
}
464
459
@@ -473,15 +468,15 @@ export function flushSync(fn) {
473
468
474
469
// TODO this feels wrong
475
470
if ( queued_root_effects . length === 0 ) {
476
- // this would be reset in `batch. flush_effects()` but since we are early returning here,
471
+ // this would be reset in `flush_effects()` but since we are early returning here,
477
472
// we need to reset it here as well in case the first time there's 0 queued root effects
478
473
last_scheduled_effect = null ;
479
474
480
475
return /** @type {T } */ ( result ) ;
481
476
}
482
477
}
483
478
484
- batch . flush_effects ( ) ;
479
+ flush_effects ( ) ;
485
480
}
486
481
} finally {
487
482
is_flushing_sync = prev_flushing_sync ;
You can’t perform that action at this time.
0 commit comments