mirror of
https://github.com/sveltejs/svelte.git
synced 2024-12-01 01:11:24 +01:00
reduce indirection
This commit is contained in:
parent
6587cbdbac
commit
4cb1578147
@ -78,11 +78,6 @@ export default class Block {
|
||||
return this.generator.contextualise( this, expression, context, isEventHandler );
|
||||
}
|
||||
|
||||
createAnchor ( name, parentNode ) {
|
||||
const renderStatement = `${this.generator.helper( 'createComment' )}()`;
|
||||
this.addElement( name, renderStatement, parentNode, true );
|
||||
}
|
||||
|
||||
findDependencies ( expression ) {
|
||||
return this.generator.findDependencies( this.contextDependencies, this.indexes, expression );
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ export default function visitEachBlock ( generator, block, state, node ) {
|
||||
}
|
||||
|
||||
if ( node.needsAnchor ) {
|
||||
block.createAnchor( anchor, state.parentNode );
|
||||
block.addElement( anchor, `${generator.helper( 'createComment' )}()`, state.parentNode, true );
|
||||
} else if ( node.next ) {
|
||||
node.next.usedAsAnchor = true;
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ export default function visitIfBlock ( generator, block, state, node ) {
|
||||
const vars = { name, anchor, params };
|
||||
|
||||
if ( node.needsAnchor ) {
|
||||
block.createAnchor( anchor, state.parentNode );
|
||||
block.addElement( anchor, `${generator.helper( 'createComment' )}()`, state.parentNode, true );
|
||||
} else if ( node.next ) {
|
||||
node.next.usedAsAnchor = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user