[FIX] compiler: allow t-if with empty content

This commit is contained in:
Géry Debongnie
2021-12-01 13:16:32 +01:00
committed by Aaron Bohy
parent 49c7585998
commit 2e176f135d
4 changed files with 37 additions and 4 deletions
@@ -384,6 +384,23 @@ exports[`t-if t-if in a t-if 1`] = `
}"
`;
exports[`t-if t-if with empty content 1`] = `
"function anonymous(bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber, safeOutput } = helpers;
return function template(ctx, node, key = \\"\\") {
let b2,b3;
b2 = text(\`hello\`);
if (ctx['condition']) {
b3 = text(\`\`);
}
return multi([b2, b3]);
}
}"
`;
exports[`t-if t-if/t-else with more content 1`] = `
"function anonymous(bdom, helpers
) {