[REF] code_generator: move generating code to CodeTarget

Before this commit, we had two places with code that generate a function
code. Now, all this code is moved in a method 'generateCode' on
CodeTarget.
This commit is contained in:
Géry Debongnie
2021-11-25 14:50:40 +01:00
committed by Samuel Degueldre
parent a1d435c5a5
commit 5b0dce94cf
8 changed files with 180 additions and 195 deletions
+3 -3
View File
@@ -18,7 +18,7 @@ exports[`Memo if no prop change, prevent renderings from above 2`] = `
let { text, createBlock, list, multi, html, toggler, component } = bdom;
let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers;
function slot1(ctx, node, key) {
function slot1(ctx, node, key = \\"\\") {
let b6 = text(ctx['state'].a);
let b7 = text(ctx['state'].b);
let b8 = text(ctx['state'].c);
@@ -53,7 +53,7 @@ exports[`Memo if no props, prevent renderings from above 2`] = `
let { text, createBlock, list, multi, html, toggler, component } = bdom;
let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers;
function slot2(ctx, node, key) {
function slot2(ctx, node, key = \\"\\") {
return component(\`Child\`, {value: ctx['state'].value}, key + \`__3\`, node, ctx);
}
@@ -71,7 +71,7 @@ exports[`Memo if no props, prevent renderings from above (work with simple html)
let { text, createBlock, list, multi, html, toggler, component } = bdom;
let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers;
function slot1(ctx, node, key) {
function slot1(ctx, node, key = \\"\\") {
return text(ctx['state'].value);
}