[IMP] compiler: scope generated ids to their prefix

This means that unrelated ids (eg the id of a template, variable or key)
not longer share the same incrementing counter, meaning that you no
longer see a variable named "v2" unless another variable "v1" was
generated previously, this is also true for block data.
This commit is contained in:
Samuel Degueldre
2021-12-22 12:33:17 +01:00
committed by Aaron Bohy
parent c7af885f43
commit 9f2e2bcc66
32 changed files with 595 additions and 590 deletions
@@ -10,8 +10,8 @@ exports[`event handling handler receive the event as argument 1`] = `
return function template(ctx, node, key = \\"\\") {
let hdlr1 = [ctx['inc'], ctx];
let b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
let txt2 = ctx['state'].value;
return block1([hdlr1, txt2], [b2]);
let txt1 = ctx['state'].value;
return block1([hdlr1, txt1], [b2]);
}
}"
`;
@@ -64,8 +64,8 @@ exports[`event handling support for callable expression in event handler 1`] = `
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['state'].value;
let hdlr2 = [ctx['obj'].onInput, ctx];
return block1([txt1, hdlr2]);
let hdlr1 = [ctx['obj'].onInput, ctx];
return block1([txt1, hdlr1]);
}
}"
`;