[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
@@ -27,8 +27,11 @@ exports[`t-set slot setted value (with t-set) not accessible with t-esc 2`] = `
let block1 = createBlock(\`<div><p><block-text-0/></p><block-child-0/><p><block-text-1/></p></div>\`);
function slot2(ctx, node, key) {
function slot2(ctx, node, key = \\"\\") {
ctx = Object.create(ctx);
ctx[isBoundary] = 1
setContextValue(ctx, \\"iter\\", 'inCall');
return text('');
}
return function template(ctx, node, key = \\"\\") {