Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the $$scope key from $$props when calculating spread #2618

Merged
merged 1 commit into from
May 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/internal/spread.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export function get_spread_update(levels, updates) {
const update = {};

const to_null_out = {};
const accounted_for = {};
const accounted_for = { $$scope: 1 };

let i = levels.length;
while (i--) {
Expand Down Expand Up @@ -34,4 +34,4 @@ export function get_spread_update(levels, updates) {
}

return update;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div>
<slot />
<div {...$$props}></div>
</div>
19 changes: 19 additions & 0 deletions test/runtime/samples/component-slot-spread-props/_config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export default {
html: `
<div>
<input />
<div class="foo"></div>
</div>
`,

async test({ assert, component, target }) {
component.value = 'foo';

assert.htmlEqual(target.innerHTML, `
<div>
<input />
<div class="foo"></div>
</div>
`);
}
};
8 changes: 8 additions & 0 deletions test/runtime/samples/component-slot-spread-props/main.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<script>
import Nested from './Nested.svelte';
export let value = '';
</script>

<Nested class="foo">
<input bind:value />
</Nested>