Skip to content

Commit

Permalink
make mount private (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Dec 9, 2016
1 parent 941de39 commit e62ceca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/generate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,15 +425,15 @@ 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()();
` );

setStatements.push( `while ( this.__bindings.length ) this.__bindings.pop()();` );
} else {
initStatements.push( deindent`
var mainFragment = renderMainFragment( state, this );
if ( options.target ) this.mount( options.target );
if ( options.target ) this._mount( options.target );
` );
}

Expand Down Expand Up @@ -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 );
}
Expand Down
2 changes: 1 addition & 1 deletion src/generate/visitors/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down

0 comments on commit e62ceca

Please sign in to comment.