mirror of https://github.com/sveltejs/svelte
fix: correctly reflect readonly proxy marker (#9893)
parent
7238e1d3ce
commit
2ca3c87d18
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: correctly reflect readonly proxy marker
|
@ -0,0 +1,11 @@
|
||||
<script>
|
||||
import Component2 from './Component2.svelte';
|
||||
const {state} = $props();
|
||||
|
||||
function render(state) {
|
||||
return state
|
||||
}
|
||||
</script>
|
||||
|
||||
<Component2 state={render(state)} />
|
||||
|
@ -0,0 +1,5 @@
|
||||
<script>
|
||||
const {state} = $props();
|
||||
</script>
|
||||
|
||||
{state}
|
@ -0,0 +1,13 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
compileOptions: {
|
||||
dev: true
|
||||
},
|
||||
async test({ assert, target }) {
|
||||
const btn = target.querySelector('button');
|
||||
|
||||
await btn?.click();
|
||||
assert.htmlEqual(target.innerHTML, `<button></button>\n[object Object]`);
|
||||
}
|
||||
});
|
@ -0,0 +1,12 @@
|
||||
<script>
|
||||
import Component from './Component.svelte';
|
||||
|
||||
let state = $state();
|
||||
</script>
|
||||
|
||||
<button onclick={() => {
|
||||
state = {}
|
||||
}}></button>
|
||||
{#if state}
|
||||
<Component state={state} />
|
||||
{/if}
|
Loading…
Reference in new issue