make mount private (#150)

pull/171/head
Rich-Harris 8 years ago
parent 941de39523
commit e62cecaff4

@ -425,7 +425,7 @@ export default function generate ( parsed, source, options, names ) {
initStatements.push( deindent`
this.__bindings = [];
var mainFragment = renderMainFragment( state, this );
if ( options.target ) this.mount( options.target );
if ( options.target ) this._mount( options.target );
while ( this.__bindings.length ) this.__bindings.pop()();
` );
@ -433,7 +433,7 @@ export default function generate ( parsed, source, options, names ) {
} else {
initStatements.push( deindent`
var mainFragment = renderMainFragment( state, this );
if ( options.target ) this.mount( options.target );
if ( options.target ) this._mount( options.target );
` );
}
@ -515,7 +515,7 @@ export default function generate ( parsed, source, options, names ) {
${setStatements.join( '\n\n' )}
};
this.mount = function mount ( target, anchor ) {
this._mount = function mount ( target, anchor ) {
mainFragment.mount( target, anchor );
}

@ -80,7 +80,7 @@ export default {
` );
if ( isToplevel ) {
local.mount.unshift( `${name}.mount( target, anchor );` );
local.mount.unshift( `${name}._mount( target, anchor );` );
}
if ( local.dynamicAttributes.length ) {

Loading…
Cancel
Save