Merge pull request #2618 from EmilTholin/remove_21618scope_from_spread

Remove the $$scope key from $$props when calculating spread
pull/2670/head
Rich Harris 6 years ago committed by GitHub
commit c217f2b00b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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--) {
@ -34,4 +34,4 @@ export function get_spread_update(levels, updates) {
}
return update;
}
}

@ -0,0 +1,4 @@
<div>
<slot />
<div {...$$props}></div>
</div>

@ -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>
`);
}
};

@ -0,0 +1,8 @@
<script>
import Nested from './Nested.svelte';
export let value = '';
</script>
<Nested class="foo">
<input bind:value />
</Nested>
Loading…
Cancel
Save