0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00

get rid of fragment.type

This commit is contained in:
Rich-Harris 2017-04-08 15:55:04 -04:00
parent 96eca1235b
commit 078f36be6a
4 changed files with 3 additions and 8 deletions

View File

@ -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,

View File

@ -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()
});

View File

@ -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 )

View File

@ -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()
});