From ef933ae93b0453aa890433078fb2ef85773c90fc Mon Sep 17 00:00:00 2001 From: Rich-Harris Date: Sun, 18 Dec 2016 12:29:46 -0500 Subject: [PATCH] remove _mount indirection --- src/generators/dom/index.js | 8 ++------ src/generators/dom/visitors/Component.js | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/generators/dom/index.js b/src/generators/dom/index.js index ecfcbab600..a6b4904491 100644 --- a/src/generators/dom/index.js +++ b/src/generators/dom/index.js @@ -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; diff --git a/src/generators/dom/visitors/Component.js b/src/generators/dom/visitors/Component.js index 72294df8fb..7a3b7c98a8 100644 --- a/src/generators/dom/visitors/Component.js +++ b/src/generators/dom/visitors/Component.js @@ -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 ) {