0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00

keep target and anchor inside mount method

This commit is contained in:
Rich-Harris 2016-12-04 09:34:45 -05:00
parent 7654437d7b
commit 9463f5fe54

View File

@ -59,13 +59,10 @@ export default function generate ( parsed, source, options ) {
renderers.push( deindent`
function ${fragment.name} ( ${fragment.params}, component ) {
var target, anchor;
${fragment.initStatements.join( '\n\n' )}
return {
mount: function ( _target, _anchor ) {
target = _target;
anchor = _anchor;
mount: function ( target, anchor ) {
${fragment.mountStatements.join( '\n\n' )}
},