mirror of https://github.com/sveltejs/svelte
fix: ensure $inspect untracks inspected object (#11432)
parent
fcdad4c166
commit
1f9ad03287
@ -0,0 +1,5 @@
|
||||
---
|
||||
"svelte": patch
|
||||
---
|
||||
|
||||
fix: ensure $inspect untracks inspected object
|
@ -0,0 +1,11 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
compileOptions: {
|
||||
dev: true
|
||||
},
|
||||
|
||||
async test({ assert, logs }) {
|
||||
assert.deepEqual(logs, ['init', undefined, 'update', [{}]]);
|
||||
}
|
||||
});
|
@ -0,0 +1,11 @@
|
||||
<script>
|
||||
let items = [{}];
|
||||
let data = $state();
|
||||
|
||||
$effect(() => {
|
||||
data = items.slice(0, 1);
|
||||
});
|
||||
|
||||
$inspect(data);
|
||||
</script>
|
||||
|
Loading…
Reference in new issue