mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
1456 lines
42 KiB
Plaintext
1456 lines
42 KiB
Plaintext
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
exports[`basics display a nice error if a component is not a component 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
const comp1 = app.createComponent(\`SomeComponent\`, true, false, false, true);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`basics display a nice error if it cannot find component (in dev mode) 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
const comp1 = app.createComponent(\`SomeMispelledComponent\`, true, false, false, true);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const props1 = {};
|
|
helpers.validateProps(\`SomeMispelledComponent\`, props1, ctx);
|
|
return comp1(props1, key + \`__1\`, node, this, null);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`basics display a nice error if it cannot find component 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
const comp1 = app.createComponent(\`SomeMispelledComponent\`, true, false, false, true);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`basics no component catching error lead to full app destruction 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, false);
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b2 = comp1({flag: ctx['state'].flag}, key + \`__1\`, node, this, null);
|
|
return block1([], [b2]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`basics no component catching error lead to full app destruction 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let txt1 = ctx['props'].flag&&ctx['state'].this.will.crash;
|
|
return block1([txt1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`basics simple catchError 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
const comp1 = app.createComponent(\`Boom\`, true, false, false, true);
|
|
|
|
let block3 = createBlock(\`<div>
|
|
<block-child-0/><block-child-1/>
|
|
</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b2 = text(\`
|
|
\`);
|
|
let b4,b5;
|
|
if (ctx['error']) {
|
|
b4 = text(\`Error\`);
|
|
} else {
|
|
const b6 = text(\`
|
|
\`);
|
|
const b7 = comp1({}, key + \`__1\`, node, this, null);
|
|
const b8 = text(\`
|
|
\`);
|
|
b5 = multi([b6, b7, b8]);
|
|
}
|
|
const b3 = block3([], [b4, b5]);
|
|
return multi([b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`basics simple catchError 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let txt1 = ctx['a'].b.c;
|
|
return block1([txt1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors an error in onWillDestroy 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let b2,b3,b4,b5;
|
|
b2 = text(\`
|
|
\`);
|
|
b3 = text(ctx['state'].value);
|
|
b4 = text(\`
|
|
\`);
|
|
if (ctx['state'].hasChild) {
|
|
b5 = comp1({}, key + \`__1\`, node, this, null);
|
|
}
|
|
return multi([b2, b3, b4, b5]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors an error in onWillDestroy 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div>abc</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors an error in onWillDestroy, variation 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let b2,b3,b4,b5;
|
|
b2 = text(\`
|
|
\`);
|
|
b3 = text(ctx['state'].value);
|
|
b4 = text(\`
|
|
\`);
|
|
if (ctx['state'].hasChild) {
|
|
b5 = comp1({}, key + \`__1\`, node, this, null);
|
|
}
|
|
return multi([b2, b3, b4, b5]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors an error in onWillDestroy, variation 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div>abc</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors calling a hook outside setup should crash 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return text(ctx['state'].value);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in a component render function 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { markRaw } = helpers;
|
|
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, false);
|
|
const comp2 = app.createComponent(\`ErrorBoundary\`, true, true, false, true);
|
|
|
|
let block3 = createBlock(\`<div>
|
|
<block-child-0/>
|
|
</div>\`);
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
return comp1({flag: ctx['state'].flag}, key + \`__1\`, node, this, null);
|
|
}
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b2 = text(\`
|
|
\`);
|
|
const b5 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
|
const b3 = block3([], [b5]);
|
|
return multi([b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in a component render function 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { callSlot } = helpers;
|
|
|
|
let block3 = createBlock(\`<div>
|
|
<block-child-0/><block-child-1/><block-child-1/>
|
|
</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b2 = text(\`
|
|
\`);
|
|
let b4,b5;
|
|
if (ctx['state'].error) {
|
|
b4 = text(\`Error handled\`);
|
|
} else {
|
|
b5 = callSlot(ctx, node, key, 'default', false, {});
|
|
}
|
|
const b3 = block3([], [b4, b5]);
|
|
return multi([b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in a component render function 3`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let txt1 = ctx['props'].flag&&ctx['state'].this.will.crash;
|
|
return block1([txt1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the constructor call of a component render function 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { markRaw } = helpers;
|
|
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
|
const comp2 = app.createComponent(\`ErrorBoundary\`, true, true, false, true);
|
|
|
|
let block1 = createBlock(\`<div>
|
|
<block-child-0/>
|
|
</div>\`);
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
|
}
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b3 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
|
return block1([], [b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the constructor call of a component render function 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { callSlot } = helpers;
|
|
|
|
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 {
|
|
b3 = callSlot(ctx, node, key, 'default', false, {});
|
|
}
|
|
return block1([], [b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the constructor call of a component render function 2 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { markRaw } = helpers;
|
|
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);
|
|
|
|
let block1 = createBlock(\`<div>
|
|
<block-child-0/>
|
|
</div>\`);
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
const b3 = comp1({}, key + \`__1\`, node, this, null);
|
|
const b4 = comp2({}, key + \`__2\`, node, this, null);
|
|
return multi([b3, b4]);
|
|
}
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b5 = comp3({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__3\`, node, this, null);
|
|
return block1([], [b5]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the constructor call of a component render function 2 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { callSlot } = helpers;
|
|
|
|
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 {
|
|
b3 = callSlot(ctx, node, key, 'default', false, {});
|
|
}
|
|
return block1([], [b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the constructor call of a component render function 2 3`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div>classic</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the constructor call of a component render function 2 4`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div>Some text</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the constructor call of a component render function 3`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div>Some text</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the initial call of a component render function (parent mounted) 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { markRaw } = helpers;
|
|
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
|
const comp2 = app.createComponent(\`ErrorBoundary\`, true, true, false, true);
|
|
|
|
let block3 = createBlock(\`<div>
|
|
<block-child-0/>
|
|
</div>\`);
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
|
}
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b2 = text(\`
|
|
\`);
|
|
const b5 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
|
const b3 = block3([], [b5]);
|
|
return multi([b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the initial call of a component render function (parent mounted) 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { callSlot } = helpers;
|
|
|
|
let block3 = createBlock(\`<div>
|
|
<block-child-0/><block-child-1/><block-child-1/>
|
|
</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b2 = text(\`
|
|
\`);
|
|
let b4,b5;
|
|
if (ctx['state'].error) {
|
|
b4 = text(\`Error handled\`);
|
|
} else {
|
|
b5 = callSlot(ctx, node, key, 'default', false, {});
|
|
}
|
|
const b3 = block3([], [b4, b5]);
|
|
return multi([b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the initial call of a component render function (parent mounted) 3`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let txt1 = ctx['state'].this.will.crash;
|
|
return block1([txt1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the initial call of a component render function (parent updated) 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { markRaw } = helpers;
|
|
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
|
const comp2 = app.createComponent(\`ErrorBoundary\`, true, true, false, true);
|
|
|
|
let block3 = createBlock(\`<div>
|
|
<block-child-0/>
|
|
</div>\`);
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
|
}
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b2 = text(\`
|
|
\`);
|
|
let b5;
|
|
if (ctx['state'].flag) {
|
|
b5 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
|
}
|
|
const b3 = block3([], [b5]);
|
|
return multi([b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the initial call of a component render function (parent updated) 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { callSlot } = helpers;
|
|
|
|
let block3 = createBlock(\`<div>
|
|
<block-child-0/><block-child-1/><block-child-1/>
|
|
</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b2 = text(\`
|
|
\`);
|
|
let b4,b5;
|
|
if (ctx['state'].error) {
|
|
b4 = text(\`Error handled\`);
|
|
} else {
|
|
b5 = callSlot(ctx, node, key, 'default', false, {});
|
|
}
|
|
const b3 = block3([], [b4, b5]);
|
|
return multi([b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the initial call of a component render function (parent updated) 3`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div>hey<block-text-0/></div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let txt1 = ctx['state'].this.will.crash;
|
|
return block1([txt1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the mounted call (in child of child) 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
const comp1 = app.createComponent(\`B\`, true, false, false, true);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the mounted call (in child of child) 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
const comp1 = app.createComponent(\`C\`, true, false, false, true);
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b2 = comp1({}, key + \`__1\`, node, this, null);
|
|
return block1([], [b2]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the mounted call (in child of child) 3`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
const comp1 = app.createComponent(\`Boom\`, true, false, false, true);
|
|
|
|
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 {
|
|
b3 = comp1({}, key + \`__1\`, node, this, null);
|
|
}
|
|
return block1([], [b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the mounted call (in child of child) 4`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div>Some text</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the mounted call (in root component) 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
|
|
|
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 {
|
|
b3 = comp1({}, key + \`__1\`, node, this, null);
|
|
}
|
|
return block1([], [b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the mounted call (in root component) 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div>Some text</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the mounted call 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { markRaw } = helpers;
|
|
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
|
const comp2 = app.createComponent(\`ErrorBoundary\`, true, true, false, true);
|
|
|
|
let block1 = createBlock(\`<div>
|
|
<block-child-0/>
|
|
</div>\`);
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
|
}
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b3 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
|
return block1([], [b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the mounted call 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { callSlot } = helpers;
|
|
|
|
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 {
|
|
b3 = callSlot(ctx, node, key, 'default', false, {});
|
|
}
|
|
return block1([], [b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the mounted call 3`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div>Some text</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the willPatch call 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { markRaw } = helpers;
|
|
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, false);
|
|
const comp2 = app.createComponent(\`ErrorBoundary\`, true, true, false, true);
|
|
|
|
let block3 = createBlock(\`<div>
|
|
<span><block-text-0/></span>
|
|
<block-child-0/>
|
|
</div>\`);
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
return comp1({message: ctx['state'].message}, key + \`__1\`, node, this, null);
|
|
}
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b2 = text(\`
|
|
\`);
|
|
let txt1 = ctx['state'].message;
|
|
const b5 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
|
const b3 = block3([txt1], [b5]);
|
|
return multi([b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the willPatch call 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { callSlot } = helpers;
|
|
|
|
let block3 = createBlock(\`<div>
|
|
<block-child-0/><block-child-1/><block-child-1/>
|
|
</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b2 = text(\`
|
|
\`);
|
|
let b4,b5;
|
|
if (ctx['state'].error) {
|
|
b4 = text(\`Error handled\`);
|
|
} else {
|
|
b5 = callSlot(ctx, node, key, 'default', false, {});
|
|
}
|
|
const b3 = block3([], [b4, b5]);
|
|
return multi([b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the willPatch call 3`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let txt1 = ctx['props'].message;
|
|
return block1([txt1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the willStart call 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { markRaw } = helpers;
|
|
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
|
const comp2 = app.createComponent(\`ErrorBoundary\`, true, true, false, true);
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
|
}
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b3 = comp2({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__2\`, node, this, null);
|
|
return block1([], [b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the willStart call 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { callSlot } = helpers;
|
|
|
|
let block3 = createBlock(\`<div>
|
|
<block-child-0/><block-child-1/><block-child-1/>
|
|
</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b2 = text(\`
|
|
\`);
|
|
let b4,b5;
|
|
if (ctx['state'].error) {
|
|
b4 = text(\`Error handled\`);
|
|
} else {
|
|
b5 = callSlot(ctx, node, key, 'default', false, {});
|
|
}
|
|
const b3 = block3([], [b4, b5]);
|
|
return multi([b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error in the willStart call 3`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div>Some text</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error origination from a child's willStart function 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { markRaw } = helpers;
|
|
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);
|
|
|
|
let block1 = createBlock(\`<div>
|
|
<block-child-0/>
|
|
</div>\`);
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
const b3 = comp1({}, key + \`__1\`, node, this, null);
|
|
const b4 = comp2({}, key + \`__2\`, node, this, null);
|
|
return multi([b3, b4]);
|
|
}
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b5 = comp3({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__3\`, node, this, null);
|
|
return block1([], [b5]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error origination from a child's willStart function 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { callSlot } = helpers;
|
|
|
|
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 {
|
|
b3 = callSlot(ctx, node, key, 'default', false, {});
|
|
}
|
|
return block1([], [b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error origination from a child's willStart function 3`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div>classic</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors can catch an error origination from a child's willStart function 4`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div>Some text</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors catchError in catchError 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
|
|
|
let block3 = createBlock(\`<div>
|
|
<block-child-0/><block-child-1/>
|
|
</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b2 = text(\`
|
|
\`);
|
|
let b4,b5;
|
|
if (ctx['error']) {
|
|
b4 = text(\`Error\`);
|
|
} else {
|
|
const b6 = text(\`
|
|
\`);
|
|
const b7 = comp1({}, key + \`__1\`, node, this, null);
|
|
const b8 = text(\`
|
|
\`);
|
|
b5 = multi([b6, b7, b8]);
|
|
}
|
|
const b3 = block3([], [b4, b5]);
|
|
return multi([b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors catchError in catchError 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
const comp1 = app.createComponent(\`Boom\`, true, false, false, true);
|
|
|
|
let block3 = createBlock(\`<div>
|
|
<block-child-0/>
|
|
</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b2 = text(\`
|
|
\`);
|
|
const b4 = comp1({}, key + \`__1\`, node, this, null);
|
|
const b3 = block3([], [b4]);
|
|
return multi([b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors catchError in catchError 3`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let txt1 = ctx['a'].b.c;
|
|
return block1([txt1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors catching error, rethrow, render parent -- a main component loop implementation 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { prepareList, capture, markRaw, withKey } = helpers;
|
|
const comp1 = app.createComponent(null, false, false, false, true);
|
|
const comp2 = app.createComponent(\`ErrorHandler\`, true, true, false, false);
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
const b7 = text(\`
|
|
\`);
|
|
const Comp1 = ctx['cp'].Comp;
|
|
const b8 = toggler(Comp1, comp1({}, key + \`__1\`, node, this, Comp1));
|
|
const b9 = text(\`
|
|
\`);
|
|
return multi([b7, b8, b9]);
|
|
}
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b2 = text(\`
|
|
\`);
|
|
ctx = Object.create(ctx);
|
|
const [k_block3, v_block3, l_block3, c_block3] = prepareList(Object.values(ctx['state'].cps));;
|
|
for (let i1 = 0; i1 < l_block3; i1++) {
|
|
ctx[\`cp\`] = v_block3[i1];
|
|
const key1 = ctx['cp'].id;
|
|
const b5 = text(\`
|
|
\`);
|
|
const v1 = ctx['cp'];
|
|
const ctx1 = capture(ctx);
|
|
const b10 = comp2({onError: ()=>this.cleanUp(v1.id),slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2__\${key1}\`, node, this, null);
|
|
const b11 = text(\`
|
|
\`);
|
|
c_block3[i1] = withKey(multi([b5, b10, b11]), key1);
|
|
}
|
|
const b3 = list(c_block3);
|
|
return multi([b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors catching error, rethrow, render parent -- a main component loop implementation 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { callSlot } = helpers;
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return callSlot(ctx, node, key, 'default', false, {});
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors catching error, rethrow, render parent -- a main component loop implementation 3`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
const comp1 = app.createComponent(\`ErrorComponent\`, true, false, false, true);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors catching error, rethrow, render parent -- a main component loop implementation 4`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
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`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div>Sibling</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors catching in child makes parent render 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { prepareList, capture, markRaw, withKey } = helpers;
|
|
const comp1 = app.createComponent(null, false, false, false, false);
|
|
const comp2 = app.createComponent(\`Catch\`, true, true, false, false);
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
const b7 = text(\`
|
|
\`);
|
|
const Comp1 = ctx['elem'][1];
|
|
const b8 = toggler(Comp1, comp1({id: ctx['elem'][0]}, key + \`__1\`, node, this, Comp1));
|
|
const b9 = text(\`
|
|
\`);
|
|
return multi([b7, b8, b9]);
|
|
}
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b2 = text(\`
|
|
\`);
|
|
ctx = Object.create(ctx);
|
|
const [k_block3, v_block3, l_block3, c_block3] = prepareList(Object.entries(this.elements));;
|
|
for (let i1 = 0; i1 < l_block3; i1++) {
|
|
ctx[\`elem\`] = v_block3[i1];
|
|
const key1 = ctx['elem'][0];
|
|
const b5 = text(\`
|
|
\`);
|
|
const v1 = ctx['elem'];
|
|
const ctx1 = capture(ctx);
|
|
const b10 = comp2({onError: (_error)=>this.onError(v1[0],_error),slots: markRaw({'default': {__render: slot1, __ctx: ctx1}})}, key + \`__2__\${key1}\`, node, this, null);
|
|
const b11 = text(\`
|
|
\`);
|
|
c_block3[i1] = withKey(multi([b5, b10, b11]), key1);
|
|
}
|
|
ctx = ctx.__proto__;
|
|
const b3 = list(c_block3);
|
|
const b12 = text(\`
|
|
\`);
|
|
return multi([b2, b3, b12]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors catching in child makes parent render 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { callSlot } = helpers;
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return callSlot(ctx, node, key, 'default', false, {});
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors catching in child makes parent render 3`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors catching in child makes parent render 4`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let txt1 = 'Child '+ctx['props'].id;
|
|
return block1([txt1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors error in mounted on a component with a sibling (properly mounted) 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { markRaw } = helpers;
|
|
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);
|
|
|
|
let block1 = createBlock(\`<div>
|
|
<block-child-0/>
|
|
<block-child-1/>
|
|
</div>\`);
|
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
|
return comp2({}, key + \`__2\`, node, this, null);
|
|
}
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b2 = comp1({}, key + \`__1\`, node, this, null);
|
|
const b4 = comp3({slots: markRaw({'default': {__render: slot1, __ctx: ctx}})}, key + \`__3\`, node, this, null);
|
|
return block1([], [b2, b4]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors error in mounted on a component with a sibling (properly mounted) 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
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`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
let { callSlot } = helpers;
|
|
|
|
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 {
|
|
b3 = callSlot(ctx, node, key, 'default', false, {});
|
|
}
|
|
return block1([], [b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors error in mounted on a component with a sibling (properly mounted) 4`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div>Some text</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors onError in class inheritance is called if rethrown 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
const comp1 = app.createComponent(\`Concrete\`, true, false, false, true);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors onError in class inheritance is called if rethrown 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div>
|
|
<block-child-0/><block-child-1/>
|
|
</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let b2,b6;
|
|
if (!ctx['state'].error) {
|
|
const b3 = text(\`
|
|
\`);
|
|
const b4 = text(this.will.crash);
|
|
const b5 = text(\`
|
|
\`);
|
|
b2 = multi([b3, b4, b5]);
|
|
} else {
|
|
const b7 = text(\`
|
|
\`);
|
|
const b8 = text(ctx['state'].error);
|
|
const b9 = text(\`
|
|
\`);
|
|
b6 = multi([b7, b8, b9]);
|
|
}
|
|
return block1([], [b2, b6]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors onError in class inheritance is not called if no rethrown 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
const comp1 = app.createComponent(\`Concrete\`, true, false, false, true);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return comp1({}, key + \`__1\`, node, this, null);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`can catch errors onError in class inheritance is not called if no rethrown 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div>
|
|
<block-child-0/><block-child-1/>
|
|
</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let b2,b6;
|
|
if (!ctx['state'].error) {
|
|
const b3 = text(\`
|
|
\`);
|
|
const b4 = text(this.will.crash);
|
|
const b5 = text(\`
|
|
\`);
|
|
b2 = multi([b3, b4, b5]);
|
|
} else {
|
|
const b7 = text(\`
|
|
\`);
|
|
const b8 = text(ctx['state'].error);
|
|
const b9 = text(\`
|
|
\`);
|
|
b6 = multi([b7, b8, b9]);
|
|
}
|
|
return block1([], [b2, b6]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`errors and promises a rendering error in a sub component will reject the mount promise 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/></div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b2 = comp1({}, key + \`__1\`, node, this, null);
|
|
return block1([], [b2]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`errors and promises a rendering error in a sub component will reject the mount promise 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let txt1 = this.will.crash;
|
|
return block1([txt1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`errors and promises a rendering error will reject the mount promise 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let txt1 = this.will.crash;
|
|
return block1([txt1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`errors and promises a rendering error will reject the render promise (with sub components) 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
const comp1 = app.createComponent(\`Child\`, true, false, false, true);
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-text-0/></div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
const b2 = comp1({}, key + \`__1\`, node, this, null);
|
|
let txt1 = ctx['x'].y;
|
|
return block1([txt1], [b2]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`errors and promises a rendering error will reject the render promise (with sub components) 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<span/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`errors and promises a rendering error will reject the render promise 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
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`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div>abc</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`errors and promises an error in onMounted callback will have the component's setup in its stack trace 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div>abc</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`errors and promises an error in patched call will reject the render promise 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let txt1 = ctx['val'];
|
|
return block1([txt1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`errors and promises an error in willPatch call will reject the render promise 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let txt1 = ctx['val'];
|
|
return block1([txt1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`errors and promises errors in mounted and in willUnmount 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div/>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`errors and promises errors in onWillRender/onRender aren't wrapped more than once 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div>abc</div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return block1();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`errors and promises errors in rerender 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let txt1 = ctx['state'].a.b;
|
|
return block1([txt1]);
|
|
}
|
|
}"
|
|
`;
|