remove _mount indirection

pull/212/head
Rich-Harris 9 years ago
parent 09062bcef8
commit ef933ae93b

@ -242,7 +242,7 @@ export default function dom ( parsed, source, options, names ) {
builders.init.addBlock( deindent`
this.__bindings = [];
this._fragment = renderMainFragment( this._state, this );
if ( options.target ) this._mount( options.target );
if ( options.target ) this._fragment.mount( options.target, null );
while ( this.__bindings.length ) this.__bindings.pop()();
` );
@ -250,7 +250,7 @@ export default function dom ( parsed, source, options, names ) {
} else {
builders.init.addBlock( deindent`
this._fragment = renderMainFragment( this._state, this );
if ( options.target ) this._mount( options.target );
if ( options.target ) this._fragment.mount( options.target, null );
` );
}
@ -298,10 +298,6 @@ export default function dom ( parsed, source, options, names ) {
this.set = set;
this.teardown = teardown;
this._mount = function mount ( target, anchor ) {
this._fragment.mount( target, anchor );
}
this.root = options.root;
this.yield = options.yield;

@ -83,7 +83,7 @@ export default {
` );
if ( isToplevel ) {
generator.current.builders.mount.addLine( `${name}._mount( target, anchor );` );
generator.current.builders.mount.addLine( `${name}._fragment.mount( target, anchor );` );
}
if ( local.dynamicAttributes.length ) {

Loading…
Cancel
Save