get rid of fragment.type

pull/453/head
Rich-Harris 8 years ago
parent 96eca1235b
commit 078f36be6a

@ -109,7 +109,6 @@ export default function dom ( parsed, source, options ) {
const component = getUniqueName( 'component' );
const mainFragment = new Fragment({
type: 'block',
generator,
name: generator.alias( 'create_main_fragment' ),
key: null,

@ -79,7 +79,6 @@ export default function visitComponent ( generator, fragment, state, node ) {
const params = fragment.params.join( ', ' );
const childFragment = fragment.child({
type: 'component',
name: generator.getUniqueName( `render_${name}_yield_fragment` ), // TODO should getUniqueName happen inside Fragment? probably
builders: getBuilders()
});

@ -189,7 +189,6 @@ export default function visitEachBlock ( generator, fragment, state, node ) {
const getUniqueName = generator.getUniqueNameMaker( blockParams );
const childFragment = fragment.child({
type: 'block',
name: renderer,
expression: node.expression,
context: node.context,
@ -221,7 +220,6 @@ export default function visitEachBlock ( generator, fragment, state, node ) {
if ( node.else ) {
const childFragment = fragment.child({
type: 'block',
name: renderElse,
builders: getBuilders(),
getUniqueName: generator.getUniqueNameMaker( fragment.params )

@ -11,7 +11,7 @@ function getConditionsAndBlocks ( generator, fragment, state, node, _name, i = 0
block: name
}];
generateBlock( generator, fragment, state, node, name, 'block' );
generateBlock( generator, fragment, state, node, name );
if ( node.else && node.else.children.length === 1 &&
node.else.children[0].type === 'IfBlock' ) {
@ -26,15 +26,14 @@ function getConditionsAndBlocks ( generator, fragment, state, node, _name, i = 0
});
if ( node.else ) {
generateBlock( generator, fragment, state, node.else, name, 'block' );
generateBlock( generator, fragment, state, node.else, name );
}
}
return conditionsAndBlocks;
}
function generateBlock ( generator, fragment, state, node, name, type ) {
function generateBlock ( generator, fragment, state, node, name ) {
const childFragment = fragment.child({
type,
name,
builders: getBuilders()
});

Loading…
Cancel
Save