pull/924/head
Rich Harris 8 years ago
parent 9ff5e271ec
commit 99a3987aef

@ -5,12 +5,6 @@ import { Node } from '../../interfaces';
function noop () {} function noop () {}
function isElseIf(node: Node) {
return (
node && node.children.length === 1 && node.children[0].type === 'IfBlock'
);
}
const preprocessors = { const preprocessors = {
MustacheTag: noop, MustacheTag: noop,
RawMustacheTag: noop, RawMustacheTag: noop,
@ -21,21 +15,15 @@ const preprocessors = {
node: Node, node: Node,
elementStack: Node[] elementStack: Node[]
) => { ) => {
function attachBlocks(node: Node) {
preprocessChildren(generator, node, elementStack); preprocessChildren(generator, node, elementStack);
if (isElseIf(node.else)) { if (node.else) {
attachBlocks(node.else.children[0]);
} else if (node.else) {
preprocessChildren( preprocessChildren(
generator, generator,
node.else, node.else,
elementStack elementStack
); );
} }
}
attachBlocks(node);
}, },
EachBlock: ( EachBlock: (

Loading…
Cancel
Save