2020-11-26 16:45:25 +01:00
|
|
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
|
|
2022-05-06 16:39:07 +02:00
|
|
|
exports[`basics display a nice error if a component is not a component 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-05-06 16:39:07 +02:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`SomeComponent\`, true, false, false, true);
|
2022-05-06 16:39:07 +02:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
2022-05-06 16:39:07 +02:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2022-01-24 13:14:50 +01:00
|
|
|
exports[`basics display a nice error if it cannot find component (in dev mode) 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-01-24 13:14:50 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`SomeMispelledComponent\`, true, false, false, true);
|
2022-01-24 13:14:50 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-01-24 13:25:00 +01:00
|
|
|
const props1 = {};
|
|
|
|
|
helpers.validateProps(\`SomeMispelledComponent\`, props1, ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1(props1, key + \`__1\`, node, this, null);
|
2022-01-24 13:14:50 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-11-08 10:30:36 +01:00
|
|
|
exports[`basics display a nice error if it cannot find component 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`SomeMispelledComponent\`, true, false, false, true);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2020-11-26 16:45:25 +01:00
|
|
|
exports[`basics no component catching error lead to full app destruction 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, false);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b2 = comp1({flag: ctx['state'].flag}, key + \`__1\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b2]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`basics no component catching error lead to full app destruction 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['props'].flag&&ctx['state'].this.will.crash;
|
|
|
|
|
return block1([txt1]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
exports[`basics simple catchError 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Boom\`, true, false, false, true);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-20 11:19:59 +01:00
|
|
|
let b2,b3;
|
|
|
|
|
if (ctx['error']) {
|
|
|
|
|
b2 = text(\`Error\`);
|
|
|
|
|
} else {
|
2022-06-22 15:39:31 +02:00
|
|
|
b3 = comp1({}, key + \`__1\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
|
|
|
|
return block1([], [b2, b3]);
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`basics simple catchError 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-08 10:30:36 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['a'].b.c;
|
|
|
|
|
return block1([txt1]);
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2022-03-31 10:35:09 +02:00
|
|
|
exports[`can catch errors an error in onWillDestroy 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-03-31 10:35:09 +02:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
2022-03-31 10:35:09 +02:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let b2,b3;
|
|
|
|
|
b2 = text(ctx['state'].value);
|
|
|
|
|
if (ctx['state'].hasChild) {
|
2022-06-22 15:39:31 +02:00
|
|
|
b3 = comp1({}, key + \`__1\`, node, this, null);
|
2022-03-31 10:35:09 +02:00
|
|
|
}
|
|
|
|
|
return multi([b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors an error in onWillDestroy 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-03-31 10:35:09 +02:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-03-31 10:35:09 +02:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div>abc</div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return block1();
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors an error in onWillDestroy, variation 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-03-31 10:35:09 +02:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
2022-03-31 10:35:09 +02:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let b2,b3;
|
|
|
|
|
b2 = text(ctx['state'].value);
|
|
|
|
|
if (ctx['state'].hasChild) {
|
2022-06-22 15:39:31 +02:00
|
|
|
b3 = comp1({}, key + \`__1\`, node, this, null);
|
2022-03-31 10:35:09 +02:00
|
|
|
}
|
|
|
|
|
return multi([b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors an error in onWillDestroy, variation 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-03-31 10:35:09 +02:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-03-31 10:35:09 +02:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div>abc</div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return block1();
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2022-01-31 15:03:52 +01:00
|
|
|
exports[`can catch errors calling a hook outside setup should crash 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-01-31 15:03:52 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-31 15:03:52 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return text(ctx['state'].value);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-11-08 10:30:36 +01:00
|
|
|
exports[`can catch errors can catch an error in a component render function 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, false);
|
|
|
|
|
const comp2 = app.createComponent(\`ErrorBoundary\`, true, true, false, true);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({flag: ctx['state'].flag}, key + \`__1\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b3]);
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors can catch an error in a component render function 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-child-1/><block-child-1/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let b2,b3;
|
|
|
|
|
if (ctx['state'].error) {
|
|
|
|
|
b2 = text(\`Error handled\`);
|
|
|
|
|
} else {
|
2022-06-06 08:17:51 +02:00
|
|
|
b3 = callSlot(ctx, node, key, 'default', false, {});
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
return block1([], [b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors can catch an error in a component render function 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-08 10:30:36 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['props'].flag&&ctx['state'].this.will.crash;
|
|
|
|
|
return block1([txt1]);
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors can catch an error in the constructor call of a component render function 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
|
|
|
|
const comp2 = app.createComponent(\`ErrorBoundary\`, true, true, false, true);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b3]);
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors can catch an error in the constructor call of a component render function 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-child-1/><block-child-1/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let b2,b3;
|
|
|
|
|
if (ctx['state'].error) {
|
|
|
|
|
b2 = text(\`Error handled\`);
|
|
|
|
|
} else {
|
2022-06-06 08:17:51 +02:00
|
|
|
b3 = callSlot(ctx, node, key, 'default', false, {});
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
return block1([], [b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-11-16 16:26:39 +01:00
|
|
|
exports[`can catch errors can catch an error in the constructor call of a component render function 2 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-16 16:26:39 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`ClassicCompoent\`, true, false, false, true);
|
|
|
|
|
const comp2 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
|
|
|
|
const comp3 = app.createComponent(\`ErrorBoundary\`, true, true, false, true);
|
2021-11-16 16:26:39 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
2021-11-16 16:26:39 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp1({}, key + \`__1\`, node, this, null);
|
|
|
|
|
const b4 = comp2({}, key + \`__2\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
return multi([b3, b4]);
|
2021-11-16 16:26:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b5 = comp3({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__3\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b5]);
|
2021-11-16 16:26:39 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`can catch errors can catch an error in the constructor call of a component render function 2 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-16 16:26:39 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2021-11-16 16:26:39 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-child-1/><block-child-1/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let b2,b3;
|
|
|
|
|
if (ctx['state'].error) {
|
|
|
|
|
b2 = text(\`Error handled\`);
|
|
|
|
|
} else {
|
2022-06-06 08:17:51 +02:00
|
|
|
b3 = callSlot(ctx, node, key, 'default', false, {});
|
2021-11-16 16:26:39 +01:00
|
|
|
}
|
|
|
|
|
return block1([], [b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`can catch errors can catch an error in the constructor call of a component render function 2 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-16 16:26:39 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-16 16:26:39 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div>classic</div>\`);
|
2021-11-16 16:26:39 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return block1();
|
2021-11-16 16:26:39 +01:00
|
|
|
}
|
2021-12-20 11:19:59 +01:00
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors can catch an error in the constructor call of a component render function 2 4`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-20 11:19:59 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-20 11:19:59 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div>Some text</div>\`);
|
2021-11-16 16:26:39 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1();
|
2021-11-16 16:26:39 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-11-08 10:30:36 +01:00
|
|
|
exports[`can catch errors can catch an error in the constructor call of a component render function 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-08 10:30:36 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div>Some text</div>\`);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1();
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors can catch an error in the initial call of a component render function (parent mounted) 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
|
|
|
|
const comp2 = app.createComponent(\`ErrorBoundary\`, true, true, false, true);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b3]);
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors can catch an error in the initial call of a component render function (parent mounted) 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-child-1/><block-child-1/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let b2,b3;
|
|
|
|
|
if (ctx['state'].error) {
|
|
|
|
|
b2 = text(\`Error handled\`);
|
|
|
|
|
} else {
|
2022-06-06 08:17:51 +02:00
|
|
|
b3 = callSlot(ctx, node, key, 'default', false, {});
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
return block1([], [b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors can catch an error in the initial call of a component render function (parent mounted) 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-08 10:30:36 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['state'].this.will.crash;
|
|
|
|
|
return block1([txt1]);
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors can catch an error in the initial call of a component render function (parent updated) 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
|
|
|
|
const comp2 = app.createComponent(\`ErrorBoundary\`, true, true, false, true);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-20 11:19:59 +01:00
|
|
|
let b3;
|
|
|
|
|
if (ctx['state'].flag) {
|
2022-06-22 15:39:31 +02:00
|
|
|
b3 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
|
|
|
|
return block1([], [b3]);
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors can catch an error in the initial call of a component render function (parent updated) 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-child-1/><block-child-1/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let b2,b3;
|
|
|
|
|
if (ctx['state'].error) {
|
|
|
|
|
b2 = text(\`Error handled\`);
|
|
|
|
|
} else {
|
2022-06-06 08:17:51 +02:00
|
|
|
b3 = callSlot(ctx, node, key, 'default', false, {});
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
return block1([], [b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors can catch an error in the initial call of a component render function (parent updated) 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-08 10:30:36 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['state'].this.will.crash;
|
|
|
|
|
return block1([txt1]);
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-11-30 08:14:01 +01:00
|
|
|
exports[`can catch errors can catch an error in the mounted call (in child of child) 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-30 08:14:01 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`B\`, true, false, false, true);
|
2021-11-30 08:14:01 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
2021-11-30 08:14:01 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors can catch an error in the mounted call (in child of child) 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-30 08:14:01 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`C\`, true, false, false, true);
|
2021-11-30 08:14:01 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b2 = comp1({}, key + \`__1\`, node, this, null);
|
2021-11-30 08:14:01 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`can catch errors can catch an error in the mounted call (in child of child) 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-30 08:14:01 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Boom\`, true, false, false, true);
|
2021-11-30 08:14:01 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
|
|
|
|
|
2021-11-30 08:14:01 +01:00
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-20 11:19:59 +01:00
|
|
|
let b2,b3;
|
|
|
|
|
if (ctx['state'].error) {
|
|
|
|
|
b2 = text(\`Error handled\`);
|
|
|
|
|
} else {
|
2022-06-22 15:39:31 +02:00
|
|
|
b3 = comp1({}, key + \`__1\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
|
|
|
|
return block1([], [b2, b3]);
|
2021-11-30 08:14:01 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`can catch errors can catch an error in the mounted call (in child of child) 4`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-30 08:14:01 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-30 08:14:01 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div>Some text</div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return block1();
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`can catch errors can catch an error in the mounted call (in root component) 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-30 08:14:01 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
2021-11-30 08:14:01 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let b2,b3;
|
|
|
|
|
if (ctx['state'].error) {
|
|
|
|
|
b2 = text(\`Error handled\`);
|
|
|
|
|
} else {
|
2022-06-22 15:39:31 +02:00
|
|
|
b3 = comp1({}, key + \`__1\`, node, this, null);
|
2021-11-30 08:14:01 +01:00
|
|
|
}
|
|
|
|
|
return block1([], [b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`can catch errors can catch an error in the mounted call (in root component) 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-17 11:06:24 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-17 11:06:24 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div>Some text</div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return block1();
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`can catch errors can catch an error in the mounted call 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-20 11:19:59 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
|
|
|
|
const comp2 = app.createComponent(\`ErrorBoundary\`, true, true, false, true);
|
2021-12-20 11:19:59 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-11-17 11:06:24 +01:00
|
|
|
exports[`can catch errors can catch an error in the mounted call 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-17 11:06:24 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2021-11-17 11:06:24 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-child-1/><block-child-1/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let b2,b3;
|
|
|
|
|
if (ctx['state'].error) {
|
|
|
|
|
b2 = text(\`Error handled\`);
|
|
|
|
|
} else {
|
2022-06-06 08:17:51 +02:00
|
|
|
b3 = callSlot(ctx, node, key, 'default', false, {});
|
2021-11-17 11:06:24 +01:00
|
|
|
}
|
|
|
|
|
return block1([], [b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors can catch an error in the mounted call 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-17 11:06:24 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-17 11:06:24 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div>Some text</div>\`);
|
2021-11-17 11:06:24 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1();
|
2021-11-17 11:06:24 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors can catch an error in the willPatch call 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-17 11:06:24 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, false);
|
|
|
|
|
const comp2 = app.createComponent(\`ErrorBoundary\`, true, true, false, true);
|
2021-11-17 11:06:24 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><span><block-text-0/></span><block-child-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({message: ctx['state'].message}, key + \`__1\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
2021-11-17 11:06:24 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['state'].message;
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
2021-12-22 11:33:12 +01:00
|
|
|
return block1([txt1], [b3]);
|
2021-11-17 11:06:24 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors can catch an error in the willPatch call 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-17 11:06:24 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2021-11-17 11:06:24 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-child-1/><block-child-1/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let b2,b3;
|
|
|
|
|
if (ctx['state'].error) {
|
|
|
|
|
b2 = text(\`Error handled\`);
|
|
|
|
|
} else {
|
2022-06-06 08:17:51 +02:00
|
|
|
b3 = callSlot(ctx, node, key, 'default', false, {});
|
2021-11-17 11:06:24 +01:00
|
|
|
}
|
|
|
|
|
return block1([], [b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors can catch an error in the willPatch call 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-17 11:06:24 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-17 11:06:24 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
2021-11-17 11:06:24 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['props'].message;
|
|
|
|
|
return block1([txt1]);
|
2021-11-17 11:06:24 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-11-08 10:30:36 +01:00
|
|
|
exports[`can catch errors can catch an error in the willStart call 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
|
|
|
|
const comp2 = app.createComponent(\`ErrorBoundary\`, true, true, false, true);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b3]);
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors can catch an error in the willStart call 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-child-1/><block-child-1/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let b2,b3;
|
|
|
|
|
if (ctx['state'].error) {
|
|
|
|
|
b2 = text(\`Error handled\`);
|
|
|
|
|
} else {
|
2022-06-06 08:17:51 +02:00
|
|
|
b3 = callSlot(ctx, node, key, 'default', false, {});
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
return block1([], [b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors can catch an error in the willStart call 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-08 10:30:36 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div>Some text</div>\`);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1();
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-11-16 16:26:39 +01:00
|
|
|
exports[`can catch errors can catch an error origination from a child's willStart function 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-16 16:26:39 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`ClassicCompoent\`, true, false, false, true);
|
|
|
|
|
const comp2 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
|
|
|
|
const comp3 = app.createComponent(\`ErrorBoundary\`, true, true, false, true);
|
2021-11-16 16:26:39 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
2021-11-16 16:26:39 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = comp1({}, key + \`__1\`, node, this, null);
|
|
|
|
|
const b4 = comp2({}, key + \`__2\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
return multi([b3, b4]);
|
2021-11-16 16:26:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b5 = comp3({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__3\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b5]);
|
2021-11-16 16:26:39 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`can catch errors can catch an error origination from a child's willStart function 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-16 16:26:39 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2021-11-16 16:26:39 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-child-1/><block-child-1/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let b2,b3;
|
|
|
|
|
if (ctx['state'].error) {
|
|
|
|
|
b2 = text(\`Error handled\`);
|
|
|
|
|
} else {
|
2022-06-06 08:17:51 +02:00
|
|
|
b3 = callSlot(ctx, node, key, 'default', false, {});
|
2021-11-16 16:26:39 +01:00
|
|
|
}
|
|
|
|
|
return block1([], [b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`can catch errors can catch an error origination from a child's willStart function 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-16 16:26:39 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-16 16:26:39 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div>classic</div>\`);
|
2021-11-16 16:26:39 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return block1();
|
2021-11-16 16:26:39 +01:00
|
|
|
}
|
2021-12-20 11:19:59 +01:00
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors can catch an error origination from a child's willStart function 4`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-20 11:19:59 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-20 11:19:59 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div>Some text</div>\`);
|
2021-11-16 16:26:39 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1();
|
2021-11-16 16:26:39 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-11-08 10:30:36 +01:00
|
|
|
exports[`can catch errors catchError in catchError 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-20 11:19:59 +01:00
|
|
|
let b2,b3;
|
|
|
|
|
if (ctx['error']) {
|
|
|
|
|
b2 = text(\`Error\`);
|
|
|
|
|
} else {
|
2022-06-22 15:39:31 +02:00
|
|
|
b3 = comp1({}, key + \`__1\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
|
|
|
|
return block1([], [b2, b3]);
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors catchError in catchError 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Boom\`, true, false, false, true);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b2 = comp1({}, key + \`__1\`, node, this, null);
|
2021-11-08 10:30:36 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors catchError in catchError 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-08 10:30:36 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['a'].b.c;
|
|
|
|
|
return block1([txt1]);
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 16:27:09 +01:00
|
|
|
exports[`can catch errors catching error, rethrow, render parent -- a main component loop implementation 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-20 16:27:09 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { prepareList, capture, markRaw, withKey } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(null, false, false, false, true);
|
|
|
|
|
const comp2 = app.createComponent(\`ErrorHandler\`, true, true, false, false);
|
2021-12-20 16:27:09 +01:00
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-03-06 10:27:07 +01:00
|
|
|
const Comp1 = ctx['cp'].Comp;
|
2022-06-22 15:39:31 +02:00
|
|
|
return toggler(Comp1, comp1({}, key + \`__1\`, node, this, Comp1));
|
2021-12-20 16:27:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
ctx = Object.create(ctx);
|
2022-03-06 10:27:07 +01:00
|
|
|
const [k_block1, v_block1, l_block1, c_block1] = prepareList(Object.values(ctx['state'].cps));;
|
2021-12-20 16:27:09 +01:00
|
|
|
for (let i1 = 0; i1 < l_block1; i1++) {
|
|
|
|
|
ctx[\`cp\`] = v_block1[i1];
|
2022-03-06 10:27:07 +01:00
|
|
|
const key1 = ctx['cp'].id;
|
2021-12-20 16:27:09 +01:00
|
|
|
const v1 = ctx['cp'];
|
2021-12-22 12:33:17 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
c_block1[i1] = withKey(comp2({onError: ()=>this.cleanUp(v1.id),slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2__\${key1}\`, node, this, null), key1);
|
2021-12-20 16:27:09 +01:00
|
|
|
}
|
|
|
|
|
return list(c_block1);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors catching error, rethrow, render parent -- a main component loop implementation 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-20 16:27:09 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-20 16:27:09 +01:00
|
|
|
let { callSlot } = helpers;
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
return callSlot(ctx, node, key, 'default', false, {});
|
2021-12-20 16:27:09 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors catching error, rethrow, render parent -- a main component loop implementation 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-20 16:27:09 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
2021-12-20 16:27:09 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
2021-12-20 16:27:09 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors catching error, rethrow, render parent -- a main component loop implementation 4`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-20 16:27:09 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-20 16:27:09 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div/>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return block1();
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors catching error, rethrow, render parent -- a main component loop implementation 5`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-20 16:27:09 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-20 16:27:09 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div>Sibling</div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return block1();
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2022-01-19 12:09:14 +01:00
|
|
|
exports[`can catch errors catching in child makes parent render 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-01-19 12:09:14 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { prepareList, capture, markRaw, withKey } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(null, false, false, false, false);
|
|
|
|
|
const comp2 = app.createComponent(\`Catch\`, true, true, false, false);
|
2022-01-19 12:09:14 +01:00
|
|
|
|
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-03-06 10:27:07 +01:00
|
|
|
const Comp1 = ctx['elem'][1];
|
2022-06-22 15:39:31 +02:00
|
|
|
return toggler(Comp1, comp1({id: ctx['elem'][0]}, key + \`__1\`, node, this, Comp1));
|
2022-01-19 12:09:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
ctx = Object.create(ctx);
|
2022-03-06 10:27:07 +01:00
|
|
|
const [k_block1, v_block1, l_block1, c_block1] = prepareList(Object.entries(this.elements));;
|
2022-01-19 12:09:14 +01:00
|
|
|
for (let i1 = 0; i1 < l_block1; i1++) {
|
|
|
|
|
ctx[\`elem\`] = v_block1[i1];
|
2022-03-06 10:27:07 +01:00
|
|
|
const key1 = ctx['elem'][0];
|
2022-01-19 12:09:14 +01:00
|
|
|
const v1 = ctx['elem'];
|
|
|
|
|
const ctx1 = capture(ctx);
|
2022-06-22 15:39:31 +02:00
|
|
|
c_block1[i1] = withKey(comp2({onError: (_error)=>this.onError(v1[0],_error),slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2__\${key1}\`, node, this, null), key1);
|
2022-01-19 12:09:14 +01:00
|
|
|
}
|
|
|
|
|
return list(c_block1);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors catching in child makes parent render 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-01-19 12:09:14 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-19 12:09:14 +01:00
|
|
|
let { callSlot } = helpers;
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-06 08:17:51 +02:00
|
|
|
return callSlot(ctx, node, key, 'default', false, {});
|
2022-01-19 12:09:14 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors catching in child makes parent render 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-01-19 12:09:14 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-19 12:09:14 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div/>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return block1();
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors catching in child makes parent render 4`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-01-19 12:09:14 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-19 12:09:14 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let txt1 = 'Child '+ctx['props'].id;
|
|
|
|
|
return block1([txt1]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-11-30 22:21:27 +01:00
|
|
|
exports[`can catch errors error in mounted on a component with a sibling (properly mounted) 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-30 22:21:27 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-10 14:35:57 +01:00
|
|
|
let { markRaw } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`OK\`, true, false, false, true);
|
|
|
|
|
const comp2 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
|
|
|
|
const comp3 = app.createComponent(\`ErrorBoundary\`, true, true, false, true);
|
2021-11-30 22:21:27 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp2({}, key + \`__2\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
2021-11-30 22:21:27 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b2 = comp1({}, key + \`__1\`, node, this, null);
|
|
|
|
|
const b4 = comp3({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__3\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b2, b4]);
|
2021-11-30 22:21:27 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors error in mounted on a component with a sibling (properly mounted) 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-20 11:19:59 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-20 11:19:59 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return text(\`OK\`);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`can catch errors error in mounted on a component with a sibling (properly mounted) 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-30 22:21:27 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { callSlot } = helpers;
|
2021-11-30 22:21:27 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-child-1/><block-child-1/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let b2,b3;
|
|
|
|
|
if (ctx['state'].error) {
|
|
|
|
|
b2 = text(\`Error handled\`);
|
|
|
|
|
} else {
|
2022-06-06 08:17:51 +02:00
|
|
|
b3 = callSlot(ctx, node, key, 'default', false, {});
|
2021-11-30 22:21:27 +01:00
|
|
|
}
|
|
|
|
|
return block1([], [b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`can catch errors error in mounted on a component with a sibling (properly mounted) 4`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-30 22:21:27 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-30 22:21:27 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div>Some text</div>\`);
|
|
|
|
|
|
2021-11-30 22:21:27 +01:00
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1();
|
2021-11-30 22:21:27 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`can catch errors onError in class inheritance is called if rethrown 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-30 22:21:27 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Concrete\`, true, false, false, true);
|
2021-11-30 22:21:27 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
2021-11-30 22:21:27 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`can catch errors onError in class inheritance is called if rethrown 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-01 15:42:22 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 15:42:22 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let b2,b3;
|
|
|
|
|
if (!ctx['state'].error) {
|
|
|
|
|
b2 = text(this.will.crash);
|
|
|
|
|
} else {
|
|
|
|
|
b3 = text(ctx['state'].error);
|
|
|
|
|
}
|
|
|
|
|
return block1([], [b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`can catch errors onError in class inheritance is not called if no rethrown 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-01 15:42:22 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Concrete\`, true, false, false, true);
|
2021-12-01 15:42:22 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
2021-12-01 15:42:22 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`can catch errors onError in class inheritance is not called if no rethrown 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-01 15:42:22 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 15:42:22 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let b2,b3;
|
|
|
|
|
if (!ctx['state'].error) {
|
|
|
|
|
b2 = text(this.will.crash);
|
|
|
|
|
} else {
|
|
|
|
|
b3 = text(ctx['state'].error);
|
|
|
|
|
}
|
|
|
|
|
return block1([], [b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-11-08 10:30:36 +01:00
|
|
|
exports[`errors and promises a rendering error in a sub component will reject the mount promise 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b2 = comp1({}, key + \`__1\`, node, this, null);
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b2]);
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`errors and promises a rendering error in a sub component will reject the mount promise 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-08 10:30:36 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = this.will.crash;
|
|
|
|
|
return block1([txt1]);
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`errors and promises a rendering error will reject the mount promise 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = this.will.crash;
|
|
|
|
|
return block1([txt1]);
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`errors and promises a rendering error will reject the render promise (with sub components) 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-text-0/></div>\`);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
const b2 = comp1({}, key + \`__1\`, node, this, null);
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['x'].y;
|
|
|
|
|
return block1([txt1], [b2]);
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`errors and promises a rendering error will reject the render promise (with sub components) 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-08 10:30:36 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<span/>\`);
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1();
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`errors and promises a rendering error will reject the render promise 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let b2;
|
|
|
|
|
if (ctx['flag']) {
|
|
|
|
|
b2 = text(this.will.crash);
|
|
|
|
|
}
|
|
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`errors and promises an error in mounted call will reject the mount promise 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div>abc</div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return block1();
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2022-02-10 14:47:16 +01:00
|
|
|
exports[`errors and promises an error in onMounted callback will have the component's setup in its stack trace 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-02-10 14:47:16 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-02-10 14:47:16 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div>abc</div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return block1();
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-11-08 10:30:36 +01:00
|
|
|
exports[`errors and promises an error in patched call will reject the render promise 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['val'];
|
|
|
|
|
return block1([txt1]);
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`errors and promises an error in willPatch call will reject the render promise 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['val'];
|
|
|
|
|
return block1([txt1]);
|
2021-11-08 10:30:36 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`errors and promises errors in mounted and in willUnmount 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-08 10:30:36 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-08 10:30:36 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div/>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return block1();
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
2021-12-15 15:55:13 +01:00
|
|
|
|
2022-03-08 09:37:39 +01:00
|
|
|
exports[`errors and promises errors in onWillRender/onRender aren't wrapped more than once 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-03-08 09:37:39 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-03-08 09:37:39 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div>abc</div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return block1();
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-15 15:55:13 +01:00
|
|
|
exports[`errors and promises errors in rerender 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-15 15:55:13 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-15 15:55:13 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['state'].a.b;
|
|
|
|
|
return block1([txt1]);
|
2021-12-15 15:55:13 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|