Skip to content

Commit c7c9404

Browse files
committed
make stuff private
1 parent 0c5b4d8 commit c7c9404

File tree

1 file changed

+28
-28
lines changed
  • packages/svelte/src/internal/client/reactivity

1 file changed

+28
-28
lines changed

packages/svelte/src/internal/client/reactivity/batch.js

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,16 @@ export class Batch {
8484
#deferred = null;
8585

8686
/** @type {Effect[]} */
87-
async_effects = [];
87+
#async_effects = [];
8888

8989
/** @type {Effect[]} */
90-
boundary_async_effects = [];
90+
#boundary_async_effects = [];
9191

9292
/** @type {Effect[]} */
93-
render_effects = [];
93+
#render_effects = [];
9494

9595
/** @type {Effect[]} */
96-
effects = [];
96+
#effects = [];
9797

9898
/**
9999
* A set of branches that still exist, but will be destroyed when this batch
@@ -145,7 +145,7 @@ export class Batch {
145145
this.process_root(root);
146146
}
147147

148-
if (this.async_effects.length === 0 && this.#pending === 0) {
148+
if (this.#async_effects.length === 0 && this.#pending === 0) {
149149
var merged = false;
150150

151151
// if there are older batches with overlapping
@@ -162,19 +162,19 @@ export class Batch {
162162
batch.#current.set(source, value);
163163
}
164164

165-
for (const e of this.render_effects) {
165+
for (const e of this.#render_effects) {
166166
set_signal_status(e, CLEAN);
167167
// TODO use sets instead of arrays
168-
if (!batch.render_effects.includes(e)) {
169-
batch.render_effects.push(e);
168+
if (!batch.#render_effects.includes(e)) {
169+
batch.#render_effects.push(e);
170170
}
171171
}
172172

173-
for (const e of this.effects) {
173+
for (const e of this.#effects) {
174174
set_signal_status(e, CLEAN);
175175
// TODO use sets instead of arrays
176-
if (!batch.effects.includes(e)) {
177-
batch.effects.push(e);
176+
if (!batch.#effects.includes(e)) {
177+
batch.#effects.push(e);
178178
}
179179
}
180180

@@ -192,11 +192,11 @@ export class Batch {
192192
}
193193

194194
if (!merged) {
195-
var render_effects = this.render_effects;
196-
var effects = this.effects;
195+
var render_effects = this.#render_effects;
196+
var effects = this.#effects;
197197

198-
this.render_effects = [];
199-
this.effects = [];
198+
this.#render_effects = [];
199+
this.#effects = [];
200200

201201
this.#commit();
202202

@@ -206,8 +206,8 @@ export class Batch {
206206
this.#deferred?.resolve();
207207
}
208208
} else {
209-
for (const e of this.render_effects) set_signal_status(e, CLEAN);
210-
for (const e of this.effects) set_signal_status(e, CLEAN);
209+
for (const e of this.#render_effects) set_signal_status(e, CLEAN);
210+
for (const e of this.#effects) set_signal_status(e, CLEAN);
211211
}
212212

213213
if (current_values) {
@@ -222,16 +222,16 @@ export class Batch {
222222
batch_deriveds = null;
223223
}
224224

225-
for (const effect of this.async_effects) {
225+
for (const effect of this.#async_effects) {
226226
update_effect(effect);
227227
}
228228

229-
for (const effect of this.boundary_async_effects) {
229+
for (const effect of this.#boundary_async_effects) {
230230
update_effect(effect);
231231
}
232232

233-
this.async_effects = [];
234-
this.boundary_async_effects = [];
233+
this.#async_effects = [];
234+
this.#boundary_async_effects = [];
235235
}
236236

237237
/**
@@ -254,7 +254,7 @@ export class Batch {
254254
const boundary = effect.b;
255255

256256
if (check_dirtiness(effect)) {
257-
var effects = boundary?.pending ? this.boundary_async_effects : this.async_effects;
257+
var effects = boundary?.pending ? this.#boundary_async_effects : this.#async_effects;
258258
effects.push(effect);
259259
}
260260
} else if ((flags & BLOCK_EFFECT) !== 0) {
@@ -267,14 +267,14 @@ export class Batch {
267267
// we need to branch here because in legacy mode we run render effects
268268
// before running block effects
269269
if (async_mode_flag) {
270-
this.render_effects.push(effect);
270+
this.#render_effects.push(effect);
271271
} else {
272272
if (check_dirtiness(effect)) {
273273
update_effect(effect);
274274
}
275275
}
276276
} else if ((flags & EFFECT) !== 0) {
277-
this.effects.push(effect);
277+
this.#effects.push(effect);
278278
}
279279

280280
var child = effect.first;
@@ -377,18 +377,18 @@ export class Batch {
377377
this.#pending -= 1;
378378

379379
if (this.#pending === 0) {
380-
for (const e of this.render_effects) {
380+
for (const e of this.#render_effects) {
381381
set_signal_status(e, DIRTY);
382382
schedule_effect(e);
383383
}
384384

385-
for (const e of this.effects) {
385+
for (const e of this.#effects) {
386386
set_signal_status(e, DIRTY);
387387
schedule_effect(e);
388388
}
389389

390-
this.render_effects = [];
391-
this.effects = [];
390+
this.#render_effects = [];
391+
this.#effects = [];
392392

393393
this.flush();
394394
}

0 commit comments

Comments
 (0)