mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] compiler: improve generated compiled code
This commit is contained in:
committed by
Aaron Bohy
parent
bd5637c0a3
commit
c7af885f43
@@ -8,8 +8,8 @@ exports[`attributes changing a class with t-att-class (preexisting class 1`] = `
|
||||
let block1 = createBlock(\`<div class=\\"hoy\\" block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['v'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['v'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -22,8 +22,8 @@ exports[`attributes changing a class with t-att-class 1`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['v'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['v'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -36,8 +36,8 @@ exports[`attributes changing an attribute with t-att- 1`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"value\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['v'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['v'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -50,8 +50,8 @@ exports[`attributes class and t-att-class should combine together 1`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\" class=\\"hello\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['value'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['value'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -64,8 +64,8 @@ exports[`attributes class and t-attf-class with ternary operation 1`] = `
|
||||
let block1 = createBlock(\`<div class=\\"hello\\" block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = (ctx['value']?'world':'');
|
||||
return block1([d1]);
|
||||
let attr1 = (ctx['value']?'world':'');
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -78,8 +78,8 @@ exports[`attributes dynamic attribute evaluating to 0 1`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['value'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['value'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -92,8 +92,8 @@ exports[`attributes dynamic attribute falsy variable 1`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['value'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['value'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -106,8 +106,8 @@ exports[`attributes dynamic attribute with a dash 1`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"data-action-id\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['id'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['id'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -120,8 +120,8 @@ exports[`attributes dynamic attributes 1`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = 'bar';
|
||||
return block1([d1]);
|
||||
let attr1 = 'bar';
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -134,8 +134,8 @@ exports[`attributes dynamic class attribute 1`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['c'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['c'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -148,8 +148,8 @@ exports[`attributes dynamic class attribute evaluating to 0 1`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['value'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['value'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -162,8 +162,8 @@ exports[`attributes dynamic empty class attribute 1`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['c'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['c'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -176,8 +176,8 @@ exports[`attributes dynamic formatted attributes with a dash 1`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"aria-label\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = \`Some text \${ctx['id']}\`;
|
||||
return block1([d1]);
|
||||
let attr1 = \`Some text \${ctx['id']}\`;
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -190,8 +190,8 @@ exports[`attributes dynamic undefined class attribute 1`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['c'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['c'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -204,8 +204,8 @@ exports[`attributes dynamic undefined generic attribute 1`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"thing\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['c'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['c'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -218,8 +218,8 @@ exports[`attributes fixed variable 1`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['value'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['value'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -232,8 +232,8 @@ exports[`attributes format expression 1`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = (ctx['value']+37);
|
||||
return block1([d1]);
|
||||
let attr1 = (ctx['value']+37);
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -246,8 +246,8 @@ exports[`attributes format literal 1`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = \`bar\`;
|
||||
return block1([d1]);
|
||||
let attr1 = \`bar\`;
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -260,8 +260,8 @@ exports[`attributes format multiple 1`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = \`a \${ctx['value1']} is \${ctx['value2']} of \${ctx['value3']} ]\`;
|
||||
return block1([d1]);
|
||||
let attr1 = \`a \${ctx['value1']} is \${ctx['value2']} of \${ctx['value3']} ]\`;
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -274,8 +274,8 @@ exports[`attributes format value 1`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = \`b\${ctx['value']}r\`;
|
||||
return block1([d1]);
|
||||
let attr1 = \`b\${ctx['value']}r\`;
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -292,8 +292,8 @@ exports[`attributes from object variables set previously 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"o\\", {a:'b'});
|
||||
let d1 = ctx['o'].a;
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['o'].a;
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -310,8 +310,8 @@ exports[`attributes from variables set previously (no external node) 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"abc\\", 'def');
|
||||
let d1 = ctx['abc'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['abc'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -328,8 +328,8 @@ exports[`attributes from variables set previously 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"abc\\", 'def');
|
||||
let d1 = ctx['abc'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['abc'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -342,8 +342,8 @@ exports[`attributes object 1`] = `
|
||||
let block1 = createBlock(\`<div block-attributes=\\"0\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['value'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['value'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -395,8 +395,8 @@ exports[`attributes t-att-class and class should combine together 1`] = `
|
||||
let block1 = createBlock(\`<div class=\\"hello\\" block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['value'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['value'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -409,8 +409,8 @@ exports[`attributes t-att-class with multiple classes 1`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = {'a b c':ctx['value']};
|
||||
return block1([d1]);
|
||||
let attr1 = {'a b c':ctx['value']};
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -423,8 +423,8 @@ exports[`attributes t-att-class with multiple classes 2`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = {['a b c']:ctx['value']};
|
||||
return block1([d1]);
|
||||
let attr1 = {['a b c']:ctx['value']};
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -437,8 +437,8 @@ exports[`attributes t-att-class with multiple classes, some of which are duplica
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = {'a b c':ctx['value'],'a b d':!ctx['value']};
|
||||
return block1([d1]);
|
||||
let attr1 = {'a b c':ctx['value'],'a b d':!ctx['value']};
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -451,8 +451,8 @@ exports[`attributes t-att-class with object 1`] = `
|
||||
let block1 = createBlock(\`<div class=\\"static\\" block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = {a:ctx['b'],c:ctx['d'],e:ctx['f']};
|
||||
return block1([d1]);
|
||||
let attr1 = {a:ctx['b'],c:ctx['d'],e:ctx['f']};
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -465,8 +465,8 @@ exports[`attributes t-attf-class 1`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = \`hello\`;
|
||||
return block1([d1]);
|
||||
let attr1 = \`hello\`;
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -479,8 +479,8 @@ exports[`attributes t-attf-class should combine with class 1`] = `
|
||||
let block1 = createBlock(\`<div class=\\"hello\\" block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = \`world\`;
|
||||
return block1([d1]);
|
||||
let attr1 = \`world\`;
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -493,8 +493,8 @@ exports[`attributes t-attf-class with multiple classes 1`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = \`hello \${ctx['word']}\`;
|
||||
return block1([d1]);
|
||||
let attr1 = \`hello \${ctx['word']}\`;
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -507,8 +507,8 @@ exports[`attributes t-attf-class with multiple classes separated by multiple spa
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = \`hello \${ctx['word']}\`;
|
||||
return block1([d1]);
|
||||
let attr1 = \`hello \${ctx['word']}\`;
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -521,8 +521,8 @@ exports[`attributes tuple literal 1`] = `
|
||||
let block1 = createBlock(\`<div block-attributes=\\"0\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ['foo','bar'];
|
||||
return block1([d1]);
|
||||
let attr1 = ['foo','bar'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -535,8 +535,8 @@ exports[`attributes tuple variable 1`] = `
|
||||
let block1 = createBlock(\`<div block-attributes=\\"0\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['value'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['value'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -562,9 +562,9 @@ exports[`attributes two dynamic attributes 1`] = `
|
||||
let block1 = createBlock(\`<div block-attribute-0=\\"foo\\" block-attribute-1=\\"bar\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = 'bar';
|
||||
let d2 = 'foo';
|
||||
return block1([d1, d2]);
|
||||
let attr1 = 'bar';
|
||||
let attr2 = 'foo';
|
||||
return block1([attr1, attr2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -577,8 +577,8 @@ exports[`attributes updating classes (with obj notation) 1`] = `
|
||||
let block1 = createBlock(\`<div class=\\"hoy\\" block-attribute-0=\\"class\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = {'a b':ctx['condition']};
|
||||
return block1([d1]);
|
||||
let attr1 = {'a b':ctx['condition']};
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -591,10 +591,10 @@ exports[`attributes various escapes 1`] = `
|
||||
let block1 = createBlock(\`<div foo=\\"<foo\\" block-attribute-0=\\"bar\\" block-attribute-1=\\"baz\\" block-attributes=\\"2\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['bar'];
|
||||
let d2 = \`<\${ctx['baz']}>\`;
|
||||
let d3 = ctx['qux'];
|
||||
return block1([d1, d2, d3]);
|
||||
let attr1 = ctx['bar'];
|
||||
let attr2 = \`<\${ctx['baz']}>\`;
|
||||
let attr3 = ctx['qux'];
|
||||
return block1([attr1, attr2, attr3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -620,8 +620,8 @@ exports[`special cases for some specific html attributes/properties input of typ
|
||||
let block1 = createBlock(\`<input type=\\"checkbox\\" block-attribute-0=\\"indeterminate\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['v'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['v'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -634,8 +634,8 @@ exports[`special cases for some specific html attributes/properties input type=
|
||||
let block1 = createBlock(\`<input type=\\"checkbox\\" block-attribute-0=\\"checked\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['flag'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['flag'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -648,8 +648,8 @@ exports[`special cases for some specific html attributes/properties input with t
|
||||
let block1 = createBlock(\`<input block-attribute-0=\\"value\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['v'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['v'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -662,8 +662,8 @@ exports[`special cases for some specific html attributes/properties select with
|
||||
let block1 = createBlock(\`<select block-attribute-0=\\"value\\"><option value=\\"potato\\">Potato</option><option value=\\"tomato\\">Tomato</option><option value=\\"onion\\">Onion</option></select>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['value'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['value'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -676,8 +676,8 @@ exports[`special cases for some specific html attributes/properties textarea wit
|
||||
let block1 = createBlock(\`<textarea block-attribute-0=\\"value\\"/>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['v'];
|
||||
return block1([d1]);
|
||||
let attr1 = ctx['v'];
|
||||
return block1([attr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -8,8 +8,8 @@ exports[`t-on can bind event handler 1`] = `
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['add'], ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [ctx['add'], ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -23,8 +23,8 @@ exports[`t-on can bind handlers with arguments 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const v1 = ctx['add'];
|
||||
let d1 = [()=>v1(5), ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [()=>v1(5), ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -38,8 +38,8 @@ exports[`t-on can bind handlers with empty object 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const v1 = ctx['doSomething'];
|
||||
let d1 = [()=>v1({}), ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [()=>v1({}), ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -53,8 +53,8 @@ exports[`t-on can bind handlers with empty object (with non empty inner string)
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const v1 = ctx['doSomething'];
|
||||
let d1 = [()=>v1({}), ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [()=>v1({}), ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -77,8 +77,8 @@ exports[`t-on can bind handlers with empty object (with non empty inner string)
|
||||
let key1 = ctx['action_index'];
|
||||
const v1 = ctx['activate'];
|
||||
const v2 = ctx['action'];
|
||||
let d1 = [()=>v1(v2), ctx];
|
||||
c_block2[i1] = withKey(block3([d1]), key1);
|
||||
let hdlr1 = [()=>v1(v2), ctx];
|
||||
c_block2[i1] = withKey(block3([hdlr1]), key1);
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
@@ -95,8 +95,8 @@ exports[`t-on can bind handlers with object arguments 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const v1 = ctx['add'];
|
||||
let d1 = [()=>v1({val:5}), ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [()=>v1({val:5}), ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -109,9 +109,9 @@ exports[`t-on can bind two event handlers 1`] = `
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\" block-handler-1=\\"dblclick\\">Click</button>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['handleClick'], ctx];
|
||||
let d2 = [ctx['handleDblClick'], ctx];
|
||||
return block1([d1, d2]);
|
||||
let hdlr1 = [ctx['handleClick'], ctx];
|
||||
let hdlr2 = [ctx['handleDblClick'], ctx];
|
||||
return block1([hdlr1, hdlr2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -124,8 +124,8 @@ exports[`t-on handler is bound to proper owner 1`] = `
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['add'], ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [ctx['add'], ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -144,8 +144,8 @@ exports[`t-on handler is bound to proper owner, part 2 1`] = `
|
||||
for (let i1 = 0; i1 < l_block1; i1++) {
|
||||
ctx[\`value\`] = v_block1[i1];
|
||||
let key1 = ctx['value'];
|
||||
let d1 = [ctx['add'], ctx];
|
||||
c_block1[i1] = withKey(block2([d1]), key1);
|
||||
let hdlr1 = [ctx['add'], ctx];
|
||||
c_block1[i1] = withKey(block2([hdlr1]), key1);
|
||||
}
|
||||
return list(c_block1);
|
||||
}
|
||||
@@ -173,8 +173,8 @@ exports[`t-on handler is bound to proper owner, part 3 2`] = `
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['add'], ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [ctx['add'], ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -211,8 +211,8 @@ exports[`t-on handler is bound to proper owner, part 4 2`] = `
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['add'], ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [ctx['add'], ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -225,8 +225,8 @@ exports[`t-on receive event in first argument 1`] = `
|
||||
let block1 = createBlock(\`<button block-handler-0=\\"click\\">Click</button>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['add'], ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [ctx['add'], ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -239,9 +239,9 @@ exports[`t-on t-on modifiers (native listener) basic support for native listener
|
||||
let block1 = createBlock(\`<div class=\\"myClass\\" block-handler-0=\\"click\\"><button block-handler-1=\\"click\\">Button</button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['divClicked'], ctx];
|
||||
let d2 = [ctx['btnClicked'], ctx];
|
||||
return block1([d1, d2]);
|
||||
let hdlr1 = [ctx['divClicked'], ctx];
|
||||
let hdlr2 = [ctx['btnClicked'], ctx];
|
||||
return block1([hdlr1, hdlr2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -254,9 +254,9 @@ exports[`t-on t-on modifiers (native listener) t-on combined with t-esc 1`] = `
|
||||
let block1 = createBlock(\`<div><button block-handler-0=\\"click\\"><block-text-1/></button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['onClick'], ctx];
|
||||
let d2 = ctx['text'];
|
||||
return block1([d1, d2]);
|
||||
let hdlr1 = [ctx['onClick'], ctx];
|
||||
let txt2 = ctx['text'];
|
||||
return block1([hdlr1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -270,9 +270,9 @@ exports[`t-on t-on modifiers (native listener) t-on combined with t-out 1`] = `
|
||||
let block1 = createBlock(\`<div><button block-handler-0=\\"click\\"><block-child-0/></button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['onClick'], ctx];
|
||||
let hdlr1 = [ctx['onClick'], ctx];
|
||||
let b2 = safeOutput(ctx['html']);
|
||||
return block1([d1], [b2]);
|
||||
return block1([hdlr1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -285,9 +285,9 @@ exports[`t-on t-on modifiers (native listener) t-on with .capture modifier 1`] =
|
||||
let block1 = createBlock(\`<div block-handler-0=\\"click.capture\\"><button block-handler-1=\\"click\\">Button</button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [\\"capture\\", ctx['onCapture'], ctx];
|
||||
let d2 = [ctx['doSomething'], ctx];
|
||||
return block1([d1, d2]);
|
||||
let hdlr1 = [\\"capture\\", ctx['onCapture'], ctx];
|
||||
let hdlr2 = [ctx['doSomething'], ctx];
|
||||
return block1([hdlr1, hdlr2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -300,8 +300,8 @@ exports[`t-on t-on modifiers (native listener) t-on with empty handler (only mod
|
||||
let block1 = createBlock(\`<div><button block-handler-0=\\"click.prevent\\">Button</button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [\\"prevent\\", , ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [\\"prevent\\", , ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -314,8 +314,8 @@ exports[`t-on t-on modifiers (native listener) t-on with prevent and self modifi
|
||||
let block1 = createBlock(\`<div><button block-handler-0=\\"click.prevent.self\\"><span>Button</span></button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [\\"prevent\\",\\"self\\", ctx['onClick'], ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [\\"prevent\\",\\"self\\", ctx['onClick'], ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -328,10 +328,10 @@ exports[`t-on t-on modifiers (native listener) t-on with prevent and/or stop mod
|
||||
let block1 = createBlock(\`<div><button block-handler-0=\\"click.prevent\\">Button 1</button><button block-handler-1=\\"click.stop\\">Button 2</button><button block-handler-2=\\"click.prevent.stop\\">Button 3</button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [\\"prevent\\", ctx['onClickPrevented'], ctx];
|
||||
let d2 = [\\"stop\\", ctx['onClickStopped'], ctx];
|
||||
let d3 = [\\"prevent\\",\\"stop\\", ctx['onClickPreventedAndStopped'], ctx];
|
||||
return block1([d1, d2, d3]);
|
||||
let hdlr1 = [\\"prevent\\", ctx['onClickPrevented'], ctx];
|
||||
let hdlr2 = [\\"stop\\", ctx['onClickStopped'], ctx];
|
||||
let hdlr3 = [\\"prevent\\",\\"stop\\", ctx['onClickPreventedAndStopped'], ctx];
|
||||
return block1([hdlr1, hdlr2, hdlr3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -353,9 +353,9 @@ exports[`t-on t-on modifiers (native listener) t-on with prevent modifier in t-f
|
||||
let key1 = ctx['project'];
|
||||
const v1 = ctx['onEdit'];
|
||||
const v2 = ctx['project'];
|
||||
let d1 = [\\"prevent\\", ev=>v1(v2.id,ev), ctx];
|
||||
let d2 = ctx['project'].name;
|
||||
c_block2[i1] = withKey(block3([d1, d2]), key1);
|
||||
let hdlr1 = [\\"prevent\\", ev=>v1(v2.id,ev), ctx];
|
||||
let txt2 = ctx['project'].name;
|
||||
c_block2[i1] = withKey(block3([hdlr1, txt2]), key1);
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
@@ -371,8 +371,8 @@ exports[`t-on t-on modifiers (native listener) t-on with self and prevent modifi
|
||||
let block1 = createBlock(\`<div><button block-handler-0=\\"click.self.prevent\\"><span>Button</span></button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [\\"self\\",\\"prevent\\", ctx['onClick'], ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [\\"self\\",\\"prevent\\", ctx['onClick'], ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -385,9 +385,9 @@ exports[`t-on t-on modifiers (native listener) t-on with self modifier 1`] = `
|
||||
let block1 = createBlock(\`<div><button block-handler-0=\\"click\\"><span>Button</span></button><button block-handler-1=\\"click.self\\"><span>Button</span></button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['onClick'], ctx];
|
||||
let d2 = [\\"self\\", ctx['onClickSelf'], ctx];
|
||||
return block1([d1, d2]);
|
||||
let hdlr1 = [ctx['onClick'], ctx];
|
||||
let hdlr2 = [\\"self\\", ctx['onClickSelf'], ctx];
|
||||
return block1([hdlr1, hdlr2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -400,9 +400,9 @@ exports[`t-on t-on modifiers (synthetic listener) basic support for synthetic 1`
|
||||
let block1 = createBlock(\`<div block-handler-0=\\"click.synthetic\\"><button block-handler-1=\\"click.synthetic\\">Button</button></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [\\"synthetic\\", ctx['divClicked'], ctx];
|
||||
let d2 = [\\"synthetic\\", ctx['btnClicked'], ctx];
|
||||
return block1([d1, d2]);
|
||||
let hdlr1 = [\\"synthetic\\", ctx['divClicked'], ctx];
|
||||
let hdlr2 = [\\"synthetic\\", ctx['btnClicked'], ctx];
|
||||
return block1([hdlr1, hdlr2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -416,8 +416,8 @@ exports[`t-on t-on with inline statement (function call) 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const v1 = ctx['state'];
|
||||
let d1 = [()=>v1.incrementCounter(2), ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [()=>v1.incrementCounter(2), ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -431,8 +431,8 @@ exports[`t-on t-on with inline statement 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const v1 = ctx['state'];
|
||||
let d1 = [()=>v1.counter++, ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [()=>v1.counter++, ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -446,8 +446,8 @@ exports[`t-on t-on with inline statement, part 2 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const v1 = ctx['state'];
|
||||
let d1 = [()=>v1.flag=!v1.flag, ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [()=>v1.flag=!v1.flag, ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -462,8 +462,8 @@ exports[`t-on t-on with inline statement, part 3 1`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const v1 = ctx['state'];
|
||||
const v2 = ctx['someFunction'];
|
||||
let d1 = [()=>v1.n=v2(3), ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [()=>v1.n=v2(3), ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -492,8 +492,8 @@ exports[`t-on t-on with t-call 2`] = `
|
||||
let block1 = createBlock(\`<p block-handler-0=\\"click\\">lucas</p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [ctx['update'], ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [ctx['update'], ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -523,8 +523,8 @@ exports[`t-on t-on, with arguments and t-call 2`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const v1 = ctx['value'];
|
||||
let d1 = [()=>this.update(v1), ctx];
|
||||
return block1([d1]);
|
||||
let hdlr1 = [()=>this.update(v1), ctx];
|
||||
return block1([hdlr1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -18,11 +18,11 @@ exports[`misc complex template 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let b2,b3,b4,b6,b8;
|
||||
let d1 = \`batch_tile \${ctx['options'].more?'more':'nomore'}\`;
|
||||
let d2 = \`card bg-\${ctx['klass']}-light\`;
|
||||
let d3 = \`/runbot/batch/\${ctx['batch'].id}\`;
|
||||
let d4 = \`badge badge-\${ctx['batch'].has_warning?'warning':'light'}\`;
|
||||
let d5 = ctx['batch'].formated_age;
|
||||
let attr1 = \`batch_tile \${ctx['options'].more?'more':'nomore'}\`;
|
||||
let attr2 = \`card bg-\${ctx['klass']}-light\`;
|
||||
let attr3 = \`/runbot/batch/\${ctx['batch'].id}\`;
|
||||
let attr4 = \`badge badge-\${ctx['batch'].has_warning?'warning':'light'}\`;
|
||||
let txt5 = ctx['batch'].formated_age;
|
||||
if (ctx['batch'].has_warning) {
|
||||
b2 = block2();
|
||||
}
|
||||
@@ -53,8 +53,8 @@ exports[`misc complex template 1`] = `
|
||||
ctx[\`commit_link\`] = v_block8[i1];
|
||||
let key1 = ctx['commit_link'].id;
|
||||
let b10,b11,b12,b13;
|
||||
let d6 = \`/runbot/commit/\${ctx['commit_link'].commit_id}\`;
|
||||
let d7 = \`badge badge-light batch_commit match_type_\${ctx['commit_link'].match_type}\`;
|
||||
let attr6 = \`/runbot/commit/\${ctx['commit_link'].commit_id}\`;
|
||||
let attr7 = \`badge badge-light batch_commit match_type_\${ctx['commit_link'].match_type}\`;
|
||||
if (ctx['commit_link'].match_type=='new') {
|
||||
b10 = block10();
|
||||
}
|
||||
@@ -67,13 +67,13 @@ exports[`misc complex template 1`] = `
|
||||
if (ctx['commit_link'].match_type=='base_head') {
|
||||
b13 = block13();
|
||||
}
|
||||
let d8 = ctx['commit_link'].commit_dname;
|
||||
let d9 = 'https://%s/commit/%s'%(ctx['commit_link'].commit_remote_url,ctx['commit_link'].commit_name);
|
||||
let d10 = ctx['commit_link'].commit_subject;
|
||||
c_block8[i1] = withKey(block9([d6, d7, d8, d9, d10], [b10, b11, b12, b13]), key1);
|
||||
let txt8 = ctx['commit_link'].commit_dname;
|
||||
let attr9 = 'https://%s/commit/%s'%(ctx['commit_link'].commit_remote_url,ctx['commit_link'].commit_name);
|
||||
let txt10 = ctx['commit_link'].commit_subject;
|
||||
c_block8[i1] = withKey(block9([attr6, attr7, txt8, attr9, txt10], [b10, b11, b12, b13]), key1);
|
||||
}
|
||||
b8 = list(c_block8);
|
||||
return block1([d1, d2, d3, d4, d5], [b2, b3, b4, b6, b8]);
|
||||
return block1([attr1, attr2, attr3, attr4, txt5], [b2, b3, b4, b6, b8]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -104,8 +104,8 @@ exports[`misc global 1`] = `
|
||||
ctx[\`value_index\`] = i1;
|
||||
ctx[\`value_value\`] = k_block2[i1];
|
||||
let key1 = ctx['value'];
|
||||
let d1 = ctx['value'];
|
||||
let b4 = block4([d1]);
|
||||
let txt1 = ctx['value'];
|
||||
let b4 = block4([txt1]);
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
ctx = Object.create(ctx);
|
||||
@@ -139,8 +139,8 @@ exports[`misc global 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = withDefault(ctx['foo'], \`foo default\`);
|
||||
return block1([d1]);
|
||||
let txt1 = withDefault(ctx['foo'], \`foo default\`);
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -154,9 +154,9 @@ exports[`misc global 3`] = `
|
||||
let block1 = createBlock(\`<año block-attribute-0=\\"falló\\"><block-child-0/></año>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = 'agüero';
|
||||
let attr1 = 'agüero';
|
||||
let b2 = ctx[zero];
|
||||
return block1([d1], [b2]);
|
||||
return block1([attr1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -216,30 +216,30 @@ exports[`misc other complex template 1`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const refs = ctx.__owl__.refs;
|
||||
let b2,b4,b14,b17,b22,b23,b24,b25;
|
||||
let d1 = \`/runbot/\${ctx['project'].slug}\`;
|
||||
let d2 = ctx['project'].name;
|
||||
let attr1 = \`/runbot/\${ctx['project'].slug}\`;
|
||||
let txt2 = ctx['project'].name;
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['projects']);
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`project\`] = v_block2[i1];
|
||||
let key1 = ctx['project'].id;
|
||||
let d3 = [ctx['selectProject'](ctx['project']), ctx];
|
||||
let d4 = ctx['project'].name;
|
||||
c_block2[i1] = withKey(block3([d3, d4]), key1);
|
||||
let hdlr3 = [ctx['selectProject'](ctx['project']), ctx];
|
||||
let txt4 = ctx['project'].name;
|
||||
c_block2[i1] = withKey(block3([hdlr3, txt4]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
b2 = list(c_block2);
|
||||
if (ctx['user']) {
|
||||
let b5,b6;
|
||||
if (ctx['user'].public) {
|
||||
let d5 = \`/web/login?redirect=/\`;
|
||||
b5 = block5([d5]);
|
||||
let attr5 = \`/web/login?redirect=/\`;
|
||||
b5 = block5([attr5]);
|
||||
} else {
|
||||
let b7,b10,b13;
|
||||
if (ctx['nb_assigned_errors']&&ctx['nb_assigned_errors']>0) {
|
||||
let d6 = \`You have \${ctx['nb_assigned_errors']} random bug assigned\`;
|
||||
let d7 = ctx['nb_assigned_errors'];
|
||||
let b8 = block8([d6, d7]);
|
||||
let attr6 = \`You have \${ctx['nb_assigned_errors']} random bug assigned\`;
|
||||
let txt7 = ctx['nb_assigned_errors'];
|
||||
let b8 = block8([attr6, txt7]);
|
||||
let b9 = block9();
|
||||
b7 = multi([b8, b9]);
|
||||
} else if (ctx['nb_build_errors']&&ctx['nb_build_errors']>0) {
|
||||
@@ -247,36 +247,36 @@ exports[`misc other complex template 1`] = `
|
||||
let b12 = block12();
|
||||
b10 = multi([b11, b12]);
|
||||
}
|
||||
let d8 = ctx['user'].name.length>25?ctx['user'].namesubstring(0,23)+'...':ctx['user'].name;
|
||||
let d9 = \`/web/session/logout?redirect=/\`;
|
||||
let d10 = \`/web\`;
|
||||
b13 = block13([d8, d9, d10]);
|
||||
let txt8 = ctx['user'].name.length>25?ctx['user'].namesubstring(0,23)+'...':ctx['user'].name;
|
||||
let attr9 = \`/web/session/logout?redirect=/\`;
|
||||
let attr10 = \`/web\`;
|
||||
b13 = block13([txt8, attr9, attr10]);
|
||||
b6 = multi([b7, b10, b13]);
|
||||
}
|
||||
b4 = multi([b5, b6]);
|
||||
}
|
||||
let d11 = [ctx['toggleSettingsMenu'], ctx];
|
||||
let d12 = [ctx['toggleMore'], ctx];
|
||||
let hdlr11 = [ctx['toggleSettingsMenu'], ctx];
|
||||
let hdlr12 = [ctx['toggleMore'], ctx];
|
||||
if (ctx['categories']&&ctx['categories'].length>1) {
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block15, v_block15, l_block15, c_block15] = prepareList(ctx['categories']);
|
||||
for (let i1 = 0; i1 < l_block15; i1++) {
|
||||
ctx[\`category\`] = v_block15[i1];
|
||||
let key1 = ctx['category'].id;
|
||||
let d13 = ctx['category'].id;
|
||||
let d14 = ctx['category'].id==ctx['options'].active_category_id;
|
||||
let d15 = ctx['category'].name;
|
||||
c_block15[i1] = withKey(block16([d13, d14, d15]), key1);
|
||||
let attr13 = ctx['category'].id;
|
||||
let attr14 = ctx['category'].id==ctx['options'].active_category_id;
|
||||
let txt15 = ctx['category'].name;
|
||||
c_block15[i1] = withKey(block16([attr13, attr14, txt15]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
let b15 = list(c_block15);
|
||||
b14 = block14([], [b15]);
|
||||
}
|
||||
let d16 = ctx['search'].value;
|
||||
let d17 = [ctx['updateFilter'], ctx];
|
||||
let d18 = [ctx['updateFilter'], ctx];
|
||||
let attr16 = ctx['search'].value;
|
||||
let hdlr17 = [ctx['updateFilter'], ctx];
|
||||
let hdlr18 = [ctx['updateFilter'], ctx];
|
||||
let d19 = (el) => refs[\`search_input\`] = el;
|
||||
let d20 = [ctx['clearSearch'], ctx];
|
||||
let hdlr20 = [ctx['clearSearch'], ctx];
|
||||
let d21 = (el) => refs[\`settings_menu\`] = el;
|
||||
if (ctx['triggers']) {
|
||||
ctx = Object.create(ctx);
|
||||
@@ -286,32 +286,32 @@ exports[`misc other complex template 1`] = `
|
||||
let key1 = ctx['trigger'].id;
|
||||
let b20;
|
||||
if (!ctx['trigger'].manual&&ctx['trigger'].project_id===ctx['project'].id&&ctx['trigger'].category_id===ctx['options'].active_category_id) {
|
||||
let d22 = \`trigger_\${ctx['trigger'].id}\`;
|
||||
let d23 = \`trigger_\${ctx['trigger'].id}\`;
|
||||
let d24 = ctx['options'].trigger_display[ctx['trigger'].id];
|
||||
let d25 = ctx['trigger'].id;
|
||||
let d26 = [ctx['updateTriggerDisplay'], ctx];
|
||||
let d27 = \`trigger_\${ctx['trigger'].id}\`;
|
||||
let d28 = ctx['trigger'].name;
|
||||
b20 = block20([d22, d23, d24, d25, d26, d27, d28]);
|
||||
let attr22 = \`trigger_\${ctx['trigger'].id}\`;
|
||||
let attr23 = \`trigger_\${ctx['trigger'].id}\`;
|
||||
let attr24 = ctx['options'].trigger_display[ctx['trigger'].id];
|
||||
let attr25 = ctx['trigger'].id;
|
||||
let hdlr26 = [ctx['updateTriggerDisplay'], ctx];
|
||||
let attr27 = \`trigger_\${ctx['trigger'].id}\`;
|
||||
let txt28 = ctx['trigger'].name;
|
||||
b20 = block20([attr22, attr23, attr24, attr25, hdlr26, attr27, txt28]);
|
||||
}
|
||||
c_block18[i1] = withKey(multi([b20]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
let b18 = list(c_block18);
|
||||
let d29 = [ctx['triggerAll'], ctx];
|
||||
let d30 = [ctx['triggerNone'], ctx];
|
||||
let d31 = [ctx['triggerDefault'], ctx];
|
||||
let d32 = [ctx['toggleSettingsMenu'], ctx];
|
||||
let b21 = block21([d29, d30, d31, d32]);
|
||||
let hdlr29 = [ctx['triggerAll'], ctx];
|
||||
let hdlr30 = [ctx['triggerNone'], ctx];
|
||||
let hdlr31 = [ctx['triggerDefault'], ctx];
|
||||
let hdlr32 = [ctx['toggleSettingsMenu'], ctx];
|
||||
let b21 = block21([hdlr29, hdlr30, hdlr31, hdlr32]);
|
||||
b17 = multi([b18, b21]);
|
||||
}
|
||||
if (ctx['load_infos']) {
|
||||
b22 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
}
|
||||
if (ctx['message']) {
|
||||
let d33 = ctx['message'];
|
||||
b23 = block23([d33]);
|
||||
let txt33 = ctx['message'];
|
||||
b23 = block23([txt33]);
|
||||
}
|
||||
if (!ctx['project']) {
|
||||
b24 = block24();
|
||||
@@ -320,7 +320,7 @@ exports[`misc other complex template 1`] = `
|
||||
let b27 = component(\`BundlesList\`, {bundles: ctx['bundles'].dev,search: ctx['search']}, key + \`__4\`, node, ctx);
|
||||
b25 = block25([], [b26, b27]);
|
||||
}
|
||||
return block1([d1, d2, d11, d12, d16, d17, d18, d19, d20, d21], [b2, b4, b14, b17, b22, b23, b24, b25]);
|
||||
return block1([attr1, txt2, hdlr11, hdlr12, attr16, hdlr17, hdlr18, d19, hdlr20, d21], [b2, b4, b14, b17, b22, b23, b24, b25]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -99,8 +99,8 @@ exports[`simple templates, mostly static dom node with t-esc 1`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['text'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['text'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -113,8 +113,8 @@ exports[`simple templates, mostly static dom node with t-esc 2`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['text'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['text'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -274,8 +274,8 @@ exports[`simple templates, mostly static t-esc in dom node 1`] = `
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['text'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['text'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -288,8 +288,8 @@ exports[`simple templates, mostly static t-esc in dom node, variations 1`] = `
|
||||
let block1 = createBlock(\`<div>hello <block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['text'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['text'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -302,8 +302,8 @@ exports[`simple templates, mostly static t-esc in dom node, variations 2`] = `
|
||||
let block1 = createBlock(\`<div>hello <block-text-0/> world</div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['text'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['text'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -316,10 +316,10 @@ exports[`simple templates, mostly static template with multiple t tag with multi
|
||||
let block1 = createBlock(\`<div><block-text-0/><block-text-1/>Loading<block-text-2/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['a'];
|
||||
let d2 = ctx['b'];
|
||||
let d3 = ctx['c'];
|
||||
return block1([d1, d2, d3]);
|
||||
let txt1 = ctx['a'];
|
||||
let txt2 = ctx['b'];
|
||||
let txt3 = ctx['c'];
|
||||
return block1([txt1, txt2, txt3]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -375,9 +375,9 @@ exports[`simple templates, mostly static two t-escs next to each other, in a div
|
||||
let block1 = createBlock(\`<div><block-text-0/><block-text-1/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['text1'];
|
||||
let d2 = ctx['text2'];
|
||||
return block1([d1, d2]);
|
||||
let txt1 = ctx['text1'];
|
||||
let txt2 = ctx['text2'];
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -286,8 +286,8 @@ exports[`t-call (template calling) dynamic t-call 2`] = `
|
||||
let block1 = createBlock(\`<foo><block-text-0/></foo>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['val'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['val'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -300,8 +300,8 @@ exports[`t-call (template calling) dynamic t-call 3`] = `
|
||||
let block1 = createBlock(\`<bar><block-text-0/></bar>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['val'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['val'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -388,7 +388,7 @@ exports[`t-call (template calling) recursive template, part 2 2`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
let d1 = ctx['node'].val;
|
||||
let txt1 = ctx['node'].val;
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['node'].children||[]);
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
@@ -405,7 +405,7 @@ exports[`t-call (template calling) recursive template, part 2 2`] = `
|
||||
ctx = ctx.__proto__;
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
return block1([d1], [b2]);
|
||||
return block1([txt1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -443,7 +443,7 @@ exports[`t-call (template calling) recursive template, part 3 2`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
let d1 = ctx['node'].val;
|
||||
let txt1 = ctx['node'].val;
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['node'].children||[]);
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
@@ -460,7 +460,7 @@ exports[`t-call (template calling) recursive template, part 3 2`] = `
|
||||
ctx = ctx.__proto__;
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
return block1([d1], [b2]);
|
||||
return block1([txt1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -500,8 +500,8 @@ exports[`t-call (template calling) recursive template, part 4: with t-set recurs
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"recursive_idx\\", ctx['recursive_idx']+1);
|
||||
let d1 = ctx['node'].val;
|
||||
let d2 = ctx['recursive_idx'];
|
||||
let txt1 = ctx['node'].val;
|
||||
let txt2 = ctx['recursive_idx'];
|
||||
ctx = Object.create(ctx);
|
||||
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['node'].children||[]);
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
@@ -518,7 +518,7 @@ exports[`t-call (template calling) recursive template, part 4: with t-set recurs
|
||||
ctx = ctx.__proto__;
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
return block1([d1, d2], [b2]);
|
||||
return block1([txt1, txt2], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -540,8 +540,8 @@ exports[`t-call (template calling) scoped parameters 1`] = `
|
||||
setContextValue(ctx, \\"foo\\", 42);
|
||||
let b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
ctx = ctx.__proto__;
|
||||
let d1 = ctx['foo'];
|
||||
return block1([d1], [b2]);
|
||||
let txt1 = ctx['foo'];
|
||||
return block1([txt1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -575,8 +575,8 @@ exports[`t-call (template calling) scoped parameters, part 2 1`] = `
|
||||
setContextValue(ctx, \\"foo\\", 42);
|
||||
let b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
ctx = ctx.__proto__;
|
||||
let d1 = ctx['foo'];
|
||||
return block1([d1], [b2]);
|
||||
let txt1 = ctx['foo'];
|
||||
return block1([txt1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -716,8 +716,8 @@ exports[`t-call (template calling) t-call with t-set inside and body text conten
|
||||
let block1 = createBlock(\`<p><block-text-0/></p>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['val'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['val'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -764,8 +764,8 @@ exports[`t-call (template calling) t-call with t-set inside and outside 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['val3'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['val3'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -831,8 +831,8 @@ exports[`t-call (template calling) t-call with t-set inside and outside. 2 3`] =
|
||||
let block2 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['val3'];
|
||||
let b2 = block2([d1]);
|
||||
let txt1 = ctx['val3'];
|
||||
let b2 = block2([txt1]);
|
||||
let b3 = text(ctx['w']);
|
||||
return multi([b2, b3]);
|
||||
}
|
||||
@@ -889,8 +889,8 @@ exports[`t-call (template calling) t-call, conditional and t-set in t-call body
|
||||
let block1 = createBlock(\`<div>callee2 <block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['v'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['v'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -922,8 +922,8 @@ exports[`t-call (template calling) t-esc inside t-call, with t-set outside 2`] =
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['v'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['v'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -1015,8 +1015,8 @@ exports[`t-call (template calling) with used body 2`] = `
|
||||
let block1 = createBlock(\`<h1><block-text-0/></h1>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx[zero];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx[zero];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -8,12 +8,12 @@ exports[`t-esc div with falsy values 1`] = `
|
||||
let block1 = createBlock(\`<div><p><block-text-0/></p><p><block-text-1/></p><p><block-text-2/></p><p><block-text-3/></p><p><block-text-4/></p></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['v1'];
|
||||
let d2 = ctx['v2'];
|
||||
let d3 = ctx['v3'];
|
||||
let d4 = ctx['v4'];
|
||||
let d5 = ctx['v5'];
|
||||
return block1([d1, d2, d3, d4, d5]);
|
||||
let txt1 = ctx['v1'];
|
||||
let txt2 = ctx['v2'];
|
||||
let txt3 = ctx['v3'];
|
||||
let txt4 = ctx['v4'];
|
||||
let txt5 = ctx['v5'];
|
||||
return block1([txt1, txt2, txt3, txt4, txt5]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -26,8 +26,8 @@ exports[`t-esc escaping 1`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['var'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['var'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -40,8 +40,8 @@ exports[`t-esc escaping on a node 1`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = 'ok';
|
||||
return block1([d1]);
|
||||
let txt1 = 'ok';
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -55,8 +55,8 @@ exports[`t-esc escaping on a node with a body 1`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = withDefault('ok', \`nope\`);
|
||||
return block1([d1]);
|
||||
let txt1 = withDefault('ok', \`nope\`);
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -70,8 +70,8 @@ exports[`t-esc escaping on a node with a body, as a default 1`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = withDefault(ctx['var'], \`nope\`);
|
||||
return block1([d1]);
|
||||
let txt1 = withDefault(ctx['var'], \`nope\`);
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -104,8 +104,8 @@ exports[`t-esc literal 1`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = 'ok';
|
||||
return block1([d1]);
|
||||
let txt1 = 'ok';
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -124,8 +124,8 @@ exports[`t-esc t-esc is escaped 1`] = `
|
||||
ctx[isBoundary] = 1
|
||||
let b2 = block2();
|
||||
ctx[\`var\`] = b2;
|
||||
let d1 = ctx['var'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['var'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -138,8 +138,8 @@ exports[`t-esc t-esc work with spread operator 1`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = [...ctx['state'].list];
|
||||
return block1([d1]);
|
||||
let txt1 = [...ctx['state'].list];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -174,8 +174,8 @@ exports[`t-esc t-esc=0 is escaped 2`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx[zero];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx[zero];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -188,8 +188,8 @@ exports[`t-esc variable 1`] = `
|
||||
let block1 = createBlock(\`<span><block-text-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['var'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['var'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
@@ -37,8 +37,8 @@ exports[`t-foreach iterate on items (on a element node) 1`] = `
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`item\`] = v_block2[i1];
|
||||
let key1 = ctx['item'];
|
||||
let d1 = ctx['item'];
|
||||
c_block2[i1] = withKey(block3([d1]), key1);
|
||||
let txt1 = ctx['item'];
|
||||
c_block2[i1] = withKey(block3([txt1]), key1);
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
@@ -200,10 +200,10 @@ exports[`t-foreach simple iteration with two nodes inside 1`] = `
|
||||
for (let i1 = 0; i1 < l_block1; i1++) {
|
||||
ctx[\`item\`] = v_block1[i1];
|
||||
let key1 = ctx['item'];
|
||||
let d1 = ctx['item'];
|
||||
let b3 = block3([d1]);
|
||||
let d2 = ctx['item'];
|
||||
let b4 = block4([d2]);
|
||||
let txt1 = ctx['item'];
|
||||
let b3 = block3([txt1]);
|
||||
let txt2 = ctx['item'];
|
||||
let b4 = block4([txt2]);
|
||||
c_block1[i1] = withKey(multi([b3, b4]), key1);
|
||||
}
|
||||
return list(c_block1);
|
||||
@@ -250,16 +250,16 @@ exports[`t-foreach t-call with body in t-foreach in t-foreach 1`] = `
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
let b4 = list(c_block4);
|
||||
let d1 = ctx['c'];
|
||||
let b6 = block6([d1]);
|
||||
let txt1 = ctx['c'];
|
||||
let b6 = block6([txt1]);
|
||||
c_block2[i1] = withKey(multi([b4, b6]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
let b2 = list(c_block2);
|
||||
let d2 = ctx['a'];
|
||||
let d3 = ctx['b'];
|
||||
let d4 = ctx['c'];
|
||||
return block1([d2, d3, d4], [b2]);
|
||||
let txt2 = ctx['a'];
|
||||
let txt3 = ctx['b'];
|
||||
let txt4 = ctx['c'];
|
||||
return block1([txt2, txt3, txt4], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -315,16 +315,16 @@ exports[`t-foreach t-call without body in t-foreach in t-foreach 1`] = `
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
let b4 = list(c_block4);
|
||||
let d1 = ctx['c'];
|
||||
let b6 = block6([d1]);
|
||||
let txt1 = ctx['c'];
|
||||
let b6 = block6([txt1]);
|
||||
c_block2[i1] = withKey(multi([b4, b6]), key1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
let b2 = list(c_block2);
|
||||
let d2 = ctx['a'];
|
||||
let d3 = ctx['b'];
|
||||
let d4 = ctx['c'];
|
||||
return block1([d2, d3, d4], [b2]);
|
||||
let txt2 = ctx['a'];
|
||||
let txt3 = ctx['b'];
|
||||
let txt4 = ctx['c'];
|
||||
return block1([txt2, txt3, txt4], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -401,8 +401,8 @@ exports[`t-foreach t-foreach with t-if inside (no external node) 1`] = `
|
||||
let key1 = ctx['elem'].id;
|
||||
let b3;
|
||||
if (ctx['elem'].id<3) {
|
||||
let d1 = ctx['elem'].text;
|
||||
b3 = block3([d1]);
|
||||
let txt1 = ctx['elem'].text;
|
||||
b3 = block3([txt1]);
|
||||
}
|
||||
c_block1[i1] = withKey(multi([b3]), key1);
|
||||
}
|
||||
@@ -428,8 +428,8 @@ exports[`t-foreach t-foreach with t-if inside 1`] = `
|
||||
let key1 = ctx['elem'].id;
|
||||
let b4;
|
||||
if (ctx['elem'].id<3) {
|
||||
let d1 = ctx['elem'].text;
|
||||
b4 = block4([d1]);
|
||||
let txt1 = ctx['elem'].text;
|
||||
b4 = block4([txt1]);
|
||||
}
|
||||
c_block2[i1] = withKey(multi([b4]), key1);
|
||||
}
|
||||
@@ -513,9 +513,9 @@ exports[`t-foreach with t-memo 1`] = `
|
||||
continue;
|
||||
}
|
||||
}
|
||||
let d1 = ctx['item'].x;
|
||||
let d2 = ctx['item'].y;
|
||||
c_block2[i1] = withKey(block3([d1, d2]), key1);
|
||||
let txt1 = ctx['item'].x;
|
||||
let txt2 = ctx['item'].y;
|
||||
c_block2[i1] = withKey(block3([txt1, txt2]), key1);
|
||||
nextCache[key1] = Object.assign(c_block2[i1], {memo: memo1});
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
|
||||
@@ -212,8 +212,8 @@ exports[`t-if dynamic content after t-if with two children nodes 1`] = `
|
||||
let b4 = block4();
|
||||
b2 = multi([b3, b4]);
|
||||
}
|
||||
let d1 = ctx['text'];
|
||||
return block1([d1], [b2]);
|
||||
let txt1 = ctx['text'];
|
||||
return block1([txt1], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -522,8 +522,8 @@ exports[`t-if two t-ifs next to each other 1`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let b2,b3;
|
||||
if (ctx['condition']) {
|
||||
let d1 = ctx['text'];
|
||||
b2 = block2([d1]);
|
||||
let txt1 = ctx['text'];
|
||||
b2 = block2([txt1]);
|
||||
}
|
||||
if (ctx['condition']) {
|
||||
let b4 = block4();
|
||||
|
||||
@@ -9,8 +9,8 @@ exports[`t-key can use t-key directive on a node 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const tKey_1 = ctx['beer'].id;
|
||||
let d1 = ctx['beer'].name;
|
||||
return toggler(tKey_1, block1([d1]));
|
||||
let txt1 = ctx['beer'].name;
|
||||
return toggler(tKey_1, block1([txt1]));
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -24,8 +24,8 @@ exports[`t-key can use t-key directive on a node 2 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const tKey_1 = ctx['beer'].id;
|
||||
let d1 = ctx['beer'].name;
|
||||
return toggler(tKey_1, block1([d1]));
|
||||
let txt1 = ctx['beer'].name;
|
||||
return toggler(tKey_1, block1([txt1]));
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -39,8 +39,8 @@ exports[`t-key can use t-key directive on a node as a function 1`] = `
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const tKey_1 = ctx['getKey'](ctx['beer']);
|
||||
let d1 = ctx['beer'].name;
|
||||
return toggler(tKey_1, block1([d1]));
|
||||
let txt1 = ctx['beer'].name;
|
||||
return toggler(tKey_1, block1([txt1]));
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -60,8 +60,8 @@ exports[`t-key t-key directive in a list 1`] = `
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`beer\`] = v_block2[i1];
|
||||
let key1 = ctx['beer'].id;
|
||||
let d1 = ctx['beer'].name;
|
||||
c_block2[i1] = withKey(block3([d1]), key1);
|
||||
let txt1 = ctx['beer'].name;
|
||||
c_block2[i1] = withKey(block3([txt1]), key1);
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
|
||||
@@ -10,8 +10,8 @@ exports[`t-ref can get a dynamic ref on a node 1`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const refs = ctx.__owl__.refs;
|
||||
const v1 = ctx['id'];
|
||||
let d1 = (el) => refs[\`myspan\${v1}\`] = el;
|
||||
return block1([d1]);
|
||||
let ref1 = (el) => refs[\`myspan\${v1}\`] = el;
|
||||
return block1([ref1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -100,9 +100,9 @@ exports[`t-ref refs in a loop 1`] = `
|
||||
let key1 = ctx['item'];
|
||||
const tKey_1 = ctx['item'];
|
||||
const v2 = ctx['item'];
|
||||
let d1 = (el) => refs[\`\${v2}\`] = el;
|
||||
let d2 = ctx['item'];
|
||||
c_block2[i1] = withKey(block3([d1, d2]), tKey_1 + key1);
|
||||
let ref1 = (el) => refs[\`\${v2}\`] = el;
|
||||
let txt2 = ctx['item'];
|
||||
c_block2[i1] = withKey(block3([ref1, txt2]), tKey_1 + key1);
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
|
||||
@@ -12,8 +12,8 @@ exports[`t-set evaluate value expression 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"value\\", 1+2);
|
||||
let d1 = ctx['value'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['value'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -30,8 +30,8 @@ exports[`t-set evaluate value expression, part 2 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"value\\", ctx['somevariable']+2);
|
||||
let d1 = ctx['value'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['value'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -63,8 +63,8 @@ exports[`t-set set from attribute literal 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"value\\", 'ok');
|
||||
let d1 = ctx['value'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['value'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -81,8 +81,8 @@ exports[`t-set set from attribute lookup 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"stuff\\", ctx['value']);
|
||||
let d1 = ctx['stuff'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['stuff'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -115,8 +115,8 @@ exports[`t-set set from body lookup 1`] = `
|
||||
ctx[isBoundary] = 1
|
||||
let b2 = text(ctx['value']);
|
||||
ctx[\`stuff\`] = b2;
|
||||
let d1 = ctx['stuff'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['stuff'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -133,8 +133,8 @@ exports[`t-set set from empty body 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"stuff\\", null);
|
||||
let d1 = ctx['stuff'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['stuff'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -173,8 +173,8 @@ exports[`t-set t-set body is evaluated immediately 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"v1\\", 'before');
|
||||
let d1 = ctx['v1'];
|
||||
let b2 = block2([d1]);
|
||||
let txt1 = ctx['v1'];
|
||||
let b2 = block2([txt1]);
|
||||
ctx[\`v2\`] = b2;
|
||||
setContextValue(ctx, \\"v1\\", 'after');
|
||||
let b3 = safeOutput(ctx['v2']);
|
||||
@@ -196,10 +196,10 @@ exports[`t-set t-set can't alter from within callee 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"iter\\", 'source');
|
||||
let d1 = ctx['iter'];
|
||||
let txt1 = ctx['iter'];
|
||||
let b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
let d2 = ctx['iter'];
|
||||
return block1([d1, d2], [b2]);
|
||||
let txt2 = ctx['iter'];
|
||||
return block1([txt1, txt2], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -215,10 +215,10 @@ exports[`t-set t-set can't alter from within callee 2`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
let d1 = ctx['iter'];
|
||||
let txt1 = ctx['iter'];
|
||||
setContextValue(ctx, \\"iter\\", 'called');
|
||||
let d2 = ctx['iter'];
|
||||
return block1([d1, d2]);
|
||||
let txt2 = ctx['iter'];
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -236,14 +236,14 @@ exports[`t-set t-set can't alter in t-call body 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"iter\\", 'source');
|
||||
let d1 = ctx['iter'];
|
||||
let txt1 = ctx['iter'];
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1;
|
||||
setContextValue(ctx, \\"iter\\", 'inCall');
|
||||
let b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
ctx = ctx.__proto__;
|
||||
let d2 = ctx['iter'];
|
||||
return block1([d1, d2], [b2]);
|
||||
let txt2 = ctx['iter'];
|
||||
return block1([txt1, txt2], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -259,10 +259,10 @@ exports[`t-set t-set can't alter in t-call body 2`] = `
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
let d1 = ctx['iter'];
|
||||
let txt1 = ctx['iter'];
|
||||
setContextValue(ctx, \\"iter\\", 'called');
|
||||
let d2 = ctx['iter'];
|
||||
return block1([d1, d2]);
|
||||
let txt2 = ctx['iter'];
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -279,8 +279,8 @@ exports[`t-set t-set does not modify render context existing key values 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"value\\", 35);
|
||||
let d1 = ctx['value'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['value'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -297,9 +297,9 @@ exports[`t-set t-set evaluates an expression only once 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"v\\", ctx['value']+' artois');
|
||||
let d1 = ctx['v'];
|
||||
let d2 = ctx['v'];
|
||||
return block1([d1, d2]);
|
||||
let txt1 = ctx['v'];
|
||||
let txt2 = ctx['v'];
|
||||
return block1([txt1, txt2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -322,14 +322,14 @@ exports[`t-set t-set outside modified in t-foreach 1`] = `
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`val\`] = v_block2[i1];
|
||||
let key1 = ctx['val'];
|
||||
let d1 = ctx['iter'];
|
||||
c_block2[i1] = withKey(block3([d1]), key1);
|
||||
let txt1 = ctx['iter'];
|
||||
c_block2[i1] = withKey(block3([txt1]), key1);
|
||||
setContextValue(ctx, \\"iter\\", ctx['iter']+1);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
let b2 = list(c_block2);
|
||||
let d2 = ctx['iter'];
|
||||
return block1([d2], [b2]);
|
||||
let txt2 = ctx['iter'];
|
||||
return block1([txt2], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -352,14 +352,14 @@ exports[`t-set t-set outside modified in t-foreach increment-after operator 1`]
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`val\`] = v_block2[i1];
|
||||
let key1 = ctx['val'];
|
||||
let d1 = ctx['iter'];
|
||||
c_block2[i1] = withKey(block3([d1]), key1);
|
||||
let txt1 = ctx['iter'];
|
||||
c_block2[i1] = withKey(block3([txt1]), key1);
|
||||
setContextValue(ctx, \\"iter\\", ctx['iter']++);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
let b2 = list(c_block2);
|
||||
let d2 = ctx['iter'];
|
||||
return block1([d2], [b2]);
|
||||
let txt2 = ctx['iter'];
|
||||
return block1([txt2], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -382,14 +382,14 @@ exports[`t-set t-set outside modified in t-foreach increment-before operator 1`]
|
||||
for (let i1 = 0; i1 < l_block2; i1++) {
|
||||
ctx[\`val\`] = v_block2[i1];
|
||||
let key1 = ctx['val'];
|
||||
let d1 = ctx['iter'];
|
||||
c_block2[i1] = withKey(block3([d1]), key1);
|
||||
let txt1 = ctx['iter'];
|
||||
c_block2[i1] = withKey(block3([txt1]), key1);
|
||||
setContextValue(ctx, \\"iter\\", ++ctx['iter']);
|
||||
}
|
||||
ctx = ctx.__proto__;
|
||||
let b2 = list(c_block2);
|
||||
let d2 = ctx['iter'];
|
||||
return block1([d2], [b2]);
|
||||
let txt2 = ctx['iter'];
|
||||
return block1([txt2], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -413,9 +413,9 @@ exports[`t-set t-set should reuse variable if possible 1`] = `
|
||||
ctx[\`elem\`] = v_block2[i1];
|
||||
ctx[\`elem_index\`] = i1;
|
||||
let key1 = ctx['elem_index'];
|
||||
let d1 = ctx['v'];
|
||||
let txt1 = ctx['v'];
|
||||
setContextValue(ctx, \\"v\\", ctx['elem']);
|
||||
c_block2[i1] = withKey(block3([d1]), key1);
|
||||
c_block2[i1] = withKey(block3([txt1]), key1);
|
||||
}
|
||||
let b2 = list(c_block2);
|
||||
return block1([], [b2]);
|
||||
@@ -438,8 +438,8 @@ exports[`t-set t-set with content and sub t-esc 1`] = `
|
||||
let b4 = text(\` boop\`);
|
||||
let b2 = multi([b3, b4]);
|
||||
ctx[\`setvar\`] = b2;
|
||||
let d1 = ctx['setvar'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['setvar'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -458,8 +458,8 @@ exports[`t-set t-set with t-value (falsy) and body 1`] = `
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"v3\\", false);
|
||||
setContextValue(ctx, \\"v1\\", 'before');
|
||||
let d1 = ctx['v1'];
|
||||
let b2 = block2([d1]);
|
||||
let txt1 = ctx['v1'];
|
||||
let b2 = block2([txt1]);
|
||||
ctx[\`v2\`] = withDefault(ctx['v3'], b2);
|
||||
setContextValue(ctx, \\"v1\\", 'after');
|
||||
setContextValue(ctx, \\"v3\\", true);
|
||||
@@ -483,8 +483,8 @@ exports[`t-set t-set with t-value (truthy) and body 1`] = `
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"v3\\", 'Truthy');
|
||||
setContextValue(ctx, \\"v1\\", 'before');
|
||||
let d1 = ctx['v1'];
|
||||
let b2 = block2([d1]);
|
||||
let txt1 = ctx['v1'];
|
||||
let b2 = block2([txt1]);
|
||||
ctx[\`v2\`] = withDefault(ctx['v3'], b2);
|
||||
setContextValue(ctx, \\"v1\\", 'after');
|
||||
setContextValue(ctx, \\"v3\\", false);
|
||||
@@ -510,8 +510,8 @@ exports[`t-set t-set, t-if, and mix of expression/body lookup, 1 1`] = `
|
||||
} else {
|
||||
setContextValue(ctx, \\"ourvar\\", 0);
|
||||
}
|
||||
let d1 = ctx['ourvar'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['ourvar'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -532,8 +532,8 @@ exports[`t-set t-set, t-if, and mix of expression/body lookup, 2 1`] = `
|
||||
} else {
|
||||
setContextValue(ctx, \\"ourvar\\", \`0\`);
|
||||
}
|
||||
let d1 = ctx['ourvar'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['ourvar'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -573,8 +573,8 @@ exports[`t-set value priority (with non text body 1`] = `
|
||||
ctx[isBoundary] = 1
|
||||
let b2 = block2();
|
||||
ctx[\`value\`] = withDefault(1, b2);
|
||||
let d1 = ctx['value'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['value'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -591,8 +591,8 @@ exports[`t-set value priority 1`] = `
|
||||
ctx = Object.create(ctx);
|
||||
ctx[isBoundary] = 1
|
||||
setContextValue(ctx, \\"value\\", withDefault(1, \`2\`));
|
||||
let d1 = ctx['value'];
|
||||
return block1([d1]);
|
||||
let txt1 = ctx['value'];
|
||||
return block1([txt1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user