From 2d35f937a95a628fd8c2b067245ce3ad0e29733f Mon Sep 17 00:00:00 2001 From: Rich-Harris Date: Sat, 10 Dec 2016 15:24:48 -0500 Subject: [PATCH] use builder instead of local.mount --- src/generate/visitors/Component.js | 3 +-- src/generate/visitors/Element.js | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/generate/visitors/Component.js b/src/generate/visitors/Component.js index dda336aaab..404d367385 100644 --- a/src/generate/visitors/Component.js +++ b/src/generate/visitors/Component.js @@ -85,7 +85,7 @@ export default { ` ); if ( isToplevel ) { - local.mount.unshift( `${name}._mount( target, anchor );` ); + generator.current.builders.mount.addLine( `${name}._mount( target, anchor );` ); } if ( local.dynamicAttributes.length ) { @@ -114,7 +114,6 @@ export default { generator.current.builders.init.addBlock( local.init.join( '\n' ) ); if ( local.update.length ) generator.current.builders.update.addBlock( local.update.join( '\n' ) ); - if ( local.mount.length ) generator.current.builders.mount.addBlock( local.mount.join( '\n' ) ); generator.push({ namespace: local.namespace, diff --git a/src/generate/visitors/Element.js b/src/generate/visitors/Element.js index e00029c57a..c95b6723e1 100644 --- a/src/generate/visitors/Element.js +++ b/src/generate/visitors/Element.js @@ -81,7 +81,6 @@ export default { generator.current.builders.init.addBlock( local.init.join( '\n' ) ); if ( local.update.length ) generator.current.builders.update.addBlock( local.update.join( '\n' ) ); - if ( local.mount.length ) generator.current.builders.mount.addBlock( local.mount.join( '\n' ) ); generator.createMountStatement( name );