[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 Aaron Bohy
parent 0bbea351a6
commit a8d8310b8e
8 changed files with 180 additions and 195 deletions
@@ -493,7 +493,6 @@ exports[`t-foreach with t-memo 1`] = `
) {
let { text, createBlock, list, multi, html, toggler, component } = bdom;
let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers;
let assign = Object.assign;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
let block3 = createBlock(\`<p><block-text-0/><block-text-1/></p>\`);
@@ -518,7 +517,7 @@ exports[`t-foreach with t-memo 1`] = `
let d1 = ctx['item'].x;
let d2 = ctx['item'].y;
c_block2[i1] = withKey(block3([d1, d2]), key1);
nextCache[key1] = assign(c_block2[i1], {memo: memo1});
nextCache[key1] = Object.assign(c_block2[i1], {memo: memo1});
}
let b2 = list(c_block2);
return block1([], [b2]);