From 295019f9e4956f7b870bfa7e2500b917e41328c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20S=C3=A1nchez=20Ortega?= Date: Fri, 22 Feb 2019 17:46:25 +0100 Subject: [PATCH] Check if slotted component has an update function during runtime --- src/compile/render-dom/wrappers/Slot.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compile/render-dom/wrappers/Slot.ts b/src/compile/render-dom/wrappers/Slot.ts index 440590239d..de866ed882 100644 --- a/src/compile/render-dom/wrappers/Slot.ts +++ b/src/compile/render-dom/wrappers/Slot.ts @@ -141,7 +141,7 @@ export default class SlotWrapper extends Wrapper { if (this.dependencies.size > 1) update_conditions = `(${update_conditions})`; block.builders.update.addBlock(deindent` - if (${slot} && ${update_conditions}) { + if (${slot} && ${slot}.p && ${update_conditions}) { ${slot}.p(@assign(@assign({}, ${get_slot_changes}(changed)), ctx.$$scope.changed), @get_slot_context(${slot_definition}, ctx, ${get_slot_context})); } `); @@ -150,4 +150,4 @@ export default class SlotWrapper extends Wrapper { `if (${slot}) ${slot}.d(detach);` ); } -} \ No newline at end of file +}