Skip to content

Commit 95400b5

Browse files
committed
make boundary.pending private, use boundary.is_pending consistently
1 parent 128e158 commit 95400b5

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

packages/svelte/src/internal/client/dom/blocks/boundary.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ export function boundary(node, props, children) {
4949
}
5050

5151
export class Boundary {
52-
pending = false;
53-
5452
/** @type {Boundary | null} */
5553
parent;
5654

55+
#pending = false;
56+
5757
/** @type {TemplateNode} */
5858
#anchor;
5959

@@ -126,7 +126,7 @@ export class Boundary {
126126

127127
this.parent = /** @type {Effect} */ (active_effect).b;
128128

129-
this.pending = !!this.#props.pending;
129+
this.#pending = !!this.#props.pending;
130130

131131
this.#effect = block(() => {
132132
/** @type {Effect} */ (active_effect).b = this;
@@ -157,7 +157,7 @@ export class Boundary {
157157
this.#pending_effect = null;
158158
});
159159

160-
this.pending = false;
160+
this.#pending = false;
161161
}
162162
});
163163
} else {
@@ -170,7 +170,7 @@ export class Boundary {
170170
if (this.#pending_count > 0) {
171171
this.#show_pending_snippet();
172172
} else {
173-
this.pending = false;
173+
this.#pending = false;
174174
}
175175
}
176176
}, flags);
@@ -185,7 +185,7 @@ export class Boundary {
185185
* @returns {boolean}
186186
*/
187187
is_pending() {
188-
return this.pending || (!!this.parent && this.parent.is_pending());
188+
return this.#pending || (!!this.parent && this.parent.is_pending());
189189
}
190190

191191
has_pending_snippet() {
@@ -246,7 +246,7 @@ export class Boundary {
246246
this.#pending_count += d;
247247

248248
if (this.#pending_count === 0) {
249-
this.pending = false;
249+
this.#pending = false;
250250

251251
if (this.#pending_effect) {
252252
pause_effect(this.#pending_effect, () => {
@@ -326,7 +326,7 @@ export class Boundary {
326326
});
327327
}
328328

329-
this.pending = true;
329+
this.#pending = true;
330330

331331
this.#main_effect = this.#run(() => {
332332
this.#is_creating_fallback = false;
@@ -336,7 +336,7 @@ export class Boundary {
336336
if (this.#pending_count > 0) {
337337
this.#show_pending_snippet();
338338
} else {
339-
this.pending = false;
339+
this.#pending = false;
340340
}
341341
};
342342

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,10 @@ export class Batch {
298298
this.#render_effects.push(effect);
299299
} else if ((flags & CLEAN) === 0) {
300300
if ((flags & ASYNC) !== 0) {
301-
var effects = effect.b?.pending ? this.#boundary_async_effects : this.#async_effects;
301+
var effects = effect.b?.is_pending()
302+
? this.#boundary_async_effects
303+
: this.#async_effects;
304+
302305
effects.push(effect);
303306
} else if (is_dirty(effect)) {
304307
if ((effect.f & BLOCK_EFFECT) !== 0) this.#block_effects.push(effect);

0 commit comments

Comments
 (0)