mirror of https://github.com/sveltejs/svelte
fix: allow deletion of $$restProps properties (#12736)
parent
e66416bec7
commit
76cb89c750
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: allow deletion of $$restProps properties
|
@ -0,0 +1,10 @@
|
||||
<script>
|
||||
function prune() {
|
||||
$$restProps.a
|
||||
delete $$restProps.a
|
||||
}
|
||||
</script>
|
||||
|
||||
<button on:click={prune}>delete a</button>
|
||||
|
||||
{JSON.stringify($$restProps)}
|
@ -0,0 +1,15 @@
|
||||
import { flushSync } from 'svelte';
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
html: `<button>delete a</button>\n{"a":1,"b":2}`,
|
||||
|
||||
test({ assert, target }) {
|
||||
const [btn1] = target.querySelectorAll('button');
|
||||
|
||||
btn1.click();
|
||||
flushSync();
|
||||
|
||||
assert.htmlEqual(target.innerHTML, `<button>delete a</button>\n{"b":2}`);
|
||||
}
|
||||
});
|
@ -0,0 +1,5 @@
|
||||
<script>
|
||||
import App from "./App.svelte";
|
||||
</script>
|
||||
|
||||
<App a={1} b={2} />
|
Loading…
Reference in new issue