Skip to content

Commit e3b0f80

Browse files
chore: Update a bunch of tests for hydration markers
1 parent 26d6613 commit e3b0f80

File tree

36 files changed

+57
-55
lines changed

36 files changed

+57
-55
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,12 @@ export class Boundary {
322322
var onerror = this.#props.onerror;
323323
let failed = this.#props.failed;
324324

325+
// If we have nothing to capture the error, or if we hit an error while
326+
// rendering the fallback, re-throw for another boundary to handle
327+
if (this.#is_creating_fallback || (!onerror && !failed)) {
328+
throw error;
329+
}
330+
325331
if (this.#main_effect) {
326332
destroy_effect(this.#main_effect);
327333
this.#main_effect = null;
@@ -385,12 +391,6 @@ export class Boundary {
385391
}
386392
};
387393

388-
// If we have nothing to capture the error, or if we hit an error while
389-
// rendering the fallback, re-throw for another boundary to handle
390-
if (this.#is_creating_fallback || (!onerror && !failed)) {
391-
throw error;
392-
}
393-
394394
var previous_reaction = active_reaction;
395395

396396
try {

packages/svelte/src/internal/client/render.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,12 @@ function _mount(Component, { target, anchor, props = {}, events, context, intro
220220
var unmount = component_root(() => {
221221
var anchor_node = anchor ?? target.appendChild(create_text());
222222

223-
branch(() => {
224-
boundary(/** @type {TemplateNode} */ (anchor_node), { pending: () => {} }, (anchor_node) => {
223+
boundary(
224+
/** @type {TemplateNode} */ (anchor_node),
225+
{
226+
pending: () => {}
227+
},
228+
(anchor_node) => {
225229
if (context) {
226230
push({});
227231
var ctx = /** @type {ComponentContext} */ (component_context);
@@ -249,8 +253,8 @@ function _mount(Component, { target, anchor, props = {}, events, context, intro
249253
if (context) {
250254
pop();
251255
}
252-
});
253-
});
256+
}
257+
);
254258

255259
return () => {
256260
for (var event_name of registered_events) {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!--[--><input> <p>Hello world!</p><!--]-->
1+
<!--[--><!--[--><input> <p>Hello world!</p><!--]--><!--]-->
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!--[--> <p>start</p><!--[--><p>cond</p><!--]--><!--]-->
1+
<!--[--><!--[--> <p>start</p><!--[--><p>cond</p><!--]--><!--]--><!--]-->
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!--[--><h1>Hello everybody!</h1><!--]-->
1+
<!--[--><!--[--><h1>Hello everybody!</h1><!--]--><!--]-->
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!--[--><ul><!--[--><li>a</li><!--]--></ul> <ul><!--[--><li>a</li><!--]--></ul> <ul><!--[--><li>a</li><!--]--></ul> <!--[--><li>a</li> <li>a</li><!--]--> <!--[--><li>a</li> <li>a</li><!--]--> <!--[--><li>a</li> <li>a</li><!--]--><!--]-->
1+
<!--[--><!--[--><ul><!--[--><li>a</li><!--]--></ul> <ul><!--[--><li>a</li><!--]--></ul> <ul><!--[--><li>a</li><!--]--></ul> <!--[--><li>a</li> <li>a</li><!--]--> <!--[--><li>a</li> <li>a</li><!--]--> <!--[--><li>a</li> <li>a</li><!--]--><!--]--><!--]-->
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!--[--><!--[!--><p>a</p><!--]--> <!--[--><p>empty</p><!--]--><!--]-->
1+
<!--[--><!--[--><!--[!--><p>a</p><!--]--> <!--[--><p>empty</p><!--]--><!--]--><!--]-->
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!--[--><ul><!--[--><li>a</li><!--]--></ul> <ul><!--[--><li>a</li><!--]--></ul> <ul><!--[--><li>a</li><!--]--></ul> <!--[--><li>a</li> <li>a</li><!--]--> <!--[--><li>a</li> <li>a</li><!--]--> <!--[--><li>a</li> <li>a</li><!--]--><!--]-->
1+
<!--[--><!--[--><ul><!--[--><li>a</li><!--]--></ul> <ul><!--[--><li>a</li><!--]--></ul> <ul><!--[--><li>a</li><!--]--></ul> <!--[--><li>a</li> <li>a</li><!--]--> <!--[--><li>a</li> <li>a</li><!--]--> <!--[--><li>a</li> <li>a</li><!--]--><!--]--><!--]-->
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!--[--><ul><!--[--><li>a</li><li>b</li><!--]--></ul> <ul><!--[--><li>a</li><li>b</li><!--]--></ul> <ul><!--[--><li>a</li><li>b</li><!--]--></ul> <!--[--><li>a</li> <li>a</li><li>b</li> <li>b</li><!--]--> <!--[--><li>a</li> <li>a</li><li>b</li> <li>b</li><!--]--> <!--[--><li>a</li> <li>a</li><li>b</li> <li>b</li><!--]--><!--]-->
1+
<!--[--><!--[--><ul><!--[--><li>a</li><li>b</li><!--]--></ul> <ul><!--[--><li>a</li><li>b</li><!--]--></ul> <ul><!--[--><li>a</li><li>b</li><!--]--></ul> <!--[--><li>a</li> <li>a</li><li>b</li> <li>b</li><!--]--> <!--[--><li>a</li> <li>a</li><li>b</li> <li>b</li><!--]--> <!--[--><li>a</li> <li>a</li><li>b</li> <li>b</li><!--]--><!--]--><!--]-->
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!--[--><div class="bar"></div><!--]-->
1+
<!--[--><!--[--><div class="bar"></div><!--]--><!--]-->

0 commit comments

Comments
 (0)