Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhauhau committed Mar 4, 2021
1 parent 76b3472 commit a1edc91
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
6 changes: 0 additions & 6 deletions src/compiler/compile/render_ssr/handlers/Slot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ export default function(node: Slot, renderer: Renderer, options: RenderOptions &
`);

if (slot && nearest_inline_component) {
const lets = node.lets;
const seen = new Set(lets.map(l => l.name.name));

nearest_inline_component.lets.forEach(l => {
if (!seen.has(l.name.name)) lets.push(l);
});
options.slot_scopes.set(slot, {
input: get_slot_scope(node.lets),
output: renderer.pop()
Expand Down
6 changes: 4 additions & 2 deletions test/runtime/samples/component-slot-nested-in-slot/One.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
export let a, b;
</script>

<Two {b} let:two>
<slot name="one" slot="two" one={a} two={two}></slot>
<Two {b}>
<svelte:fragment slot="two" let:two>
<slot name="one" one={a} two={two}></slot>
</svelte:fragment>
</Two>
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
export let things;
</script>

<Nested {things} let:thing={x}>
<svelte:fragment slot="main">
<Nested {things}>
<svelte:fragment slot="main" let:thing={x}>
<span>{x}</span>
</svelte:fragment>
</Nested>
4 changes: 2 additions & 2 deletions test/runtime/samples/component-svelte-slot-let-b/main.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import Nested from './Nested.svelte';
</script>

<Nested let:count>
<svelte:fragment slot="main">
<Nested>
<svelte:fragment slot="main" let:count>
<span>{count}</span>
</svelte:fragment>
</Nested>
4 changes: 2 additions & 2 deletions test/runtime/samples/component-svelte-slot-let-e/A.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
export let x;
</script>

<B {x} let:reflected>
<svelte:fragment slot="main">
<B {x}>
<svelte:fragment slot="main" let:reflected>
<span>{reflected}</span>
<slot name="main" {reflected} />
</svelte:fragment>
Expand Down

0 comments on commit a1edc91

Please sign in to comment.