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 component = getUniqueName( 'component' );
const mainFragment = new Fragment({ const mainFragment = new Fragment({
type: 'block',
generator, generator,
name: generator.alias( 'create_main_fragment' ), name: generator.alias( 'create_main_fragment' ),
key: null, key: null,

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

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

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

Loading…
Cancel
Save