@@ -23,29 +23,29 @@ function update_pending() {
2323let uid = 1 ;
2424
2525export class Batch {
26- id = uid ++ ;
26+ # id = uid ++ ;
2727
2828 /** @type {Map<Source, any> } */
29- previous = new Map ( ) ;
29+ # previous = new Map ( ) ;
3030
3131 /** @type {Map<Source, any> } */
32- current = new Map ( ) ;
32+ # current = new Map ( ) ;
3333
3434 /** @type {Set<Effect> } */
3535 skipped_effects = new Set ( ) ;
3636
3737 /** @type {Set<() => void> } */
3838 #callbacks = new Set ( ) ;
3939
40- pending = 0 ;
40+ # pending = 0 ;
4141
4242 apply ( ) {
4343 // common case: no overlapping batches, nothing to revert
4444 if ( batches . size === 1 ) return noop ;
4545
4646 var current_values = new Map ( ) ;
4747
48- for ( const [ source , current ] of this . current ) {
48+ for ( const [ source , current ] of this . # current) {
4949 // TODO this shouldn't be necessary, but tests fail otherwise,
5050 // presumably because we need a try-finally somewhere, and the
5151 // source wasn't correctly reverted after the previous batch
@@ -55,8 +55,8 @@ export class Batch {
5555 for ( const batch of batches ) {
5656 if ( batch === this ) continue ;
5757
58- for ( const [ source , previous ] of batch . previous ) {
59- if ( ! this . previous . has ( source ) ) {
58+ for ( const [ source , previous ] of batch . # previous) {
59+ if ( ! this . # previous. has ( source ) ) {
6060 // mark_reactions(source, DIRTY);
6161 current_values . set ( source , source . v ) ;
6262 source . v = previous ;
@@ -76,27 +76,27 @@ export class Batch {
7676 * @param {any } value
7777 */
7878 capture ( source , value ) {
79- if ( ! this . previous . has ( source ) ) {
80- this . previous . set ( source , value ) ;
79+ if ( ! this . # previous. has ( source ) ) {
80+ this . # previous. set ( source , value ) ;
8181 }
8282
83- this . current . set ( source , source . v ) ;
83+ this . # current. set ( source , source . v ) ;
8484 }
8585
8686 remove ( ) {
8787 batches . delete ( this ) ;
8888
8989 for ( var batch of batches ) {
90- if ( batch . id < this . id ) {
90+ if ( batch . # id < this . # id) {
9191 // other batch is older than this
92- for ( var source of this . previous . keys ( ) ) {
93- batch . previous . delete ( source ) ;
92+ for ( var source of this . # previous. keys ( ) ) {
93+ batch . # previous. delete ( source ) ;
9494 }
9595 } else {
9696 // other batch is newer than this
97- for ( var source of batch . previous . keys ( ) ) {
98- if ( this . previous . has ( source ) ) {
99- batch . previous . set ( source , source . v ) ;
97+ for ( var source of batch . # previous. keys ( ) ) {
98+ if ( this . # previous. has ( source ) ) {
99+ batch . # previous. set ( source , source . v ) ;
100100 }
101101 }
102102 }
@@ -114,15 +114,15 @@ export class Batch {
114114 }
115115
116116 increment ( ) {
117- this . pending += 1 ;
117+ this . # pending += 1 ;
118118 }
119119
120120 decrement ( ) {
121- this . pending -= 1 ;
121+ this . # pending -= 1 ;
122122 }
123123
124124 settled ( ) {
125- return this . pending === 0 ;
125+ return this . # pending === 0 ;
126126 }
127127
128128 /** @param {() => void } fn */
0 commit comments