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

fix dynamic component event code generation - fixes #1945

This commit is contained in:
Richard Harris 2019-01-04 22:30:59 -05:00
parent c1ee21b022
commit 0e59e8d4cb

View File

@ -304,9 +304,7 @@ export default class InlineComponentWrapper extends Wrapper {
});
const munged_handlers = this.node.handlers.map(handler => {
// TODO return declarations from handler.render()?
const snippet = handler.render(block);
return `${name}.$on("${handler.name}", ${snippet});`;
});
@ -378,10 +376,6 @@ export default class InlineComponentWrapper extends Wrapper {
${this.fragment && this.fragment.nodes.map(child => child.remount(name))}
${name}.$$.fragment.c();
@mount_component(${name}, ${updateMountNode}, ${anchor});
${this.node.handlers.map(handler => deindent`
${name}.$on("${handler.name}", ${handler.var});
`)}
} else {
${name} = null;
}