[IMP] compiler: improve generated compiled code

This commit is contained in:
Géry Debongnie
2021-12-22 11:33:12 +01:00
parent d160c4a628
commit e8b0f31da6
36 changed files with 939 additions and 936 deletions
@@ -8,8 +8,8 @@ exports[`reactivity in lifecycle can use a state hook 1`] = `
let block1 = createBlock(\`<div><block-text-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
let d1 = ctx['counter'].value;
return block1([d1]);
let txt1 = ctx['counter'].value;
return block1([txt1]);
}
}"
`;
@@ -22,8 +22,8 @@ exports[`reactivity in lifecycle can use a state hook 2 1`] = `
let block1 = createBlock(\`<div><block-text-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
let d1 = ctx['state'].a;
return block1([d1]);
let txt1 = ctx['state'].a;
return block1([txt1]);
}
}"
`;
@@ -36,8 +36,8 @@ exports[`reactivity in lifecycle change state while mounting component 1`] = `
let block1 = createBlock(\`<div><block-text-0/></div>\`);
return function template(ctx, node, key = \\"\\") {
let d1 = ctx['state'].val;
return block1([d1]);
let txt1 = ctx['state'].val;
return block1([txt1]);
}
}"
`;
@@ -67,9 +67,9 @@ exports[`reactivity in lifecycle state changes in willUnmount do not trigger rer
let block1 = createBlock(\`<span><block-text-0/><block-text-1/></span>\`);
return function template(ctx, node, key = \\"\\") {
let d1 = ctx['props'].val;
let d2 = ctx['state'].n;
return block1([d1, d2]);
let txt1 = ctx['props'].val;
let txt2 = ctx['state'].n;
return block1([txt1, txt2]);
}
}"
`;