Skip to content

Commit abda99f

Browse files
authored
Merge pull request #171 from sveltejs/gh-150
make mount private
2 parents 25e12f8 + e62ceca commit abda99f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/generate/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,15 +425,15 @@ export default function generate ( parsed, source, options, names ) {
425425
initStatements.push( deindent`
426426
this.__bindings = [];
427427
var mainFragment = renderMainFragment( state, this );
428-
if ( options.target ) this.mount( options.target );
428+
if ( options.target ) this._mount( options.target );
429429
while ( this.__bindings.length ) this.__bindings.pop()();
430430
` );
431431

432432
setStatements.push( `while ( this.__bindings.length ) this.__bindings.pop()();` );
433433
} else {
434434
initStatements.push( deindent`
435435
var mainFragment = renderMainFragment( state, this );
436-
if ( options.target ) this.mount( options.target );
436+
if ( options.target ) this._mount( options.target );
437437
` );
438438
}
439439

@@ -515,7 +515,7 @@ export default function generate ( parsed, source, options, names ) {
515515
${setStatements.join( '\n\n' )}
516516
};
517517
518-
this.mount = function mount ( target, anchor ) {
518+
this._mount = function mount ( target, anchor ) {
519519
mainFragment.mount( target, anchor );
520520
}
521521

src/generate/visitors/Component.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default {
8080
` );
8181

8282
if ( isToplevel ) {
83-
local.mount.unshift( `${name}.mount( target, anchor );` );
83+
local.mount.unshift( `${name}._mount( target, anchor );` );
8484
}
8585

8686
if ( local.dynamicAttributes.length ) {

0 commit comments

Comments
 (0)