diff --git a/src/compiler/compile/nodes/Slot.ts b/src/compiler/compile/nodes/Slot.ts index c21a48f5d6..0ad5cc849e 100644 --- a/src/compiler/compile/nodes/Slot.ts +++ b/src/compiler/compile/nodes/Slot.ts @@ -37,28 +37,6 @@ export default class Slot extends Element { if (!this.slot_name) this.slot_name = 'default'; - if (this.slot_name === 'default') { - // if this is the default slot, add our dependencies to any - // other slots (which inherit our slot values) that were - // previously encountered - component.slots.forEach((slot) => { - this.values.forEach((attribute, name) => { - if (!slot.values.has(name)) { - slot.values.set(name, attribute); - } - }); - }); - } else if (component.slots.has('default')) { - // otherwise, go the other way — inherit values from - // a previously encountered default slot - const default_slot = component.slots.get('default'); - default_slot.values.forEach((attribute, name) => { - if (!this.values.has(name)) { - this.values.set(name, attribute); - } - }); - } - component.slots.set(this.slot_name, this); } } diff --git a/test/runtime/samples/component-slot-default-in-each/Nested.svelte b/test/runtime/samples/component-slot-default-in-each/Nested.svelte new file mode 100644 index 0000000000..d216843101 --- /dev/null +++ b/test/runtime/samples/component-slot-default-in-each/Nested.svelte @@ -0,0 +1,11 @@ + + +{#each {length: 3} as _, i} + +{/each} + +{#await promise then value} + +{/await} diff --git a/test/runtime/samples/component-slot-default-in-each/_config.js b/test/runtime/samples/component-slot-default-in-each/_config.js new file mode 100644 index 0000000000..5c0fd13871 --- /dev/null +++ b/test/runtime/samples/component-slot-default-in-each/_config.js @@ -0,0 +1,7 @@ +export default { + html: ` +
0 - undefined
+
1 - undefined
+
2 - undefined
+ ` +}; diff --git a/test/runtime/samples/component-slot-default-in-each/main.svelte b/test/runtime/samples/component-slot-default-in-each/main.svelte new file mode 100644 index 0000000000..2ff707e04d --- /dev/null +++ b/test/runtime/samples/component-slot-default-in-each/main.svelte @@ -0,0 +1,7 @@ + + + +
{item} - {value}
+
\ No newline at end of file diff --git a/test/runtime/samples/component-slot-named-inherits-default-lets/Nested.svelte b/test/runtime/samples/component-slot-named-inherits-default-lets/Nested.svelte index 472af6278e..cecce8db01 100644 --- a/test/runtime/samples/component-slot-named-inherits-default-lets/Nested.svelte +++ b/test/runtime/samples/component-slot-named-inherits-default-lets/Nested.svelte @@ -1,6 +1,4 @@